[
https://issues.apache.org/jira/browse/PDFBOX-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12864807#action_12864807
]
Maruan Sahyoun commented on PDFBOX-678:
---------------------------------------
Thanks for the additional hints and your support on that matter. The difficulty
with the clipping lies in the fact the currently PageDrawer e.g. in fillPath()
and strokePath() sets the clipping path with setClip() which ignores the
already existing path settings. In addition to that the linePath is reset. So -
as a hack - I changed the implementation to use clip instead of setClip which
now works with the sample files I have.
I have to implement some missing transformations (from
PDSimpleFont.writeFont()) and will then give it a try with some more files and
as well implement a fall back for fonts without getawtFont().
Caveats of the implementation so far (maybe I can overcome these)
a) I'm not rendering 'hidden' text at all as the quality of the output is
reduced - not sure why that happens as with a small test app that doesn't happen
b) For outline only text no selectable text is rendered as this is related to
a)
c) Stroke text and clipping currently don't work well together as either the
stroke is clipped i.e. not visible or the line is to thick i.e. fills the whole
text when using .getStroke()
I'll add a sample output of the current state of implementation based on
text_operators.pdf mentioned above.
> Support missing Text Rendering Modes when rendering a PDF
> ---------------------------------------------------------
>
> Key: PDFBOX-678
> URL: https://issues.apache.org/jira/browse/PDFBOX-678
> Project: PDFBox
> Issue Type: Improvement
> Components: PDFReader
> Reporter: Maruan Sahyoun
> Attachments: Java Printing.pdf
>
>
> Of the 7 different Text Rendering Modes only mode 0 (Fill Text) is correctly
> implemented. Mode 1 (Stroke Text) falls back to Mode 0 and the others are not
> implemented. I'm looking to implement the missing modes (at least some of
> them).
> Before doing so I'm proposing a structural change to when rendering really
> occurs. Currently it's done within the PDxxxFont classes. I'd rather
> implement the (AWT) text output in PageDrawer (or helper classes within the
> same package) and use the font classes to return an AWT font by adding a
> getAwtFont method. Doing so we get a better separation between the PDF
> related stuff (PDxxx) and applications like PageDrawer. The current rendering
> specific code within the PDxxxFont classes can be retained for compatibility
> and marked deprecated at a later stage.
> WDYT?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.