PDA

View Full Version : QWebView PDF.JS loading File From URL



mayrhofer
3rd February 2016, 17:36
Hey

i use pdf.js to display PDF-Files. I want to load the files from a URL. The scipt files are in my resource file.


page()->mainFrame()->evaluateJavaScript("init();");//Initialize the pdf.js
page()->mainFrame()->evaluateJavaScript("getPDFFileNameFromURL('http://www.mobile.de/magazin/_pdf/kaufvertrag.pdf')");//An example of loading, but nothing happens


Ciao

ChrisW67
3rd February 2016, 20:36
This is a Javascript/PDF.js question, not Qt.

getPDFFileNameFromURL() does not load a PDF file. It suggests a name to save the file under during a download... and you are ignoring that return value. I suggest you start with the PDF.js examples and other resources on the project web site
https://mozilla.github.io/pdf.js/examples/
https://mozilla.github.io/pdf.js/web/viewer.html