pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1863031 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
Date Sun, 14 Jul 2019 07:02:44 GMT
Author: tilman
Date: Sun Jul 14 07:02:44 2019
New Revision: 1863031

URL: http://svn.apache.org/viewvc?rev=1863031&view=rev
Log:
PDFBOX-4596: store rotation in LayoutPage class

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java?rev=1863031&r1=1863030&r2=1863031&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java Sun Jul 14 07:02:44
2019
@@ -272,12 +272,14 @@ public class Overlay implements Closeabl
         private final PDRectangle overlayMediaBox;
         private final COSStream overlayContentStream;
         private final COSDictionary overlayResources;
+        private final int overlayRotation;
 
-        private LayoutPage(PDRectangle mediaBox, COSStream contentStream, COSDictionary resources)
+        private LayoutPage(PDRectangle mediaBox, COSStream contentStream, COSDictionary resources,
int rotation)
         {
             overlayMediaBox = mediaBox;
             overlayContentStream = contentStream;
             overlayResources = resources;
+            overlayRotation = rotation;
         }
     }
 
@@ -291,7 +293,7 @@ public class Overlay implements Closeabl
             resources = new PDResources();
         }
         return new LayoutPage(page.getMediaBox(), createCombinedContentStream(contents),
-                resources.getCOSObject());
+                resources.getCOSObject(), page.getRotation());
     }
     
     private Map<Integer,LayoutPage> getLayoutPages(PDDocument doc) throws IOException
@@ -308,7 +310,7 @@ public class Overlay implements Closeabl
                 resources = new PDResources();
             }
             layoutPages.put(i, new LayoutPage(page.getMediaBox(), createCombinedContentStream(contents),

-                    resources.getCOSObject()));
+                    resources.getCOSObject(), page.getRotation()));
         }
         return layoutPages;
     }
@@ -475,7 +477,7 @@ public class Overlay implements Closeabl
         PDFormXObject xobjForm = new PDFormXObject(contentStream);
         xobjForm.setResources(new PDResources(layoutPage.overlayResources));
         xobjForm.setFormType(1);
-        xobjForm.setBBox( layoutPage.overlayMediaBox.createRetranslatedRectangle());
+        xobjForm.setBBox(layoutPage.overlayMediaBox.createRetranslatedRectangle());
         xobjForm.setMatrix(new AffineTransform());
         PDResources resources = page.getResources();
         return resources.add(xobjForm, "OL");



Mime
View raw message