[
https://issues.apache.org/jira/browse/PDFBOX-2081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13999992#comment-13999992
]
Tilman Hausherr commented on PDFBOX-2081:
-----------------------------------------
Getting better output by setting no clipping region (which is what you do) is
too good to be true, although I was able to get improved rendering for two test
files, the ones from PDFBOX-677 and PDFBOX-1288. On the other hand, the tiger
test file now doesn't clip something (the chin) where it should have been
clipped.
A look at the spec found this weird part:
{quote}
The initial clipping path includes the entire page. A clipping path operator (W
or W*, shown in Table 4.11) may appear after the last path construction
operator and before the path-painting operator that terminates a path object.
Although the clipping path operator appears before the painting operator, it
does not alter the clipping path at the point where it appears. Rather, it
modifies the effect of the succeeding painting operator. After the path has
been painted, the clipping path in the graphics state is set to the
intersection of the current clipping path and the newly constructed path.
{quote}
A look at the code shows that the clipping path is set in EndPath(), and this
is called by the "n" operator. My understanding of the weird spec text is that
the clipping path must be set after a paint operator, so it should also be set
after any of the fill and stroke operators.
I don't know if that is the cause of the problem, more analysis of PDFs needs
to be done.
> Lines that exceeds clipping area are not drawn
> ----------------------------------------------
>
> Key: PDFBOX-2081
> URL: https://issues.apache.org/jira/browse/PDFBOX-2081
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 2.0.0
> Reporter: Juraj Lonc
> Attachments: Obyčajné zásielky.pdf, rendered.png
>
>
> PDF contains shapes that are partly on the paper and partly outside (shape
> overflows paper borders).
> Those shapes are not rendered to image.
> It is caused by clipping area.
> When I replace line in PDFDrawer.strokePath()
> {noformat}
> graphics.setClip(getGraphicsState().getCurrentClippingPath());
> {noformat}
> to
> {noformat}
> graphics.setClip(null);
> {noformat}
> then everything is rendered correctly.
> Possibly bug in Java?
--
This message was sent by Atlassian JIRA
(v6.2#6252)