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

Store all stroke information in the graphics state

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • Rendering
    • None

    Description

      Recently PDFBOX-1917 has fixed an issue with how the current AWT stroke is calculated. This prompted me to look at the file from PDFBOX-1094 which contains separate stroking errors. This led to the identification of a problem: the BasicStroke is being used to keep track of the stroke state, rather than using the information from the graphics state. This fails when the graphics state is modified e.g. Save/Restore and the BasicStroke in PageDrawer is not correspondingly updated.

      Having looked at the code, it seems that this is a long-standing issue. The solution is to remove the BasicStroke variable from PageDrawer and to calculate it each time it is needed, using only the information stored in the graphics state. The following classes which directly modify the BasicStroke can be removed:

      pagedrawer.SetLineCapStyle
      pagedrawer.SetLineDashPattern
      pagedrawer.SetLineJoinStyle
      pagedrawer.SetLineMiterLimit
      pagedrawer.SetLineWidth

      Attachments

        Issue Links

          Activity

            People

              jahewson John Hewson
              jahewson John Hewson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: