You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2020/12/17 09:58:24 UTC

svn commit: r1884546 - /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java

Author: tilman
Date: Thu Dec 17 09:58:24 2020
New Revision: 1884546

URL: http://svn.apache.org/viewvc?rev=1884546&view=rev
Log:
PDFBOX-4892: add comment related to post from Anze Germovsek

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java?rev=1884546&r1=1884545&r2=1884546&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java (original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java Thu Dec 17 09:58:24 2020
@@ -112,8 +112,10 @@ public final class AddAnnotations
             // Now add the markup annotation, a highlight to PDFBox text
             PDAnnotationHighlight txtHighlight = new PDAnnotationHighlight();
             txtHighlight.setColor(new PDColor(new float[] { 0, 1, 1 }, PDDeviceRGB.INSTANCE));
-            // 20% transparent
-            txtHighlight.setConstantOpacity((float)0.2); 
+
+            // remove line below if PDF/A-2b (and possibly other PDF-A flavours)
+            // also add txtMark.setPrinted(true)
+            txtHighlight.setConstantOpacity((float) 0.2);
 
             // Set the rectangle containing the markup
             float textWidth = font.getStringWidth("PDFBox") / 1000 * 18;