aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/lowagie/text/rtf/field/RtfPageNumber.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/field/RtfPageNumber.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/field/RtfPageNumber.java')
-rw-r--r--src/main/java/com/lowagie/text/rtf/field/RtfPageNumber.java83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/main/java/com/lowagie/text/rtf/field/RtfPageNumber.java b/src/main/java/com/lowagie/text/rtf/field/RtfPageNumber.java
new file mode 100644
index 0000000..3b69295
--- /dev/null
+++ b/src/main/java/com/lowagie/text/rtf/field/RtfPageNumber.java
@@ -0,0 +1,83 @@
+/*
+ * Created on Aug 10, 2004
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+package com.lowagie.text.rtf.field;
+
+import java.io.IOException;
+
+import com.lowagie.text.Font;
+import com.lowagie.text.rtf.document.RtfDocument;
+
+
+/**
+ * The RtfPageNumber provides the page number field in rtf documents.
+ *
+ * @version $Revision: 1.7 $
+ * @author Mark Hall (mhall@edu.uni-klu.ac.at)
+ * @author <a href="mailto:Steffen.Stundzig@smb-tec.com">Steffen.Stundzig@smb-tec.com</a>
+ */
+public class RtfPageNumber extends RtfField {
+
+ /**
+ * Constant for the page number
+ */
+ private static final byte[] PAGE_NUMBER = "PAGE".getBytes();
+
+ /**
+ * Constructs a RtfPageNumber. This can be added anywhere to add a page number field.
+ */
+ public RtfPageNumber() {
+ super(null);
+ }
+
+ /**
+ * Constructs a RtfPageNumber with a specified Font. This can be added anywhere to
+ * add a page number field.
+ * @param font
+ */
+ public RtfPageNumber(Font font) {
+ super(null, font);
+ }
+
+ /**
+ * Constructs a RtfPageNumber object.
+ *
+ * @param doc The RtfDocument this RtfPageNumber belongs to
+ */
+ public RtfPageNumber(RtfDocument doc) {
+ super(doc);
+ }
+
+ /**
+ * Constructs a RtfPageNumber object with a specific font.
+ *
+ * @param doc The RtfDocument this RtfPageNumber belongs to
+ * @param font The Font to use
+ */
+ public RtfPageNumber(RtfDocument doc, Font font) {
+ super(doc, font);
+ }
+
+ /**
+ * Writes the field instruction content
+ *
+ * @return A byte array containing "PAGE"
+ * @throws IOException
+ */
+ protected byte[] writeFieldInstContent() throws IOException {
+ return PAGE_NUMBER;
+ }
+
+ /**
+ * Writes the field result content
+ *
+ * @return An empty byte array
+ * @throws IOException
+ */
+ protected byte[] writeFieldResultContent() throws IOException {
+ return new byte[0];
+ }
+}