public class PdfVersionImp extends Object implements PdfVersion
Modifier and Type | Field and Description |
---|---|
protected boolean |
appendmode
Indicates if we are working in append mode.
|
protected PdfName |
catalog_version
The version that will be written to the catalog.
|
protected PdfDictionary |
extensions
The extensions dictionary.
|
static byte[][] |
HEADER
Contains different strings that are part of the header.
|
protected char |
header_version
The version that was or will be written to the header.
|
protected boolean |
headerWasWritten
Indicates if the header was already written.
|
protected char |
version
The version that user can use to get the actual version of PDF document
|
Constructor and Description |
---|
PdfVersionImp() |
Modifier and Type | Method and Description |
---|---|
void |
addDeveloperExtension(PdfDeveloperExtension de)
Adds a developer extension to the Extensions dictionary in the Catalog.
|
void |
addToCatalog(PdfDictionary catalog)
Adds the version to the Catalog dictionary.
|
char |
getVersion() |
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.
|
public static final byte[][] HEADER
protected boolean headerWasWritten
protected boolean appendmode
protected char header_version
protected PdfName catalog_version
protected char version
protected PdfDictionary extensions
public void setPdfVersion(char version)
PdfVersion
setPdfVersion
in interface PdfVersion
version
- a character representing the PDF version
PdfVersion.setPdfVersion(char)
public void setAtLeastPdfVersion(char version)
PdfVersion
setAtLeastPdfVersion
in interface PdfVersion
version
- a character representing the PDF version
PdfVersion.setAtLeastPdfVersion(char)
public void setPdfVersion(PdfName version)
PdfVersion
setPdfVersion
in interface PdfVersion
version
- the PDF name that will be used for the Version key in the catalog
PdfVersion.setPdfVersion(com.itextpdf.text.pdf.PdfName)
public void setAppendmode(boolean appendmode)
public void writeHeader(OutputStreamCounter os) throws IOException
IOException
public PdfName getVersionAsName(char version)
version
- the version character.
public byte[] getVersionAsByteArray(char version)
version
- the version character
public void addToCatalog(PdfDictionary catalog)
public void addDeveloperExtension(PdfDeveloperExtension de)
PdfVersion
addDeveloperExtension
in interface PdfVersion
de
- an object that contains the extensions prefix and dictionary
PdfVersion.addDeveloperExtension(com.itextpdf.text.pdf.PdfDeveloperExtension)
public char getVersion()
Copyright © 2016. All rights reserved.