[Html2PdfConverter] Temporary Folder

Forge Component
(60)
Published on 17 May by Guilherme Pereira
60 votes
Published on 17 May by Guilherme Pereira

Hi All,


Due to an upcoming rollout of a security policy on OutSystems PaaS infrastructures according to OutSystems internal roadmap and Cloud Services specification, writing to the filesystem on the running folder of the modules will no longer be possible.

In order for this component to continue to work on the new infrastructures as well as the existing ones (after the policy is applied) it was necessary to adjust the mechanism and have a temporary folder manually specified.

A new version of the component 1.1.9 was released to address this change.

This will also have both .NET and JAVA versions work the same way (as this was already the case for Java infrastructures).

Well what does this mean for you?

  • If you are installing or upgrading the component for the first time on a OutSystems PaaS infrastructures running .NET then you don't need to worry. The default value of the path is the one where applications are allowed to write.
  • If you're installing or upgrading the component on an OutSystems PaaS infrastructure running JAVA you'll have to review the path and set it to /opt/outsystems/user. 
  • If you're installing or upgrading the component on an on premises infrastructure you can either continue to write on the local folder (but you need to set the flag to true on the admin page) or you need to create a folder with the necessary permissions and update the path accordingly.

The path to the folder and write location can be reviewed/updated on the component admin page.

Let me know if you have any questions.


Cheers,

Guilherme

Hi Guilherme,


If you're running this on a Personal what is the correct path to the binaries?

Currently, when I try to upload the binaries it is giving me the following error.

Also, here is the error from Service Center.

Regards,

David

Hi David,


I’m trying to confirm what’s the writting path on personal environments. I’ll let you know as soon as I find it. For now on personal environments I advise you to stay on version 1.1.7 until confirmation.


Cheers,

Guilherme

Hi David,

I've confirmed that there's no temp folder on the personal environments so I've released a new version 1.1.9 to address the issue and pulled back the version 1.1.8 (updated the above post accordingly).

You can now choose between writing to the local running folder (should be set to true on personals and for those on prem that wish to keep the "old" behavior). By default is false so it uses the new temp folder.


Let me know if you face any further issues.


Cheers,

Guilherme

Guilherme, i'm trying to use the componente in an enterprise environment provided by OutSystems and i can't save the binaries on D:\User nor in the running dir. I got this message: "Could not find a part of the path 'd:\OutSystems\Platform Server\running\HtmlToPdfConverter.595998041\binaries\'"

If I try to save on D:\Users i got "Could not find a part of the path 'd:\User\binaries\'".

I debugged the application and checked if the directory exists (with and action from file_system), and both exists. I believe that this might be a permission problem on the folder.

Did you had this problem in any outsystems environment?


Thanks

Hi Victor,


I’ve tested In an enterprise cloud environment and d:\User should be working. I recommend you to contact OutSystems support so it can be troubleshooted.

Cheers,

Guilherme

Victor -

Did you ever find a fix for this? I am seeing the same thing in a Personal Environment.

KILLIAN DON'T YELL AT ME. :D

Thanks!

J.Ja

Hi Justin,


I believe Victor’s issue was in an enterprise. For personal envs it should write to the running folder as there’s no temp dir. Have you set the flag on the admin page?


Cheers,

Guilherme

Guilherme -

That flag is set to false, as per on-screen instructions:


J.Ja

Solution

Hi Justin,

Damn the message is inverted (my bad). I'll release a new version with it corrected today.

The rational is on Personals you need to write on the running dir as it is a shared infrastructure and there's no temp dir for each user and also the security feature that prevents writing on the running dir is not applied. On and Enterprise you need to use the temp dir as the runtime user doesn't have permission to write on the running dir.


Cheers,

Guilherme



Solution

Thanks everyone for this conversation thread. I am able to fix the same issue by upgrading the HtmlToPdfConverter version to 1.1.14 for my outsystems version 10. After upgrading i had to change few code in the existing application which was very minimal and straight forward.


Thanks and regards,

Kunal

Hi everyone,

sorry in advance if there's a newer thread than this.

Regarding the GeneratePDF functionality, i'm using it in dev, no problems, always generates the PDF beautifully.

However when we published to QA, it never works. it always return the message:

"Could not find file 'C:\Windows\TEMP\{myFileName}.pdf"

it doesn't make much sense to me that dev environment can access this, while QA can't.


Does anyone have any idea why this might be happening?


Thanks and Best regards,

Bruno Gonçalves

Hi Bruno,


Have you double checked your configuration?


Have you enabled the log debug messages option and checked the logs?


Have you tried to generate some pdf from the component own admin page (e.g pointing to google)?


Does the qa env have any significant differences in terms of setup (multiple front ends, etc)?


Is this an on prem or cloud env?


Technically there shouldn’t be anything preventing it from work other than configuration/setup but without furter details is hard to understand.


Cheers,

Guilherme

Hi Guilherme,

sorry i forgot to mension this is a cloud environment but not personal. Same configuration in both QA and Dev, same binaries and everything. Tried to generate some pdf from the pdf page, used google, failed. He creates the pdf but when i try to open it says it fails to load document. Tried with the multiple front-end checked, didn't work either.

There should be virtually no differences from DEV to QA, unless it's some outsystems constraint for accessing files in QA environments? i have absolutly no idea. 

I'm gonna try and check the environment configuration again, seeing as that's the only thing that makes sense to me. 

If you say it should work without any difference however, that already puts me at ease beacause it's probably just a small thing on my side and i don't have such a huge pool of doubts to help me fix it so thank you. When i do find the problem i'll post it here for the additional info. 


Thank you,
Bruno Gonçalves

Hi Bruno,


If you're using an enterprise cloud environment make sure you have the correct folder for the binaries. On on enterprise cloud I have access to we have it like this:


If it still fails can you check the Log Debug Messages option, try to generate something and share the logs from Service Center so we can take a look? (Please blur or redact any sensitive information)


Cheers,

Guilherme

Hi Guilherme,

finally found the problem, everything is fine, i was the one who had an outdated wkhtmltopdf.exe.

got a new one and everything is working now!


Also let me take the opportunity to congratulate you on a great module! keep making them!


Thanks and Best Regards,

Bruno Gonçalves



Hi Bruno,


I'm unsure but it seems that you may be using the MSVC based version. Can you try the bleeding edge MINGW version and setup with the files in a similar screen shot as I've shown before?


Opening the installer on the bin folder you should have something like this

Does this version work for you?


Cheers,

Guilherme

David Farinha wrote:

Hi Guilherme,


If you're running this on a Personal what is the correct path to the binaries?

Currently, when I try to upload the binaries it is giving me the following error.

Also, here is the error from Service Center.

Regards,

David

Hi David, 

Even I faced the same issue. Issue is with the zip folder that you are trying to download. It has to contain Binaries folder. I have tried multiple files from the downloadable location and found one with correct folder structure. Binary directories must be eg: D:\wkhtmltopdf. to the folder where binaries is available. Then try to upload the exe and dll files. It worked for me.

Thanks,

Saicharan