[Html2PdfConverter] Could not find file 'C:\Windows\TEMP\TEMPRDOPGEWQKC00000000000000000000000000000000.p

[Html2PdfConverter] Could not find file 'C:\Windows\TEMP\TEMPRDOPGEWQKC00000000000000000000000000000000.p

  
Forge Component
(40)
Published on 24 Mar by Guilherme Pereira
40 votes
Published on 24 Mar by Guilherme Pereira
Hi all,

I realize this is not the first post with this subject, I've read all posts regarding this issue and still can't get it to work.
environment: Windows 2012R2 server, MySQL, Platform server 9.0.0.23 (client: service studio 9.0.038)

What I've done so far:
  • created a dedicated user (admin rights) and set the run as username/password in servicecenter
  • set the appropriate (all) secrurity privileges on the server folders (windows\temp and also the program files\outsystems\running\htmltopdf...)
  • binary files are uploaded and in place (incl. vcredist installed, and modified system.web for uploading larger files)
  • tried both versions of wkhtmltox (msvc and mingw, recent and older versions), uploaded multiple times. 
  • Tried older versions of Html2PdfConverter
All efforts aside, the results remain the same:
  • running a sample directlly from command line on the server works fine
  • running from the demo page, goes through the process, but generated pdf is empty
It's getting a bit frustrating... is there a solution to this? 

Any help will be greatly appreciated :-)

Thanks in advance,

Bert








how are you running it from the commandline?

most porbably, you have some session-variables or some url's which cannot be resolved.

Statler & Waldorf and the amazing flappy tweedles! wrote:
how are you running it from the commandline?

most porbably, you have some session-variables or some url's which cannot be resolved.
 
 Thanks for your response.

 I ran a simple test from a command prompt on the server and also with a batch file (just to make sure that part is functioning) ie. "wkhtmltopdf.exe www.google.com google.pdf"

What is the best way to find out about the session-variables or url's that cannot be resolved?

Thanks in advance,

Bert
Hello,

Finally got it! Statler & Waldorf were right I guess. I looked like more than one instance of the app configuration was being used. Instead of taking the hard road to find whats wrong, I deleted the application and also deleted all related entries in the database. Restarted the server and installed the application again.

Finally :-)

Thanks!
on your question, regarding to test:

probably the google variant will work most of the time.
but you really need to test it like this:

"wkhtmltopdf.exe http://<server>/<yourespace>/<yourwebpagetobepdf>.aspx google.pdf"

this will popup the real issues fast enough :)


Thanks again for this helpful addition.

Have a nice day!

Bert
bhappy wrote:
Hello,

Finally got it! Statler & Waldorf were right I guess. I looked like more than one instance of the app configuration was being used. Instead of taking the hard road to find whats wrong, I deleted the application and also deleted all related entries in the database. Restarted the server and installed the application again.

Finally :-)

Thanks!
 
 I did this but the result is still the same. I still can't generate PDF thru the demo page.
Hi. 

I think the issue is related to the IUSR / NETWORKSERVICE permissions to write/read C:\Windows\Temp\ directory.

@ComponentTeam could you confirm that?
@Outsystems could you provide permissions to that folder on cloud environments?

Thanks
wkhtmltopdf requires Microsoft Visual C++ 2013 Redistributable v12.0.30501.
If you don't have it installed on your server you can get some strange errors when trying to use this component.

This VC Redist package is distributed inside the wkhtmltopdf  installer. If you unpack it, it's inside the $PLUGINSDIR folder.


Hi Guys,

The mingw version does not require MSVC 2013 and that's the version that you should use if you can not access the machine to install it (e.g On a Cloud Environment).

Regarding permissions the only ocasion that I saw this error (a part from wrong configuration) is when impersonate is used on an espace because that user does not have the necessary permissions to write on the FS.

@André if you are working on an OutSystems Platform on our Enterprise Cloud you need to ask for a location in the file system where you can read and write files. Check section 4.10.2 Application Server in the Cloud Technote. You may make this request to Support using any of the usual channels.

Cheers,
Guilherme

Hi All

I'm having the same error "Could not find file 'C:\Windows\TEMP\TEMPQXBACCEEVX00000000000000000000000000000000.pdf'."

I'm using the latest version (

Windows0.12.3.2

)

My environment is on premise server.

anyone can help?


Hi Yew,


Can you share a screenshot of your configuration? 

Also have you checked the FAQ with the most common questions? 

What steps have you taken so far to troubleshoot the issue?


Thanks,

Guilherme

Hi Guilherme

I'm not able to upload the screenshot here. Any other way i can send to you?

I use Bleeding Edge Windows (MinGW-w64) 64bit. This is the admin configuration:

PDF Generator
wkhtmltopdf.exe


Image Generator
wkhtmltoimage.exe


Additional Binaries
File NameFile TypeExecutable Type
libgcc_s_sjlj-1.dllapplication/octet-streamLibrary

libstdc++-6.dllapplication/octet-streamLibrary

libwinpthread-1.dllapplication/octet-streamLibrary

wkhtmltox.dllapplication/octet-streamLibrary



This is the error when I click the convert to pdf button:

"Could not find file 'C:\Windows\TEMP\TEMPNCHLNIOTTO00000000000000000000000000000000.pdf'.
SetProcessDpiAwareness failed: "COM error 0xffffffff80070005  (Unknown error 0x0ffffffff80070005)"
Error: Failed loading page http://xxx.com/Appraisal/PrintAppraisalForm.aspx?AppraisalId=158&UserType=6 (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1 due to network error: UnknownNetworkError"


Previously I tried to use the latest stable version and install the visual studio redistributable package, but still doesn't work.


I tried to remove all the dll files from Adminstration page, the error become lesser, left this only:

Could not find file 'C:\Windows\TEMP\TEMPOOMLTSTLBU00000000000000000000000000000000.pdf'.


Please help. 

Thanks

Xiao Hui


-------------------------------------------------------------

Guilherme Pereira wrote:


Hi Yew,


Can you share a screenshot of your configuration? 

Also have you checked the FAQ with the most common questions? 

What steps have you taken so far to troubleshoot the issue?


Thanks,

Guilherme


Also have you checked the FAQ with the most common questions? 

What steps have you taken so far to troubleshoot the issue?


Thanks,

Guilherme

Hi Guilherme

For my problem (Could not find file 'C:\Windows\TEMP\TEMPOOMLTSTLBU00000000000000000000000000000000.pdf'.), we able to solved it by changing the URL to server name instead of domain name. This work perfectly. 

I'm not sure is this an issue that can be fixed in the component?

Thanks!

Xiao Hui

Hi Xiau Hui,


Glad you found a solution.

The problem you're describing seems network related an the fact that your server cannot resolve the domain. If that's the case at the component level there's nothing you can do. It's better to check with your network admin to understand what could be the problem and if it can be solved at the network level.


Cheers,

Guilherme



Hi,


I'm having the following problem.

When i use the command directly on the server the pdf is being created in "C:\Window\Temp" but when I'm running through the test page (HowToPDF.aspx) the erro "could not find file...." occurs. I'm using the impersonate functionality in the servicecenter and the execution of the command directly on the server was made with the same user.


Any help would be appreciated.


Cheers,

Ricardo Gomes

For window platform users

Firstly which version of wkhtmltopdf installable did you choose?

It has to be MinGW and has to be 32 or 64 bit installable depending on your OS.

Make sure you add all the dlls via management portal.

This should fix your issue, if not then it has to be your application issue for which I might need your oml file.


Sree Natarajan wrote:

For window platform users

Firstly which version of wkhtmltopdf installable did you choose?

It has to be MinGW and has to be 32 or 64 bit installable depending on your OS.

Make sure you add all the dlls via management portal.

This should fix your issue, if not then it has to be your application issue for which I might need your oml file.


Hi Sree,

Thanks for replying. The version is MinGW-w64 and all the dlls are in place. As I've said in my prior post, i tested it directly in the server by using the command line and the file was created sucessfully in the temp windows folder.

The application that i'm using is the one provided here (Forge), i'm using the testing convert to pdf page.

I think the problem must be related with the impersonate functionality since the file is being created when using the command line and not using the test page.


Any ideias?


Thanks in advance.

Cheers,

Ricardo Gomes


Hi Ricardo,


My guess would be for one of two things. Either the impersonate user does not have permissions to run on the windows temp folder or does not have running permissions (the generation of pdf is done through running the wkhtmltopdf tool on a process triggered using c#).

If you're using impersonate to test it properly you have to login into the server with the same credentials you're impersonating. Can you test that?

Cheers,

Guilherme

Hi Ricardo,

Forgot to mention, for some reason "htmltopdfconvertor" doesn't work if you try to convert any page which uses silk UI framework.

Also make sure the page that you are trying to convert to pdf should be anonymously accessible.

Regards,

Sree