how to calculate the extract font size?

296 views
Skip to first unread message

jank...@sina.com

unread,
Aug 31, 2020, 12:24:13 AM8/31/20
to pdfium
 I have using the following method to change the pdf object render  information
firstly, I initalized a rect with FX_RECT rect(0,0,913,1292),
and using the method  GetDisplayMatrix(rect, 0)  of CPDF_Page to chang the page size;

then using the following code to get the font size,
 float fontsize = textObject->m_TextState.GetFontSize();  
here, the textObject was the pointer of CPDF_TextObject,
while the font size I got seems was not suitable for text render.

Lei Zhang

unread,
Sep 3, 2020, 1:22:28 AM9/3/20
to jank...@sina.com, pdfium
What does "not suitable" mean exactly? Taking a wild guess, is the
font size being reported as 1 when you are expecting something more
like 12, based on what you see in the PDF rendering?
> --
> You received this message because you are subscribed to the Google Groups "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/4c59d1fd-5615-489e-a564-3dcff17d10c1n%40googlegroups.com.

jank...@sina.com

unread,
Nov 6, 2020, 11:46:05 PM11/6/20
to pdfium
according the matrix to calculate the font size for display the text, I found the pdf.js can calculate the font size  with textRise and the font Hscale.
Reply all
Reply to author
Forward
0 new messages