pdf.js get info about embedded fonts

蹲街弑〆低调 提交于 2019-12-23 02:30:52

问题


I am using pdf.js. Fetching the Text I get blocks with font info

Object { 
     str: "blabla", 
     dir: "ltr", 
     width: 191.433141, 
     height: 12.546, 
     transform: Array[6], 
     fontName: "g_d0_f2" 
}

Is it possible to get somehow more information about g_d0_f2.


回答1:


Notice the PDF.js getTextContent will not and not suppose to match glyphs in PDFs. The PDF32000 specification has two different algorithms for text display and extraction. Even if you can lookup font data in the page.commonObjs, it might not be really helpful for extracted text content display due to glyphs encoding mismatch.

The page's getTextContent is doing text extraction and getOperatorList gets (glyph) display operators. See how src/display/svg.js renderer displays glyphs.



来源:https://stackoverflow.com/questions/40656289/pdf-js-get-info-about-embedded-fonts

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!