Closed jperkelens closed 8 years ago
Hi,
could you try to print phantomjs output somewhere
var conversion = require("phantom-html-to-pdf")(); conversion({ html: "<h1>Hello World</h1>" }, function(err, pdf) { //print phantomjs output console.log(pdf.logs); console.log(pdf.numberOfPages); pdf.stream.pipe(res); });
I added the above logging....
res.log was empty.
converter({html: html, paperSize: { orientation: 'landscape' }}, (err, pdf) => {
log.debug({logs: pdf.logs}, "pdf logs");
log.debug({pages: pdf.numberOfPages}, "pdf number of pages");
pdf.stream.pipe(res);
})
[2016-05-05T15:02:41.038Z] DEBUG: okdj-app/70305 on stravinsky.local: pdf logs (logtype=services)
[2016-05-05T15:02:41.039Z] DEBUG: okdj-app/70305 on stravinsky.local: pdf number of pages (logtype=services, pages=1)
That is strange. The pdf.logs
should be an array with at least 1 item. I double checked it and it is like that. I was using console.log..
Can you share your html?
We experienced a similar issue. Could you provide any update on that?
@demsey2 Can you share the html on which it is breaking? We are using this component very heavily in jsreport without experiencing it.
Did you try using the latest release 0.4.2?
@pofider we use Flatdoc to generate html on fly from makrdown files, from time to time our doc file doesn't contain any images, I am going to try 0.4.2 and let you know
@demsey2 Maybe you can also try to increase resourceTimeout https://github.com/pofider/phantom-html-to-pdf/issues/7#issuecomment-154761297
Closing due to inactivity. There was a very low resource loading timeout (1000ms) in one of the release which could cause missing images. This should be increased now. If you have further problem with images, please reopen.
When we upgraded from 0.3.5 to 0.4.1, we are noticing that tags are failing to render properly.
We are using express 4 and an interesting quirk we noticed is that the pdf will render properly if we first pass the html fed to the phantom server in our express app. So, for example, in the code below, the image renders appropriately if we make a request to '/page' and then '/file' but not if we just call '/file'