HTMLTOPDF: Could Not Find the File

Hi Guys,

I recently installed a New Environment and set-up HTMLTOPDFCONVERTER and currently encountering this issue. I am not sure if there are settings that I missed.

Any Help/inputs appreciated.

WINDOWS SERVER

Below are the things that I did.

  • Download and Publish HTMLTOPDFConverter from Forge
  • Download the wkhtmltopdf (Bleeding Edge Version) and installed in the App Server. File Name of the installer is wkhtmltox-0.13.0-alpha-7b36694_mingw-w64-cross-win64.exe

  • Access the HTML to PDF Administration Page. And Upload the PDF Generator and Image Generator file from the Installed wkhtmltopdf installed directory. I also change the default binary directories since there is no Drive D on the App Server.
  • This is the Sample Page and URL that will be converted to pdf
  • When I click the Download And Print Button or Test the URL in the HTMLTOPDF Administration Page below is the error.
Solution

Hi Michael,

I struggled with this recently, and in my case the problem was related with folder permissions. The user generating the PDF must have permission to access and write:

  • To the working directory;
  • To c:\Windows\Temp

I just granted permissions to the Application Pool where my application was configured, but see how it works for you. Be sure to check the threads at the component discussion that may also have some interesting information for you.

Hope this helps.

Cheers

Solution

Ricardo Dias wrote:

Hi Michael,

I struggled with this recently, and in my case the problem was related with folder permissions. The user generating the PDF must have permission to access and write:

  • To the working directory;
  • To c:\Windows\Temp

I just granted permissions to the Application Pool where my application was configured, but see how it works for you. Be sure to check the threads at the component discussion that may also have some interesting information for you.

Hope this helps.

Cheers

Ricardo,

Follow-up question.

What working directory are you referring to?

May i ask what do you mean by user generating the pdf? 

Is it the user login to the application? 

Or any other user?

Hi Michael,

I'm referring to the folder where the binaries are loaded:

And about the user, I mean the network user in runtime (e.g. the one you're logged in your machine), it must have permissions to C:\Windows\Temp in the server. That was the issue in our case.

Cheers

Ricardo Dias wrote:

Hi Michael,

I'm referring to the folder where the binaries are loaded:

And about the user, I mean the network user in runtime (e.g. the one you're logged in your machine), it must have permissions to C:\Windows\Temp in the server. That was the issue in our case.

Cheers

Network User in Runtime - is the the osruntime user that you input in the configuration tool during initial setup? 


Michael Chu wrote:

Ricardo Dias wrote:

Hi Michael,

I'm referring to the folder where the binaries are loaded:

And about the user, I mean the network user in runtime (e.g. the one you're logged in your machine), it must have permissions to C:\Windows\Temp in the server. That was the issue in our case.

Cheers

Network User in Runtime - is the the osruntime user that you input in the configuration tool during initial setup? 


No, that's the database User. You have some credentials that log you to your network, right? Your username and password. That's the user I'm talking about :)


Ricardo Dias wrote:

Michael Chu wrote:

Ricardo Dias wrote:

Hi Michael,

I'm referring to the folder where the binaries are loaded:

And about the user, I mean the network user in runtime (e.g. the one you're logged in your machine), it must have permissions to C:\Windows\Temp in the server. That was the issue in our case.

Cheers

Network User in Runtime - is the the osruntime user that you input in the configuration tool during initial setup? 


No, that's the database User. You have some credentials that log you to your network, right? Your username and password. That's the user I'm talking about :)



Thank you for your help. Download pdf is working now

I'm trying to generate pdf by passing my application URL and I'm getting the error "Could not find file 'C:\Windows\TEMP\TEMPKTOYXAUWWL.pdf'.".


If I generate it passing www.google.com it works normally.

Is it the same case?

Ps. the url accepts 2 parameters that are used to fill out the form with data from database.

Hi Denis,

I don't think it is the same issue, as it works for some URLs but not others.

Is your URL to a page that requires a user to be logged in? if that's the case, it will not work with HtmlToPdfConverter, as the PDF generator runs in a different process and has no access to the OutSystems-managed Session data. In order to check, make sure you don't have any Incognito/Anonymous Browser windows/tabs open, open an Incognito Window and type as location the exact same URL you are passing to the generator. If it works, you will probably need to check the error logs to see what's going on, if not your browser will provide you with more information.

If your issue isn't sorted out by my suggestions above, I suggest you create a new Topic on the forums and give detailed information about what you have already tried and what has been the outcome.

Cheers!