All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lowagie.text.rtf.field.RtfPageNumber Maven / Gradle / Ivy

/*
 * 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 $Version:$
 * @author Mark Hall ([email protected])
 * @author [email protected]
 */
public class RtfPageNumber extends RtfField {

    /**
     * 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".getBytes();
    }

    /**
     * Writes the field result content
     * 
     * @return An empty byte array
     * @throws IOException
     */
    protected byte[] writeFieldResultContent() throws IOException {
        return new byte[0];
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy