Node-html-pdf: Compatability between windows and LINUX

Created on 25 Aug 2017  路  3Comments  路  Source: marcbachmann/node-html-pdf

I have problems generating same PDF in windows and i Linux. The code basically works both places, but the pdf output differs between the 2 systems.

When the code runs on LINUX the width is sometimes (only in A3-landscape) about 2/3 of the width in windows.

The phantomJS version is 2.1.1 on both systems. Both have phantomjs installed only locally by npm (not by apt-get or otherwise).

Anyone seen this before ?

var pdf = require('html-pdf');
restRouter.post('/convertpdf', function(req, res, next) {
    res.setHeader('Content-disposition', 'attachment; filename="' + encodeURIComponent(req.body.file) + '"');
    res.setHeader('Content-type', 'application/pdf');
    pdf.create(req.body.html, req.body.options).toStream(function(err, stream) {
        stream.pipe(res);
        if (err)
            logger.error(err);
    });
});

Most helpful comment

I am getting inconsistent results when comparing windows to linux as well. Windows version always comes out correct, but same template generated on linux looks like zoomed in version of the windows one, resulting in overflowing to the next page, etc. Both html-pdf and phantomJS version are the same on windows and linux machines.

All 3 comments

I am getting inconsistent results when comparing windows to linux as well. Windows version always comes out correct, but same template generated on linux looks like zoomed in version of the windows one, resulting in overflowing to the next page, etc. Both html-pdf and phantomJS version are the same on windows and linux machines.

Seeing the same issue, any suggestions here?

any update on this issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antiframes picture antiframes  路  4Comments

vivekiyer114 picture vivekiyer114  路  5Comments

Messilimeng picture Messilimeng  路  4Comments

cmoulliard picture cmoulliard  路  3Comments

adman020 picture adman020  路  5Comments