Q: We are using PDFTron to pull the low-level graphics information out
using the PDFTron API and place them into our scene as native
My question has to do with text, specifically, but can be applied to
other complex graphics. Does PDFTron provide any mechanism for
rasterizing specific entities? We cannot process some of the PDF font
formats and would have to do font matching in order to get 'close
enough'. If PDFTron provided a way to give us an image for these
entities we cannot render, that would solve a lot of problems.
A: There is no function to rasterize individual elements on the page,
however you could use font.GetGlyphPath() to extract the embedded font
outline for each character. You can use the resulting path as a vector
graphics object or you could render it to a bitmap.
Another possibility is to copy an element to a temporary page (which
is not added to a document) and using PDFDraw to render the bitmap.
This is probably suboptimal solution compared to the above solution.