You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm implementing a pdf viewer. My first version was based on pdf.js. while it functions, it is sluggish when zooming quickly (when rerendering is involved). I'm thinking about an alternative approach, using pdfium to rasterize the pdf into a jpg image, and create a text overlay for selection.
Initially I thought I had to load all fonts used in a pdf and render the text overlay using the right font to make sure that the text overlay will have the same size as the rasterized version. But after debugging pdf.js generated text overlay, it seems that pdf.js simply uses sans series font everywhere and doesn't respect the font weight either? I wonder what properties really matters for the text overlay to match the underneath textobject's dimension?
it seems that you simply force the outside boundary of each text object to be accurate? could you please confirm if my understanding is correct?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello pdf.js team,
I'm implementing a pdf viewer. My first version was based on pdf.js. while it functions, it is sluggish when zooming quickly (when rerendering is involved). I'm thinking about an alternative approach, using pdfium to rasterize the pdf into a jpg image, and create a text overlay for selection.
Initially I thought I had to load all fonts used in a pdf and render the text overlay using the right font to make sure that the text overlay will have the same size as the rasterized version. But after debugging pdf.js generated text overlay, it seems that pdf.js simply uses sans series font everywhere and doesn't respect the font weight either? I wonder what properties really matters for the text overlay to match the underneath textobject's dimension?
it seems that you simply force the outside boundary of each text object to be accurate? could you please confirm if my understanding is correct?
Beta Was this translation helpful? Give feedback.
All reactions