aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/lowagie/text/rtf/text/RtfNewPage.java
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2006-12-01 12:20:24 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2006-12-01 12:20:24 +0000
commit6025b6016517c6d898d8957d1d7e03ba71431912 (patch)
treeb15bd6fa5ffe9588a9bca3f2b8a7e358f83b6eba /src/main/java/com/lowagie/text/rtf/text/RtfNewPage.java
parentd2c77e820ab4aba8235d71275755021347b3ad10 (diff)
downloadpdf-as-3-6025b6016517c6d898d8957d1d7e03ba71431912.tar.gz
pdf-as-3-6025b6016517c6d898d8957d1d7e03ba71431912.tar.bz2
pdf-as-3-6025b6016517c6d898d8957d1d7e03ba71431912.zip
Initial import of release 2.2.REL-2.2@923
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@4 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/com/lowagie/text/rtf/text/RtfNewPage.java')
-rw-r--r--src/main/java/com/lowagie/text/rtf/text/RtfNewPage.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/main/java/com/lowagie/text/rtf/text/RtfNewPage.java b/src/main/java/com/lowagie/text/rtf/text/RtfNewPage.java
new file mode 100644
index 0000000..3bb7a88
--- /dev/null
+++ b/src/main/java/com/lowagie/text/rtf/text/RtfNewPage.java
@@ -0,0 +1,53 @@
+/*
+ * Created on Aug 12, 2004
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+package com.lowagie.text.rtf.text;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import com.lowagie.text.rtf.RtfElement;
+import com.lowagie.text.rtf.document.RtfDocument;
+
+
+/**
+ * The RtfNewPage creates a new page. INTERNAL CLASS
+ *
+ * @version $Version:$
+ * @author Mark Hall (mhall@edu.uni-klu.ac.at)
+ */
+public class RtfNewPage extends RtfElement {
+
+ /**
+ * Constant for a new page
+ */
+ private static final byte[] NEW_PAGE = "\\page".getBytes();
+
+ /**
+ * Constructs a RtfNewPage
+ *
+ * @param doc The RtfDocument this RtfNewPage belongs to
+ */
+ public RtfNewPage(RtfDocument doc) {
+ super(doc);
+ }
+
+ /**
+ * Writes a new page
+ *
+ * @return A byte array with the new page set
+ */
+ public byte[] write() {
+ ByteArrayOutputStream result = new ByteArrayOutputStream();
+ try {
+ result.write(NEW_PAGE);
+ result.write(RtfParagraph.PARAGRAPH_DEFAULTS);
+ } catch(IOException ioe) {
+ ioe.printStackTrace();
+ }
+ return result.toByteArray();
+ }
+}