marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 543 forks source link

Barcode font changes upon converting to PDF #380

Open pwong2 opened 6 years ago

pwong2 commented 6 years ago

@marcbachmann Do you have an idea why the barcode changes upon converting to PDF? The barcode cannot be read the scanner. I checked the document properties and saw these:

These should be the expected fonts: (Generated pdf using simple saving to pdf. ) screenshot_1

These were the fonts generated by node-html-pdf screenshot_2

I also noticed that they were Embedded Subset instead of Embedded only. Any feedback would be appreciated thanks!

pwong2 commented 6 years ago

@marcbachmann can you help me please?

marcbachmann commented 6 years ago

Ouch. Usually when something is converted to a pdf, phantomjs only embeds the required characters of a specific font. But sadly I have no idea what's the issue in here. Could you try to use a different font type. e.g. a .woff font instead of .ttf.

TOPS-Aman commented 6 years ago

How can I make create function wait till the .woff file is loaded? My HTML is created using javascript which waits for the .woff file to load. How to achieve this here?

pwong2 commented 6 years ago

The barcode font size is too small that the scanner can't read it. I just adjusted the font size and it solved the issue.

MuthukumarHelios commented 6 years ago

Barcode will not change Embed your Bar code as a Image before converting into a Pdf if your provide a source code means we can reproduce the issue