PDF not displayed when compiled to EXE - Forum

Forum Navigation
You need to log in to create posts and topics.

PDF not displayed when compiled to EXE

Hi, not sure if anyone experienced the same symptom. When I compiled the neoPDF-Tutorial to Windows EXE, the PDF was not shown. It works fine in browser or generated HTML, but not in EXE. Anyone can reproduce the symptom? Thanks

Hi, I tried the example and found it did not render the pdf in the built in debugger/preview. Error was 'Promise' not defined.

Tried the generated webpage in IE11 and received the same error. 'Promise' not defined line 118 in jspdf.min.js

Windows exe did not render the pdf.

Opera and Chrome web browsers opened the generated web page and displayed the pdf OK albeit slowly.

When I tried an internet webpage with an example of jspdf it failed to run in IE11.

Windows 7 home.

Hi, I installed Microsoft Edge (Developer Edition) and it runs the compiled web page OK.

Hi @ronnie and @matty47,

Compiled EXE apps use IE as the rendering engine.
Although Internet Explorer will not render inline PDF it's possible to download the generated document.
Just add some additional JavaScript libraries in order to fix the "promises" error in neoPDF plugin.
Go to Project > Properties > Advanced > Custom metadata > Head and add this code:

<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script>

Or download the JavaScript files from the CDN and add them to Project > Properties > Libraries/Files
Then just replace any neoPdfRender with neoPdfDownload.

Regards.

Hi @luishp

Yes, I've tried as suggested, using both options (script src, and Libraries/Files) as suggested. It works. However, as you mentioned, the constraint is it doesn't work inline... hence the pop-up download dialog and separate browser window opening the PDF file.

Just a suggestion... perhaps to enhance the neoPDFDownload function to include additional 2 params like

neopdfdownload "[pdftext]" "[downloadfile]" '[ReturnStatus]"

where [downloadfile] is the path/filename of the download file location, and [ReturnStatus] is the return value (like 0,1) to denote file has been downloaded successfully or not completed yet which is useful for huge pdf file size. This way, there is no filesave dialog popping up...

 

@ronnie, as far as I know there is no possiblity to save any file on the user device without a confirmation dialog. This is due to security reasons. The browsers usually save files on the "download" folder. Not sure if it's possible to know if the file has been downloaded sucessfully or not. Will investigate it.
Regards.

Open chat
1
Do you need more info?
Hi, do you have any doubt?