[ https://issues.apache.org/jira/browse/PDFBOX-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14375894#comment-14375894 ]
Petr Slaby commented on PDFBOX-2692: ------------------------------------ +1 In our application, we use PDFBox to render PDFs to AFP, PCL and PostScript. When rendering text, the target format renderer needs to know the text and its font to be able to use text operations and fonts in the respective target format language (there is a configurable font mapping to use pre-prepared fonts or a possibility to generate fonts on the fly). In our clone of PDFBox 1.8.x, we did that by getting the font information from GlyphVector in g2d.drawGlyphVector(). In PDFBox 2.0, text is rendered as Shapes, so the underlying G2D implementation has not even a chance to know that a text is being rendered. With the possibility to override PageDrawer, I could intercept showFontGlyph to tell the G2D implementation that the next fill() or draw() is in fact drawing a letter in a given font. > Possibility to use our own and/or overwrite PageDrawer class > ------------------------------------------------------------ > > Key: PDFBOX-2692 > URL: https://issues.apache.org/jira/browse/PDFBOX-2692 > Project: PDFBox > Issue Type: Wish > Components: Rendering > Affects Versions: 2.0.0 > Environment: JDK 1.8, Windows 7, PDF-Box - current trunk > Reporter: Manfred Pock > Assignee: Andreas Lehmkühler > Labels: features > Fix For: 2.0.0 > > Attachments: pdfexample.jpg > > > We use PDFBox to render PDF's. Additionally, we have the posibility to add > different kinds of annotation (stamp, marks, free text, notes..) like in a > wysiwyg-editor. To do this, it is necessary that we paint these annotations > on our own. > Another reason is not to paint all parts: for example we have a pdf with an > embedded picture. Behind the picture we have the OCR-text to this picture. > This text is only needed for searching und should not be painted. > Thus it would be useful to use our own derived PageDrawer. As I see there are > some things to change. > a.) remove the final from PagerDrawer-class. > b.) make some global-variables (graphics, xform, pageSize...) protected, > c.) also some methods like setRenderingHints should be protected > d.) maybe the possibility to say to the PDFRender which PageDrawer should be > used. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org