Open vaske opened 6 years ago
Weird issue. Could you try to delay the rendering a bit. There’s a new option named renderDelay
for that.
I assume that the network is slower and phantomjs doesn’t wait for images in css to be loaded.
@marcbachmann yeah have slow connection here only 150Mbit/s lol. I found what is the issue basically this is issue with Meteor privileges and phantomjs, some weird issue which I'm investigating, it works in debug mode of app but not in regular startup.
However would like to thanks for help, tool is great!
@marcbachmann I found another issue, I send html string to create function, as part of html is style where I have full path URL for example like this one http://www.pngmart.com/files/4/Earth-PNG-Image.png and there is a class which have that as background-image, after printing pdf have blank background instead to have this image...I wonder is there only way to render properly with images is to set base file location from where it will pull images or?
@vaske Did you ever manage to solve this? We're also running into images not being rendered in the pdf anymore with our Meteor setup.
@kkor nope, we left it and made our own pdf server for such stuff, it was long time ago :)
Thanks for the fast reply, let's see if I can fix ours :)
Hi @vaske
I have a prolem when render gmap here
I used code
pdf.create(htmlPageOne, _.merge({}, options, { orientation: 'landscape' })).toStream(function(err, stream){
let ws = stream.pipe(fs.createWriteStream(tmpPath + '/' + outputName + '_one.pdf'));
ws.on('finish', function () {
});
})
Can you help me it's same your issue?
@phanthinh nope I didn't have that kind of issue.
When I use this and store in html file, and run
html-pdf
from command line it works I see properly rendered pdf file, if I send that to pdf over nodejs like:basically this doesn't work only when html contains remote URLs, if I remove remote URLs from code it works. Is there any further parameter which will allows reading of remote URLs or?