diff options
author | Jeremias Maerki <jeremias@apache.org> | 2011-10-24 12:44:11 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2011-10-24 12:44:11 +0000 |
commit | 54a4751b616ab4e8957b97af4088bd725367ea6f (patch) | |
tree | 56289b094baf9f253c927d7a3a570e7b061dfc85 /src | |
parent | ae7c3b4bd8c7e1eca36dd5963d2b28dfad43bda2 (diff) | |
download | xmlgraphics-fop-54a4751b616ab4e8957b97af4088bd725367ea6f.tar.gz xmlgraphics-fop-54a4751b616ab4e8957b97af4088bd725367ea6f.zip |
Allow to switch to a different page size in mid-document.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1188123 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java index f8f14cca2..7ec9d7f2b 100644 --- a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java @@ -113,8 +113,8 @@ public class PDFDocumentGraphics2D extends PDFGraphics2D { * @param textAsShapes set this to true so that text will be rendered * using curves and not the font. * @param stream the stream that the final document should be written to. - * @param width the width of the document - * @param height the height of the document + * @param width the width of the document (in points) + * @param height the height of the document (in points) * @throws IOException an io exception if there is a problem * writing to the output stream */ @@ -253,6 +253,19 @@ public class PDFDocumentGraphics2D extends PDFGraphics2D { } /** + * Is called to prepare the PDFDocumentGraphics2D for the next page to be painted. Basically, + * this closes the current page. A new page is prepared as soon as painting starts. + * This method allows to start the new page (and following pages) with a different page size. + * @param width the width of the new page (in points) + * @param height the height of the new page (in points) + */ + public void nextPage(int width, int height) { + this.width = width; + this.height = height; + nextPage(); + } + + /** * Closes the current page and adds it to the PDF file. */ protected void closePage() { |