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 2019/07/14 07:02:36 UTC
svn commit: r1863029 -
/pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
Author: tilman
Date: Sun Jul 14 07:02:35 2019
New Revision: 1863029
URL: http://svn.apache.org/viewvc?rev=1863029&view=rev
Log:
PDFBOX-4596: store rotation in LayoutPage class
Modified:
pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
Modified: pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java?rev=1863029&r1=1863028&r2=1863029&view=diff
==============================================================================
--- pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java (original)
+++ pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java Sun Jul 14 07:02:35 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");