[Html2PdfConverter] Binaries Disappeared, can't "delete" old libraries because they can't be found.

[Html2PdfConverter] Binaries Disappeared, can't "delete" old libraries because they can't be found.

Forge Component
Published on 24 Mar by Guilherme Pereira
38 votes
Published on 24 Mar by Guilherme Pereira
I ran into a problem, probably related to the fact that we're hosted on the OutSystems cloud.

The html2pdf converter was working perfectly, but seemingly randomly the other day it stopped and I figured out it was because all the binaries had dissappeared. I can only assume this is part of some system cleanup that the OutSystems Cloud environment does on its own? Or... I have no idea.

My first course of action to fix this was to re-upload the binaries, after clearing out the old ones. However, I can't delete the support libraries because they can't be found. I get the following error:

Can't be found error

The good news is that re-uploading the binaries did the trick, but I still have the original libraries listed and I don't know if that's a problem.

1. What could have caused this and how do I prevent it happening again?
2. Is there a way we can use the "Resources" area within OutSystems/ServiceStudio to store the binaries instead of trying to upload separately?
3. What do I do about the above error?

Thank you,
Hi Len,

Answering your questions:

1) I don't know the cause but the latest version 1.0.8 should help prevent this. Up to this version the path was stored on the DB which in case of change on the FS would cause such errors. Can you try version 1.0.8 and let us know if you find the same problem?

2) You could change for the binaries to be inside the espace module. In the past they were in the extension module and while this made it convenient there were a few problems:
  • It would become OS dependent. We changed that to also support linux for the java stack
  • With the current wkhtmltox binaries size that would make the module around 100MB just for the .NET version thus making the deployment times near to impossible.
3) Looking at this problem I'm not sure if you use the delete with version 1.0.8 will work (I'm guessing no). I believe it is necessary an additional check and I'll try to include it when I have some time. Can you try version 1.0.8 and let us know if it worked?

All right, I'm just working on setting it up now.

Would the OutSystems cloud be considered a Farm Environment? (It's running on the AWS cloud, I can tell that much)
Hi Len,

Farm would be if you have more than one front end in your environment (DEV, TST ou PRD). You can check that on your management console (ServiceCenter) on Administration / Front-End-Servers.

Okay, thank you.

I'm still getting an error with the new version. Within the html2pdf eSpace, it seems to work fine. I can give it a URL and have it generate a pdf. However, when I try to use it via reference in my report generation module, I get the following error:

An Error was raised by the application: The system cannot find the file specified.

And end up with a 0-byte return.

Also, a related question... how can you specify the page size? The PDFs generated appear to be in A4 size; how do you specify Letter? Or Legal, for that matter?
Hi Len,

If it woks on the component but not on your application the only thing I can think of is that perhaps the consumer(s) espace(s) was/were not republished after you upgraded (and is still using the old version).

Can you also try to put the URL that generates the PDF in the test page of the component and see if it generates propertly?

For the page size you can perhaps use the component options and use the OtherArgs argument of the GeneratePDF action.

No, the consumer eSpaces have had their references refreshed multiple times and republished. That was the first thing I tried. It's still not working. It keeps saying that the System can't find the file specified.

I've tried re-uploading all of the binaries, same error.

I also tried the GeneratePdf action instead of the HtmlToPdfConverter action, and that also had the same error.

ALSO, the HtmlToPdfConverter action does not have the OtherArgs property to even try to change the paper size.

AND even in the "demo" area of the Html2Pdf component, it appears to completely ignore the other arguments. I've tried putting in "-s Letter" and "--paper-size Letter" into the other arguments and it's ignored. I can't even find where, in the logic, the OtherArguments are passed to the action. I don't think it even is, making the "other agruments" input effectively ignored. In the action of the HtmlToPDfConverter, there's a comment that points out that GeneratePDF can accept other inputs, but the HtmlToPdfConverter action doesn't have an input for it (yet).

This is all becoming very frustrating. There's no documentation or examples in any of the input properties to know the best way to format inputs and, at least for me, I can't get it to work at all anymore because it keeps saying the system can't find the file.

At least with version 1.0.7 it worked for awhile. :-/

If someone knows how to get this working, or wants to take a look and thinks they can be helpfull, I'm willing to do a Join.Me session. Just send me a PM.
Hi Len,

I understand your frustration but I'm confident we'll find a solution for your problem. Just to clarify, this component is maintained by a group of people on their spare time and as such the support/maintenace is based on a best effort basis.

Regarding the action only the GeneratePDF receives the OtherArguments on which you can pass additional arguments to the executable according to the documentation. The HtmlToPDFConverter action doesn't.

If the component works from the backoffice there must be something we are not seing and I'll PM you so we can speak in order to try and help you.

I've just uploaded a new version 1.0.9 that includes a fix that will allow people on similar sittuations to correctly delete the files and also adds a new option in the backoffice to allow additional debug information. For now this flags when active register an additional debug message on your general logs with the executed command.

Can you install this version, test it and send me the general log?