pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1741858 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Date Sun, 01 May 2016 11:13:52 GMT
Author: msahyoun
Date: Sun May  1 11:13:52 2016
New Revision: 1741858

URL: http://svn.apache.org/viewvc?rev=1741858&view=rev
Log:
PDFBOX-3333: keep existing transformation matrix

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java?rev=1741858&r1=1741857&r2=1741858&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Sun May  1 11:13:52 2016
@@ -36,6 +36,7 @@ import org.apache.pdfbox.pdmodel.interac
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceEntry;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceStream;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDBorderStyleDictionary;
+import org.apache.pdfbox.util.Matrix;
 
 /**
  * Create the AcroForms field appearance helper.
@@ -262,7 +263,13 @@ class AppearanceGeneratorHelper
         PDPageContentStream contents = new PDPageContentStream(field.getAcroForm().getDocument(),
                                                                appearanceStream, output);
         
-        appearanceStream.setMatrix(new AffineTransform());
+        // Set an identity transformation in case there is no Matrix entry
+        Matrix matrix = appearanceStream.getMatrix();
+        if (matrix == null)
+        {
+            appearanceStream.setMatrix(new AffineTransform());
+        }
+
         appearanceStream.setFormType(1);
         
         // Acrobat calculates the left and right padding dependent on the offset of the border
edge



Mime
View raw message