[ 
https://issues.apache.org/jira/browse/PDFBOX-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13444203#comment-13444203
 ] 

Juraj Lonc commented on PDFBOX-1400:
------------------------------------

I found the root of this problem.

The original content stream of PDPage contains more "q" commands than "Q" 
commands.
So the stream that is appended to this page starts with modified transformation 
matrix (= polygons are actually drawn out of page boundaries).

I think the only way how to fix this is to modify parser which will count "q" 
and "Q" commands. In case there is less "Q" than "q" commands, than those 
missing "Q" commands should be inserted to the beginning of stream that is 
appended to page. 
                
> Polygon objects added to existing page are not shown in Adobe Reader
> --------------------------------------------------------------------
>
>                 Key: PDFBOX-1400
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1400
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.7.1
>            Reporter: Juraj Lonc
>         Attachments: input.pdf, output.pdf
>
>
> I have PDF file which I tried to draw some polygons to.
> content.setLineWidth(0.3f);
> content.setStrokingColor(Color.RED);
> content.drawPolygon(new float[] {x1, x2, x2, x1}, new float[] {y2, y2, y1, 
> y1});
> I have tested several PDF files. Those polygons are properly shown in Adobe 
> Reader for most of PDF files.
> But there are some PDF files which ignores this and Adobe Reader won't show 
> any polygons that were drawn.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to