How to solve the difference between the PDF exported by Linux and win

  •     //Version Information
        "jsreport": "^2.11.0",
        "jsreport-chrome-pdf": "=1.9.0",
        "compare-pdf": "^1.1.8",

    As shown in the figure below, the PDF exported on different platforms will have a little difference, which will cause the PDF test to fail.
    Is there a good solution to this problem, thanks.


  • And what is the difference?
    There is likely nothing we can do, we can't influence how chrome is using native OS APIs.

  • When using compare-pdf to compare two PDFs, the differences will be highlighted, such as the green part in the figure.

    The position of the fonts generated by win and linux is a little bit different, which leads to this problem.

  • Did you try using a webfont instead of fonts from OS?

  • This is the html I copied under temp before merging to PDF. From here you can see that I used my own font, so the font of win and linux should be the same.

  • Do you need to use the compare-pdf just because of some unit tests? Perhaps you find a better way of testing.

  • ok, thanks for your reply.

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.