Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1290

CloseFillNonZeroAndStrokePath operator fails to do the stroke.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.6.0
    • 1.7.0
    • Swing GUI
    • None
    • should make no difference
      Version of PDFBox is 1.6.0

    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.

      Attachments

        Activity

          People

            lehmi Andreas Lehmkühler
            spheenik Martin Schrodt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: