pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1861486 - /pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java
Date Mon, 17 Jun 2019 05:39:23 GMT
Author: msahyoun
Date: Mon Jun 17 05:39:22 2019
New Revision: 1861486

URL: http://svn.apache.org/viewvc?rev=1861486&view=rev
Log:
PDFBOX-4575: add appearance generation to AddAnnotations example

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

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java?rev=1861486&r1=1861485&r2=1861486&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java
(original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java
Mon Jun 17 05:39:22 2019
@@ -300,6 +300,14 @@ public final class AddAnnotations
             polygon.setContents("Polygon annotation");
             annotations.add(polygon);
 
+            // Create the appearance streams.
+            // Adobe Reader will always display annotations without appearance streams nicely,
+            // but other applications may not.
+            for (PDAnnotation ann : annotations)
+            {
+                ann.constructAppearances();
+            }
+
             showPageNo(document, page1, "Page 1");
             showPageNo(document, page2, "Page 2");
             showPageNo(document, page3, "Page 3");



Mime
View raw message