-
Before you start - checklist
Descriptionmy assumption is that getting the canvas context from Is there a way to override the default 'system' font in canvas after the loading of the PDF and before the content is first rendered? I've tried almost all the handlers that are exposed to thank you Steps to reproduceuse a callback handler to try to change canvas font
Expected behaviorI would think that instead of the system font, I'd have the text in the desired Courier font: Actual behaviorAdditional informationNo response Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
addendum, I also hid the canvas just to see if the textLayer would look ok with the new font. It has some skips and overwritings, so I don't think that is the right way to do it? |
Beta Was this translation helpful? Give feedback.
-
You can't alter PDF font. PDF.js will set a font for each node it renders. You can only set font for stuff you render yourself, like a watermark. |
Beta Was this translation helpful? Give feedback.
-
got it. I hid the canvas and wrote out the font that I wanted, but because it maps back to the original canvas/font, it just doesn't look quite right bc the glyph is always a little different. |
Beta Was this translation helpful? Give feedback.
You can't alter PDF font. PDF.js will set a font for each node it renders. You can only set font for stuff you render yourself, like a watermark.