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
- is related to
-
PDFBOX-1940 Faulty pdf->image rendering
- Closed
-
PDFBOX-4543 PDLineDashPattern fails as float[] is converted to List<float[]> instead of List<Float>
- Closed
- relates to
-
PDFBOX-1917 Rendering hangs
- Closed