OTF fonts don't show up on printed page
See original GitHub issueEven when the generated PDF looks good on the computer, if you try and print any OTF fonts to paper they don’t show up in the print out. See below for details:
const fs = require('fs');
const pdf = require('pdfjs');
const helvetica = new pdf.Font(require('pdfjs/font/helvetica.json'));
const openSans = new pdf.Font(fs.readFileSync('node_modules/pdfjs/test/fixtures/font/opensans/bold.ttf'));
const doc = new pdf.Document({ font: helvetica, padding: 10 });
doc.pipe(fs.createWriteStream('output.pdf'));
// This prints "hello good bye"
doc.text().add('hello good bye');
// This prints " "
doc.text().add('hello good bye', { font: openSans });
// This prints "hello good bye"
doc.text().add('hello').add('good bye');
// This prints " "
doc.text().add('hello', { font: openSans }).add('good bye', { font: openSans });
// This prints "hello "
doc.text().add('hello').add('good bye', { font: openSans });
// This prints " good bye"
doc.text().add('hello', { font: openSans }).add('good bye');
doc.end();
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
I cannot print downloaded OTF Font - Microsoft Community
The font appears on my Word doc, but when I go to print it does not show up as that font, but a...
Read more >Unable to print OTF on Windows 10 · Issue #142 - GitHub
This turns out to be an issue with Windows 10 Type 4 printer drivers and OTF fonts (all OTFs, not just Source Sans)....
Read more >Printer not printing when particular TTF/OTF fonts are used
Go to devices and printers. · Right-click on the printer · ->Then go to Printer Properties · ->Preference · ->Advanced tab · ->...
Read more >What to do when Windows won't allow some fonts to install.
Start by clicking on the start button, then on settings, then on personalization and then on fonts. In the window that appears, drag...
Read more >Printing with my custom fonts is not working - Stack Overflow
I have a doubt about being able to print using fontFace ? try to set another safe font and see if it works....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What a bug - found some applications that print empty pages as reported but also applications that print correctly 😱
So much for PDFs are WYSIWYG. Definitely something that needs to be fixed (also for my own use of the library). Thanks for reporting!
I have set the PDF version to 1.6 for now. I’ll will publish a new NPM version later today. Thanks again for reporting this issue!