|
104 | 104 | import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; |
105 | 105 | import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationUnknown; |
106 | 106 | import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary; |
| 107 | +import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceEntry; |
107 | 108 | import org.apache.pdfbox.util.Matrix; |
108 | 109 | import org.apache.pdfbox.util.Vector; |
109 | 110 |
|
@@ -1559,14 +1560,17 @@ public void showAnnotation(PDAnnotation annotation) throws IOException |
1559 | 1560 | if (annotation.isNoRotate() && getCurrentPage().getRotation() != 0) |
1560 | 1561 | { |
1561 | 1562 | appearance = annotation.getAppearance(); |
1562 | | - if (appearance != null && appearance.getNormalAppearance() != null && |
1563 | | - appearance.getNormalAppearance().isStream() && |
1564 | | - hasTransparency(appearance.getNormalAppearance().getAppearanceStream())) |
| 1563 | + if (appearance != null) |
1565 | 1564 | { |
1566 | | - // PDFBOX-4744: avoid appearances with transparency groups until we have fixed |
1567 | | - // the rendering. A real solution should probably be |
1568 | | - // in PDFStreamEngine.processAnnotation(). |
1569 | | - annotation.constructAppearances(); |
| 1565 | + PDAppearanceEntry appearanceEntry = appearance.getNormalAppearance(); |
| 1566 | + if (appearanceEntry != null && appearanceEntry.isStream() && |
| 1567 | + hasTransparency(appearanceEntry.getAppearanceStream())) |
| 1568 | + { |
| 1569 | + // PDFBOX-4744: avoid appearances with transparency groups until we have fixed |
| 1570 | + // the rendering. A real solution should probably be |
| 1571 | + // in PDFStreamEngine.processAnnotation(). |
| 1572 | + annotation.constructAppearances(); |
| 1573 | + } |
1570 | 1574 | } |
1571 | 1575 | PDRectangle rect = annotation.getRectangle(); |
1572 | 1576 | AffineTransform savedTransform = graphics.getTransform(); |
|
0 commit comments