jsreport / jsreport-wkhtmltopdf

jsreport recipe for rendering pdf using wkhtmltopdf
http://jsreport.net
MIT License
8 stars 9 forks source link

Issue with accessing local files #5

Closed foramkumarparekh closed 8 years ago

foramkumarparekh commented 8 years ago

Hi, I am creating a pf from html string and I am having an image in html which I also want in pdf along with the other content.I am using nodejs for this.

So when i try to create the pdf of the created html string, it gives the following error log:

Error during rendering report: Command failed: D:\nodeJs learning\sails js learning\FirstSailsApp\node_modules\jsreport-wkhtmltopdf\node_modules\wkhtmltopdf-installer\vendor\wkhtmltopdf.exe --disable-local-file-access C:\Users\DCS\AppData\Local\Temp\jsreport-temp\e1400c60-02eb-11e6-ac5f-9166e442552a.html C:\Users\DCS\AppData\Local\Temp\jsreport-temp\e1400c60-02eb-11e6-ac5f-9166e442552a.pdf Loading pages (1/6) [> ] 0% [======> ] 10% Warning: Blocked access to file
[========================> ] 40% [============================================================] 100% Counting pages (2/6)
[============================================================] Object 1 of 1 Resolving links (4/6)
[============================================================] Object 1 of 1 Loading headers and footers (5/6)
Printing pages (6/6) [> ] Preparing [============================================================] Page 1 of 1 Done
Exit with code 1 due to network error: ProtocolUnknownError

Also I have set the wkhtmltopdf's, allowLoaclFilesAccess to true, but yet it starts wkhtmltopdf.exe with --disable-local-file-access command.

What should i do to fix this.

pofider commented 8 years ago

Did you see my last comment? http://jsreport.net/learn/faq#comment-2624840933

It is global option, not per template option. You can do this: jsreport.use(require('jsreport-wkhtmltopdf')({ allowLocalFilesAccess: true })) or var jsreport = require('jsreport-core')({ wkhtmltopdf: { allowLocalFilesAccess: true }});

pofider commented 8 years ago

Closing this based on the other conversation.