com.lowagie.text.pdf.internal
Class PdfVersionImp

java.lang.Object
  extended bycom.lowagie.text.pdf.internal.PdfVersionImp
All Implemented Interfaces:
PdfVersion

public class PdfVersionImp
extends Object
implements PdfVersion

Stores the PDF version information, knows how to write a PDF Header, and how to add the version to the catalog (if necessary).


Field Summary
static byte[][] HEADER
          Contains different strings that are part of the header.
 
Constructor Summary
PdfVersionImp()
           
 
Method Summary
 void addToCatalog(PdfDictionary catalog)
          Adds the version to the Catalog dictionary.
 byte[] getVersionAsByteArray(char version)
          Returns the version as a byte[].
 PdfName getVersionAsName(char version)
          Returns the PDF version as a name.
 void setAppendmode(boolean appendmode)
          Sets the append mode.
 void setAtLeastPdfVersion(char version)
          If the PDF Header hasn't been written yet, this changes the version as it will appear in the PDF Header, but only if the parameter refers to a higher version.
 void setPdfVersion(char version)
          If the PDF Header hasn't been written yet, this changes the version as it will appear in the PDF Header.
 void setPdfVersion(PdfName version)
          Sets the PDF version as it will appear in the Catalog.
 void writeHeader(OutputStreamCounter os)
          Writes the header to the OutputStreamCounter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER

public static final byte[][] HEADER
Contains different strings that are part of the header.

Constructor Detail

PdfVersionImp

public PdfVersionImp()
Method Detail

setPdfVersion

public void setPdfVersion(char version)
Description copied from interface: PdfVersion
If the PDF Header hasn't been written yet, this changes the version as it will appear in the PDF Header. If the PDF header was already written to the OutputStream, this changes the version as it will appear in the Catalog.

Specified by:
setPdfVersion in interface PdfVersion
Parameters:
version - a character representing the PDF version
See Also:
PdfVersion.setPdfVersion(char)

setAtLeastPdfVersion

public void setAtLeastPdfVersion(char version)
Description copied from interface: PdfVersion
If the PDF Header hasn't been written yet, this changes the version as it will appear in the PDF Header, but only if the parameter refers to a higher version. If the PDF header was already written to the OutputStream, this changes the version as it will appear in the Catalog.

Specified by:
setAtLeastPdfVersion in interface PdfVersion
Parameters:
version - a character representing the PDF version
See Also:
PdfVersion.setAtLeastPdfVersion(char)

setPdfVersion

public void setPdfVersion(PdfName version)
Description copied from interface: PdfVersion
Sets the PDF version as it will appear in the Catalog. Note that this only has effect if you use a later version than the one that appears in the header; this method ignores the parameter if you try to set a lower version.

Specified by:
setPdfVersion in interface PdfVersion
Parameters:
version - the PDF name that will be used for the Version key in the catalog
See Also:
PdfVersion.setPdfVersion(com.lowagie.text.pdf.PdfName)

setAppendmode

public void setAppendmode(boolean appendmode)
Sets the append mode.


writeHeader

public void writeHeader(OutputStreamCounter os)
                 throws IOException
Writes the header to the OutputStreamCounter.

Throws:
IOException

getVersionAsName

public PdfName getVersionAsName(char version)
Returns the PDF version as a name.

Parameters:
version - the version character.

getVersionAsByteArray

public byte[] getVersionAsByteArray(char version)
Returns the version as a byte[].

Parameters:
version - the version character

addToCatalog

public void addToCatalog(PdfDictionary catalog)
Adds the version to the Catalog dictionary.



Copyright © 2011 EGIZ - E-Government Innovation Center. All Rights Reserved.