[ 
https://issues.apache.org/jira/browse/PDFBOX-1290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Schrodt updated PDFBOX-1290:
-----------------------------------

    Description: 
When displaying or printing a PDF that uses the CloseFillNonZeroAndStrokePath 
OperatorProcessor, the stroke is not done.

This is because the FillNonZeroRule which is executed before the stroke calls 
PageDrawer.fillPath(), which does a reset of the path via getLinePath().reset().
After the reset, the path is empty, so the stroke operation just does nothing.

I helped myself by changing CloseFillNonZeroAndStrokePath.java like this:

public void process(PDFOperator operator, List<COSBase> arguments) throws 
IOException {
    context.processOperator( "h", arguments );
    // clone the path
    PageDrawer pd = (PageDrawer) context;
    GeneralPath p = (GeneralPath)pd.getLinePath().clone();
    context.processOperator( "f", arguments );
    // and restore before calling stroke
    pd.setLinePath(p);
    context.processOperator( "S", arguments );
}

This seems like a hack, so you guys probably know a cleaner way to fix this.



  was:
When displaying or printing a PDF that uses the CloseFillNonZeroAndStrokePath 
OperatorProcessor, the stroke is not done.

This is because the FillNonZeroRule which is executed before that calls 
PageDrawer.fillPath(), which does a reset of the path. via 
getLinePath().reset().
After the reset, the path is empty, so the stroke operation just does nothing.

I helped myself by changing CloseFillNonZeroAndStrokePath.java like this:

public void process(PDFOperator operator, List<COSBase> arguments) throws 
IOException {
    context.processOperator( "h", arguments );
    // clone the path
    PageDrawer pd = (PageDrawer) context;
    GeneralPath p = (GeneralPath)pd.getLinePath().clone();
    context.processOperator( "f", arguments );
    // and restore before calling stroke
    pd.setLinePath(p);
    context.processOperator( "S", arguments );
}

This seems like a hack, so you guys probably know a cleaner way to fix this.





    
> CloseFillNonZeroAndStrokePath operator fails to do the stroke.
> --------------------------------------------------------------
>
>                 Key: PDFBOX-1290
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1290
>             Project: PDFBox
>          Issue Type: Bug
>         Environment: should make no difference
> Version of PDFBox is 1.6.0
>            Reporter: Martin Schrodt
>            Priority: Minor
>
> When displaying or printing a PDF that uses the CloseFillNonZeroAndStrokePath 
> OperatorProcessor, the stroke is not done.
> This is because the FillNonZeroRule which is executed before the stroke calls 
> PageDrawer.fillPath(), which does a reset of the path via 
> getLinePath().reset().
> After the reset, the path is empty, so the stroke operation just does nothing.
> I helped myself by changing CloseFillNonZeroAndStrokePath.java like this:
> public void process(PDFOperator operator, List<COSBase> arguments) throws 
> IOException {
>     context.processOperator( "h", arguments );
>     // clone the path
>     PageDrawer pd = (PageDrawer) context;
>     GeneralPath p = (GeneralPath)pd.getLinePath().clone();
>     context.processOperator( "f", arguments );
>     // and restore before calling stroke
>     pd.setLinePath(p);
>     context.processOperator( "S", arguments );
> }
> This seems like a hack, so you guys probably know a cleaner way to fix this.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to