| java.lang.Object com.lowagie.text.DocWriter com.lowagie.text.pdf.PdfWriter
All known Subclasses: com.lowagie.text.pdf.PdfCopyFieldsImp, com.lowagie.text.pdf.PdfStamperImp, com.lowagie.text.pdf.PdfCopy,
Inner Class :public static class PdfBody | |
Method Summary | |
PdfIndirectReference | add(PdfPage page, PdfContents contents) Adds some PdfContents to this Writer. | PdfIndirectReference | add(PdfImage pdfImage, PdfIndirectReference fixedRef) Writes a PdfImage to the outputstream. | protected PdfIndirectReference | add(PdfICCBased icc) | public void | addAnnotation(PdfAnnotation annot) | void | addAnnotation(PdfAnnotation annot, int page) | public void | addCalculationOrder(PdfFormField annot) | public PdfName | addDirectImageSimple(Image image) Use this method to adds an image to the document
but not to the page resources. | public PdfName | addDirectImageSimple(Image image, PdfIndirectReference fixedRef) Adds an image to the document but not to the page resources.
It is used with templates and Document.add(Image) .
Use this method only if you know what you're doing!
Parameters: image - the Image to add Parameters: fixedRef - the reference to used. | PdfName | addDirectTemplateSimple(PdfTemplate template, PdfName forcedName) Adds a template to the document but not to the page resources.
Parameters: template - the template to add Parameters: forcedName - the template name, rather than a generated one. | public void | addFileAttachment(String description, byte fileStore, String file, String fileDisplay) Use this method to add a file attachment at the document level.
Parameters: description - the file description Parameters: fileStore - an array with the file. | public void | addFileAttachment(String description, PdfFileSpecification fs) Use this method to add a file attachment at the document level. | public void | addFileAttachment(PdfFileSpecification fs) Use this method to add a file attachment at the document level. | public void | addJavaScript(PdfAction js) Use this method to add a JavaScript action at the document level. | public void | addJavaScript(String code, boolean unicode) Use this method to add a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
Parameters: code - the JavaScript code Parameters: unicode - select JavaScript unicode. | public void | addJavaScript(String code) Use this method to adds a JavaScript action at the document level. | public void | addJavaScript(String name, PdfAction js) Use this method to add a JavaScript action at the document level. | public void | addJavaScript(String name, String code, boolean unicode) Use this method to add a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
Parameters: name - The name of the JS Action in the name tree Parameters: code - the JavaScript code Parameters: unicode - select JavaScript unicode. | public void | addJavaScript(String name, String code) Use this method to adds a JavaScript action at the document level. | void | addLocalDestinations(TreeMap dest) Adds the local destinations to the body of the document. | public void | addOCGRadioGroup(ArrayList group) Use this method to set a collection of optional content groups
whose states are intended to follow a "radio button" paradigm. | protected void | addSharedObjectsToBody() | FontDetails | addSimple(BaseFont bf) Adds a BaseFont to the document but not to the page resources. | ColorDetails | addSimple(PdfSpotColor spc) Adds a SpotColor to the document but not to the page resources. | PdfObject[] | addSimpleExtGState(PdfDictionary gstate) | PdfName | addSimplePattern(PdfPatternPainter painter) | ColorDetails | addSimplePatternColorspace(Color color) | PdfObject[] | addSimpleProperty(Object prop, PdfIndirectReference refi) | void | addSimpleShading(PdfShading shading) | void | addSimpleShadingPattern(PdfShadingPattern shading) | public PdfIndirectObject | addToBody(PdfObject object) Use this method to add a PDF object to the PDF body. | public PdfIndirectObject | addToBody(PdfObject object, boolean inObjStm) Use this method to add a PDF object to the PDF body. | public PdfIndirectObject | addToBody(PdfObject object, PdfIndirectReference ref) Use this method to add a PDF object to the PDF body. | public PdfIndirectObject | addToBody(PdfObject object, PdfIndirectReference ref, boolean inObjStm) Use this method to add a PDF object to the PDF body. | public PdfIndirectObject | addToBody(PdfObject object, int refNumber) Use this method to add a PDF object to the PDF body. | public PdfIndirectObject | addToBody(PdfObject object, int refNumber, boolean inObjStm) Use this method to add a PDF object to the PDF body. | public void | addViewerPreference(PdfName key, PdfObject value) | public boolean | breakTableIfDoesntFit(PdfTable table) Row additions to the original
Table used to build the
PdfTable are processed and pre-rendered,
and then the contents are deleted. | public void | clearTextWrap() Use this method to clear text wrapping around images (if applicable). | public void | close() Signals that the Document was closed and that no other
Elements will be added. | public void | createXmpMetadata() Use this method to creates XMP Metadata based
on the metadata in the PdfDocument. | void | eliminateFontSubset(PdfDictionary fonts) | public boolean | fitsPage(Table table, float margin) Checks if a Table fits the current page of the PdfDocument . | public boolean | fitsPage(Table table) Checks if a Table fits the current page of the PdfDocument . | public boolean | fitsPage(PdfPTable table, float margin) Checks if a PdfPTable fits the current page of the PdfDocument . | public boolean | fitsPage(PdfPTable table) Checks if a PdfPTable fits the current page of the PdfDocument . | public void | freeReader(PdfReader reader) Use this method to writes the reader to the document
and free the memory used by it. | public PdfAcroForm | getAcroForm() | public Rectangle | getBoxSize(String boxName) Use this method to get the size of a trim, art, crop or bleed box,
or null if not defined. | protected PdfDictionary | getCatalog(PdfIndirectReference rootObj) | PdfName | getColorspaceName() | public int | getCurrentDocumentSize() Use this method to gets the current document size. | PdfIndirectReference | getCurrentPage() | public int | getCurrentPageNumber() | public PdfDictionary | getDefaultColorspace() Use this method to get the default colorspaces. | public PdfContentByte | getDirectContent() Use this method to get the direct content for this document. | public PdfContentByte | getDirectContentUnder() Use this method to get the direct content under for this document. | PdfEncryption | getEncryption() | public PdfDictionary | getExtraCatalog() Sets extra keys to the catalog. | public PdfDictionary | getGroup() Use this method to get the group dictionary. | PdfIndirectReference | getImageReference(PdfName name) return the PdfIndirectReference to the image with a given name. | public PdfImportedPage | getImportedPage(PdfReader reader, int pageNumber) Use this method to get a page from other PDF document.
The page can be used as any other PdfTemplate.
Note that calling this method more than once with the same parameters
will retrieve the same object.
Parameters: reader - the PDF document where the page is Parameters: pageNumber - the page number. | int | getIndirectReferenceNumber() | public PdfDictionary | getInfo() Use this method to get the info dictionary if you want to
change it directly (add keys and values to the info dictionary). | public static PdfWriter | getInstance(Document document, OutputStream os) Use this method to get an instance of the PdfWriter . | public static PdfWriter | getInstance(Document document, OutputStream os, DocListener listener) Use this method to get an instance of the PdfWriter . | protected int | getNewObjectNumber(PdfReader reader, int number, int generation) | public PdfOCProperties | getOCProperties() Use this method to get the Optional Content Properties Dictionary. | OutputStreamCounter | getOs() Returns the outputStreamCounter. | public int | getPDFXConformance() | public PdfPageEvent | getPageEvent() Gets the PdfPageEvent for this document or null
if none is set. | public int | getPageNumber() Gets the pagenumber of this document. | public PdfIndirectReference | getPageReference(int page) Use this method to get a reference to a page existing or not.
If the page does not exist yet the reference will be created
in advance. | public Rectangle | getPageSize() Use this method to get the size of the media box. | PdfDocument | getPdfDocument() Gets the PdfDocument associated with this writer. | public PdfIndirectReference | getPdfIndirectReference() Use this to get an PdfIndirectReference for an object that
will be created in the future. | public PdfTable | getPdfTable(Table table) Gets a pre-rendered table.
(Contributed by dperezcar@fcc.es)
Parameters: table - Contains the table definition. | PdfVersionImp | getPdfVersion() Returns the version information. | RandomAccessFileOrArray | getReaderFile(PdfReader reader) | public PdfOutline | getRootOutline() Use this method to get the root outline
and construct bookmarks. | public int | getRunDirection() Use this method to set the run direction. | public float | getSpaceCharRatio() Use this method to gets the space/character extra spacing ratio
for fully justified text. | public PdfStructureTreeRoot | getStructureTreeRoot() Gets the structure tree root. | public float | getTableBottom(Table table) Sometimes it is necessary to know where the just added Table ends. | public float | getUserunit() Use this method to get the user unit. | public float | getVerticalPosition(boolean ensureNewLine) Use this method to get the current vertical page position.
Parameters: ensureNewLine - Tells whether a new line shall be enforced. | public boolean | isFullCompression() Use this method to find out if 1.5 compression is on. | public boolean | isPdfX() | public boolean | isStrictImageSequence() Use this method to get the strictImageSequence status. | public boolean | isTagged() Check if the document is marked for tagging. | public boolean | isUserProperties() Gets the flag indicating the presence of structure elements that contain user properties attributes. | public void | open() Signals that the Document has been opened and that
Elements can be added. | boolean | propertyExists(Object prop) | void | registerLayer(PdfOCG layer) | public void | releaseTemplate(PdfTemplate tp) Use this method to releases the memory used by a template. | public int | reorderPages(int order) Use this method to reorder the pages in the document.
A null argument value only returns the number of pages to process.
It is advisable to issue a Document.newPage() before using this method.
the total number of pages Parameters: order - an array with the new page sequence. | void | resetContent() Resets all the direct contents to empty. | public void | setAdditionalAction(PdfName actionType, PdfAction action) | public void | setAtLeastPdfVersion(char version) | public void | setBoxSize(String boxName, Rectangle size) Use this method to set the page box sizes. | public void | setCollection(PdfCollection collection) Use this method to add the Collection dictionary. | public void | setCropBoxSize(Rectangle crop) Use this method to set the crop box. | public void | setDefaultColorspace(PdfName key, PdfObject cs) Use this method to sets the default colorspace that will be applied
to all the document. | public void | setDuration(int seconds) | public void | setEncryption(byte userPassword, byte ownerPassword, int permissions, int encryptionType) | public void | setEncryption(Certificate[] certs, int[] permissions, int encryptionType) | public void | setEncryption(byte userPassword, byte ownerPassword, int permissions, boolean strength128Bits) Sets the encryption options for this document. | public void | setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions) Sets the encryption options for this document. | public void | setEncryption(int encryptionType, String userPassword, String ownerPassword, int permissions) Sets the encryption options for this document. | public void | setFullCompression() Use this method to set the document's compression to the
PDF 1.5 mode with object streams and xref streams. | public void | setGroup(PdfDictionary group) Use this method to set the group dictionary. | public void | setLinearPageMode() Use this method to make sure the page tree has a lineair structure
(every leave is attached directly to the root). | public void | setOpenAction(String name) | public void | setOpenAction(PdfAction action) | public void | setOutlines(java.util.List outlines) Sets the bookmarks. | public void | setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, byte destOutputProfile) Use this method to set the values of the output intent dictionary. | public boolean | setOutputIntents(PdfReader reader, boolean checkExistence) Use this method to copy the output intent dictionary
from another document to this one. | public void | setPDFXConformance(int pdfx) | public void | setPageAction(PdfName actionType, PdfAction action) | public void | setPageEmpty(boolean pageEmpty) Use this method to make sure a page is added,
even if it's empty. | public void | setPageEvent(PdfPageEvent event) Sets the PdfPageEvent for this document. | public void | setPageLabels(PdfPageLabels pageLabels) | public void | setPageXmpMetadata(byte[] xmpMetadata) Use this method to set the XMP Metadata for each page. | public void | setPdfVersion(char version) | public void | setPdfVersion(PdfName version) | public void | setRunDirection(int runDirection) Use this method to set the run direction. | public void | setSigFlags(int f) | public void | setSpaceCharRatio(float spaceCharRatio) Use this method to set the ratio between the extra word spacing and
the extra character spacing when the text is fully justified.
Extra word spacing will grow spaceCharRatio times more
than extra character spacing. | public void | setStrictImageSequence(boolean strictImageSequence) Use this method to set the image sequence, so that it follows
the text in strict order (or not). | public void | setTagged() Mark this document for tagging. | public void | setThumbnail(Image image) Use this method to set the thumbnail image for the current page. | public void | setTransition(PdfTransition transition) | public void | setUserProperties(boolean userProperties) Sets the flag indicating the presence of structure elements that contain user properties attributes. | public void | setUserunit(float userunit) Use this method to set the user unit. | public void | setViewerPreferences(int preferences) | public void | setXmpMetadata(byte[] xmpMetadata) Use this method to set the XMP Metadata. | protected void | writeOutlines(PdfDictionary catalog, boolean namedAsNames) |
AllowAssembly | final public static int AllowAssembly(Code) | | The operation permitted when the document is opened with the user password
|
AllowCopy | final public static int AllowCopy(Code) | | The operation permitted when the document is opened with the user password
|
AllowDegradedPrinting | final public static int AllowDegradedPrinting(Code) | | The operation permitted when the document is opened with the user password
|
AllowFillIn | final public static int AllowFillIn(Code) | | The operation permitted when the document is opened with the user password
|
AllowModifyAnnotations | final public static int AllowModifyAnnotations(Code) | | The operation permitted when the document is opened with the user password
|
AllowModifyContents | final public static int AllowModifyContents(Code) | | The operation permitted when the document is opened with the user password
|
AllowPrinting | final public static int AllowPrinting(Code) | | The operation permitted when the document is opened with the user password
|
AllowScreenReaders | final public static int AllowScreenReaders(Code) | | The operation permitted when the document is opened with the user password
|
CenterWindow | final public static int CenterWindow(Code) | | A viewer preference
|
DID_PRINT | final public static PdfName DID_PRINT(Code) | | action value
|
DOCUMENT_CLOSE | final public static PdfName DOCUMENT_CLOSE(Code) | | action value
|
DO_NOT_ENCRYPT_METADATA | final public static int DO_NOT_ENCRYPT_METADATA(Code) | | Add this to the mode to keep the metadata in clear text
|
DirectionL2R | final public static int DirectionL2R(Code) | | A viewer preference
|
DirectionR2L | final public static int DirectionR2L(Code) | | A viewer preference
|
DisplayDocTitle | final public static int DisplayDocTitle(Code) | | A viewer preference
|
ENCRYPTION_AES_128 | final public static int ENCRYPTION_AES_128(Code) | | Type of encryption
|
ENCRYPTION_MASK | final static int ENCRYPTION_MASK(Code) | | Mask to separate the encryption type from the encryption mode.
|
FitWindow | final public static int FitWindow(Code) | | A viewer preference
|
HideMenubar | final public static int HideMenubar(Code) | | A viewer preference
|
HideToolbar | final public static int HideToolbar(Code) | | A viewer preference
|
HideWindowUI | final public static int HideWindowUI(Code) | | A viewer preference
|
NO_SPACE_CHAR_RATIO | final public static float NO_SPACE_CHAR_RATIO(Code) | | Disable the inter-character spacing.
|
NonFullScreenPageModeUseNone | final public static int NonFullScreenPageModeUseNone(Code) | | A viewer preference
|
NonFullScreenPageModeUseOC | final public static int NonFullScreenPageModeUseOC(Code) | | A viewer preference
|
NonFullScreenPageModeUseOutlines | final public static int NonFullScreenPageModeUseOutlines(Code) | | A viewer preference
|
NonFullScreenPageModeUseThumbs | final public static int NonFullScreenPageModeUseThumbs(Code) | | A viewer preference
|
PAGE_CLOSE | final public static PdfName PAGE_CLOSE(Code) | | action value
|
PAGE_OPEN | final public static PdfName PAGE_OPEN(Code) | | action value
|
PDFA1A | final public static int PDFA1A(Code) | | PDFA-1A level.
|
PDFA1B | final public static int PDFA1B(Code) | | PDFA-1B level.
|
PDFX1A2001 | final public static int PDFX1A2001(Code) | | A PDF/X level.
|
PDFX32002 | final public static int PDFX32002(Code) | | A PDF/X level.
|
PDFXNONE | final public static int PDFXNONE(Code) | | A PDF/X level.
|
PDF_VERSION_1_2 | final public static PdfName PDF_VERSION_1_2(Code) | | possible PDF version (catalog)
|
PDF_VERSION_1_3 | final public static PdfName PDF_VERSION_1_3(Code) | | possible PDF version (catalog)
|
PDF_VERSION_1_4 | final public static PdfName PDF_VERSION_1_4(Code) | | possible PDF version (catalog)
|
PDF_VERSION_1_5 | final public static PdfName PDF_VERSION_1_5(Code) | | possible PDF version (catalog)
|
PDF_VERSION_1_6 | final public static PdfName PDF_VERSION_1_6(Code) | | possible PDF version (catalog)
|
PDF_VERSION_1_7 | final public static PdfName PDF_VERSION_1_7(Code) | | possible PDF version (catalog)
|
PageLayoutOneColumn | final public static int PageLayoutOneColumn(Code) | | A viewer preference
|
PageLayoutSinglePage | final public static int PageLayoutSinglePage(Code) | | A viewer preference
|
PageLayoutTwoColumnLeft | final public static int PageLayoutTwoColumnLeft(Code) | | A viewer preference
|
PageLayoutTwoColumnRight | final public static int PageLayoutTwoColumnRight(Code) | | A viewer preference
|
PageLayoutTwoPageLeft | final public static int PageLayoutTwoPageLeft(Code) | | A viewer preference
|
PageLayoutTwoPageRight | final public static int PageLayoutTwoPageRight(Code) | | A viewer preference
|
PageModeFullScreen | final public static int PageModeFullScreen(Code) | | A viewer preference
|
PageModeUseAttachments | final public static int PageModeUseAttachments(Code) | | A viewer preference
|
PageModeUseNone | final public static int PageModeUseNone(Code) | | A viewer preference
|
PageModeUseOC | final public static int PageModeUseOC(Code) | | A viewer preference
|
PageModeUseOutlines | final public static int PageModeUseOutlines(Code) | | A viewer preference
|
PageModeUseThumbs | final public static int PageModeUseThumbs(Code) | | A viewer preference
|
PrintScalingNone | final public static int PrintScalingNone(Code) | | A viewer preference
|
RUN_DIRECTION_DEFAULT | final public static int RUN_DIRECTION_DEFAULT(Code) | | Use the default run direction.
|
RUN_DIRECTION_LTR | final public static int RUN_DIRECTION_LTR(Code) | | Use bidirectional reordering with left-to-right
preferential run direction.
|
RUN_DIRECTION_NO_BIDI | final public static int RUN_DIRECTION_NO_BIDI(Code) | | Do not use bidirectional reordering.
|
RUN_DIRECTION_RTL | final public static int RUN_DIRECTION_RTL(Code) | | Use bidirectional reordering with right-to-left
preferential run direction.
|
SIGNATURE_APPEND_ONLY | final public static int SIGNATURE_APPEND_ONLY(Code) | | signature value
|
SIGNATURE_EXISTS | final public static int SIGNATURE_EXISTS(Code) | | signature value
|
SPACE_CHAR_RATIO_DEFAULT | final public static float SPACE_CHAR_RATIO_DEFAULT(Code) | | The default space-char ratio.
|
STANDARD_ENCRYPTION_128 | final public static int STANDARD_ENCRYPTION_128(Code) | | Type of encryption
|
STANDARD_ENCRYPTION_40 | final public static int STANDARD_ENCRYPTION_40(Code) | | Type of encryption
|
STRENGTH128BITS | final public static boolean STRENGTH128BITS(Code) | | Type of standard encryption strength
|
STRENGTH40BITS | final public static boolean STRENGTH40BITS(Code) | | Type of standard encryption strength
|
VERSION_1_2 | final public static char VERSION_1_2(Code) | | possible PDF version (header)
|
VERSION_1_3 | final public static char VERSION_1_3(Code) | | possible PDF version (header)
|
VERSION_1_4 | final public static char VERSION_1_4(Code) | | possible PDF version (header)
|
VERSION_1_5 | final public static char VERSION_1_5(Code) | | possible PDF version (header)
|
VERSION_1_6 | final public static char VERSION_1_6(Code) | | possible PDF version (header)
|
VERSION_1_7 | final public static char VERSION_1_7(Code) | | possible PDF version (header)
|
WILL_PRINT | final public static PdfName WILL_PRINT(Code) | | action value
|
WILL_SAVE | final public static PdfName WILL_SAVE(Code) | | action value
|
body | protected PdfBody body(Code) | | body of the PDF document
|
colorNumber | protected int colorNumber(Code) | | The color number counter for the colors in the document.
|
currentPageNumber | protected int currentPageNumber(Code) | | The current page number.
|
directContentUnder | protected PdfContentByte directContentUnder(Code) | | The direct content under in this document.
|
documentColors | protected HashMap documentColors(Code) | | The colors of this document
|
documentFonts | protected HashMap documentFonts(Code) | | The fonts of this document
|
documentPatterns | protected HashMap documentPatterns(Code) | | The patterns of this document
|
documentShadingPatterns | protected HashMap documentShadingPatterns(Code) | | |
extraCatalog | protected PdfDictionary extraCatalog(Code) | | Holds value of property extraCatalog this is used for Output Intents.
|
fontNumber | protected int fontNumber(Code) | | The font number counter for the fonts in the document.
|
formXObjects | protected HashMap formXObjects(Code) | | The form XObjects in this document. The key is the xref and the value
is Object[]{PdfName, template}.
|
formXObjectsCounter | protected int formXObjectsCounter(Code) | | The name counter for the form XObjects name.
|
fullCompression | protected boolean fullCompression(Code) | | Holds value of property fullCompression.
|
group | protected PdfDictionary group(Code) | | A group attributes dictionary specifying the attributes
of the page's page group for use in the transparent
imaging model
|
imageDictionary | protected PdfDictionary imageDictionary(Code) | | Dictionary, containing all the images of the PDF document
|
pageReferences | protected ArrayList pageReferences(Code) | | The PdfIndirectReference to the pages.
|
patternNumber | protected int patternNumber(Code) | | The patten number counter for the colors in the document.
|
pdf_version | protected PdfVersionImp pdf_version(Code) | | Stores the version information for the header and the catalog.
|
prevxref | protected int prevxref(Code) | | A number refering to the previous Cross-Reference Table.
|
runDirection | protected int runDirection(Code) | | |
tagged | protected boolean tagged(Code) | | |
userunit | protected float userunit(Code) | | |
xmpMetadata | protected byte[] xmpMetadata(Code) | | XMP Metadata for the document.
|
PdfWriter | protected PdfWriter()(Code) | | Constructs a PdfWriter .
|
PdfWriter | protected PdfWriter(PdfDocument document, OutputStream os)(Code) | | Constructs a PdfWriter .
Remark: a PdfWriter can only be constructed by calling the method
getInstance(Document document, OutputStream os) .
Parameters: document - The PdfDocument that has to be written Parameters: os - The OutputStream the writer has to write to. |
add | PdfIndirectReference add(PdfPage page, PdfContents contents) throws PdfException(Code) | | Adds some PdfContents to this Writer.
The document has to be open before you can begin to add content
to the body of the document.
a PdfIndirectReference Parameters: page - the PdfPage to add Parameters: contents - the PdfContents of the page throws: PdfException - on error |
addDirectImageSimple | public PdfName addDirectImageSimple(Image image) throws PdfException, DocumentException(Code) | | Use this method to adds an image to the document
but not to the page resources. It is used with
templates and Document.add(Image) .
Use this method only if you know what you're doing!
Parameters: image - the Image to add the name of the image added throws: PdfException - on error throws: DocumentException - on error |
addDirectImageSimple | public PdfName addDirectImageSimple(Image image, PdfIndirectReference fixedRef) throws PdfException, DocumentException(Code) | | Adds an image to the document but not to the page resources.
It is used with templates and Document.add(Image) .
Use this method only if you know what you're doing!
Parameters: image - the Image to add Parameters: fixedRef - the reference to used. It may be null ,a PdfIndirectReference or a PRIndirectReference . the name of the image added throws: PdfException - on error throws: DocumentException - on error |
addDirectTemplateSimple | PdfName addDirectTemplateSimple(PdfTemplate template, PdfName forcedName)(Code) | | Adds a template to the document but not to the page resources.
Parameters: template - the template to add Parameters: forcedName - the template name, rather than a generated one. Can be null the PdfName for this template |
addFileAttachment | public void addFileAttachment(String description, byte fileStore, String file, String fileDisplay) throws IOException(Code) | | Use this method to add a file attachment at the document level.
Parameters: description - the file description Parameters: fileStore - an array with the file. If it's null the file will be read from the disk Parameters: file - the path to the file. It will only be used iffileStore is not null Parameters: fileDisplay - the actual file name stored in the pdf throws: IOException - on error |
addFileAttachment | public void addFileAttachment(String description, PdfFileSpecification fs) throws IOException(Code) | | Use this method to add a file attachment at the document level.
Parameters: description - the file description Parameters: fs - the file specification |
addFileAttachment | public void addFileAttachment(PdfFileSpecification fs) throws IOException(Code) | | Use this method to add a file attachment at the document level.
Parameters: fs - the file specification |
addJavaScript | public void addJavaScript(PdfAction js)(Code) | | Use this method to add a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
Parameters: js - The JavaScript action |
addJavaScript | public void addJavaScript(String code, boolean unicode)(Code) | | Use this method to add a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
Parameters: code - the JavaScript code Parameters: unicode - select JavaScript unicode. Note that the internalAcrobat JavaScript engine does not support unicode,so this may or may not work for you |
addJavaScript | public void addJavaScript(String code)(Code) | | Use this method to adds a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
Parameters: code - the JavaScript code |
addJavaScript | public void addJavaScript(String name, PdfAction js)(Code) | | Use this method to add a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
Parameters: name - The name of the JS Action in the name tree Parameters: js - The JavaScript action |
addJavaScript | public void addJavaScript(String name, String code, boolean unicode)(Code) | | Use this method to add a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
Parameters: name - The name of the JS Action in the name tree Parameters: code - the JavaScript code Parameters: unicode - select JavaScript unicode. Note that the internalAcrobat JavaScript engine does not support unicode,so this may or may not work for you |
addJavaScript | public void addJavaScript(String name, String code)(Code) | | Use this method to adds a JavaScript action at the document level.
When the document opens, all this JavaScript runs.
Parameters: name - The name of the JS Action in the name tree Parameters: code - the JavaScript code |
addLocalDestinations | void addLocalDestinations(TreeMap dest) throws IOException(Code) | | Adds the local destinations to the body of the document.
Parameters: dest - the HashMap containing the destinations throws: IOException - on error |
addOCGRadioGroup | public void addOCGRadioGroup(ArrayList group)(Code) | | Use this method to set a collection of optional content groups
whose states are intended to follow a "radio button" paradigm.
That is, the state of at most one optional content group
in the array should be ON at a time: if one group is turned
ON, all others must be turned OFF.
Parameters: group - the radio group |
addSharedObjectsToBody | protected void addSharedObjectsToBody() throws IOException(Code) | | |
addSimple | FontDetails addSimple(BaseFont bf)(Code) | | Adds a BaseFont to the document but not to the page resources.
It is used for templates.
Parameters: bf - the BaseFont to add an Object[] where position 0 is a PdfName and position 1 is an PdfIndirectReference |
addSimple | ColorDetails addSimple(PdfSpotColor spc)(Code) | | Adds a SpotColor to the document but not to the page resources.
Parameters: spc - the SpotColor to add an Object[] where position 0 is a PdfName and position 1 is an PdfIndirectReference |
addToBody | public PdfIndirectObject addToBody(PdfObject object, boolean inObjStm) throws IOException(Code) | | Use this method to add a PDF object to the PDF body.
Use this method only if you know what you're doing!
Parameters: object - Parameters: inObjStm - a PdfIndirectObject throws: IOException - |
addToBody | public PdfIndirectObject addToBody(PdfObject object, int refNumber) throws IOException(Code) | | Use this method to add a PDF object to the PDF body.
Use this method only if you know what you're doing!
Parameters: object - Parameters: refNumber - a PdfIndirectObject throws: IOException - |
addToBody | public PdfIndirectObject addToBody(PdfObject object, int refNumber, boolean inObjStm) throws IOException(Code) | | Use this method to add a PDF object to the PDF body.
Use this method only if you know what you're doing!
Parameters: object - Parameters: refNumber - Parameters: inObjStm - a PdfIndirectObject throws: IOException - |
breakTableIfDoesntFit | public boolean breakTableIfDoesntFit(PdfTable table) throws DocumentException(Code) | | Row additions to the original
Table used to build the
PdfTable are processed and pre-rendered,
and then the contents are deleted.
If the pre-rendered table doesn't fit, then it is fully rendered and its data discarded.
There shouldn't be any column change in the underlying
Table object.
(Contributed by dperezcar@fcc.es)
Parameters: table - The pre-rendered table obtained from PdfWriter.getPdfTable(Table) true if the table is rendered and emptied. throws: DocumentException - See Also: PdfWriter.getPdfTable(Table) |
close | public void close()(Code) | | Signals that the Document was closed and that no other
Elements will be added.
The pages-tree is built and written to the outputstream.
A Catalog is constructed, as well as an Info-object,
the referencetable is composed and everything is written
to the outputstream embedded in a Trailer.
See Also: com.lowagie.text.DocWriter.close |
createXmpMetadata | public void createXmpMetadata()(Code) | | Use this method to creates XMP Metadata based
on the metadata in the PdfDocument.
|
fitsPage | public boolean fitsPage(Table table, float margin)(Code) | | Checks if a Table fits the current page of the PdfDocument .
Parameters: table - the table that has to be checked Parameters: margin - a certain margin true if the Table fits the page, false otherwise. |
fitsPage | public boolean fitsPage(Table table)(Code) | | Checks if a Table fits the current page of the PdfDocument .
Parameters: table - the table that has to be checked true if the Table fits the page, false otherwise. |
fitsPage | public boolean fitsPage(PdfPTable table, float margin)(Code) | | Checks if a PdfPTable fits the current page of the PdfDocument .
Parameters: table - the table that has to be checked Parameters: margin - a certain margin true if the PdfPTable fits the page, false otherwise. |
fitsPage | public boolean fitsPage(PdfPTable table)(Code) | | Checks if a PdfPTable fits the current page of the PdfDocument .
Parameters: table - the table that has to be checked true if the PdfPTable fits the page, false otherwise. |
freeReader | public void freeReader(PdfReader reader) throws IOException(Code) | | Use this method to writes the reader to the document
and free the memory used by it.
The main use is when concatenating multiple documents
to keep the memory usage restricted to the current
appending document.
Parameters: reader - the PdfReader to free throws: IOException - on error |
getBoxSize | public Rectangle getBoxSize(String boxName)(Code) | | Use this method to get the size of a trim, art, crop or bleed box,
or null if not defined.
Parameters: boxName - crop, trim, art or bleed |
getCurrentDocumentSize | public int getCurrentDocumentSize()(Code) | | Use this method to gets the current document size.
This size only includes the data already writen
to the output stream, it does not include templates or fonts.
It is usefull if used with freeReader()
when concatenating many documents and an idea of
the current size is needed.
the approximate size without fonts or templates |
getCurrentPageNumber | public int getCurrentPageNumber()(Code) | | |
getDefaultColorspace | public PdfDictionary getDefaultColorspace()(Code) | | Use this method to get the default colorspaces.
the default colorspaces |
getDirectContent | public PdfContentByte getDirectContent()(Code) | | Use this method to get the direct content for this document.
There is only one direct content, multiple calls to this method
will allways retrieve the same object.
the direct content |
getDirectContentUnder | public PdfContentByte getDirectContentUnder()(Code) | | Use this method to get the direct content under for this document.
There is only one direct content, multiple calls to this method
will allways retrieve the same object.
the direct content |
getExtraCatalog | public PdfDictionary getExtraCatalog()(Code) | | Sets extra keys to the catalog.
the catalog to change |
getGroup | public PdfDictionary getGroup()(Code) | | Use this method to get the group dictionary.
Value of property group. |
getImageReference | PdfIndirectReference getImageReference(PdfName name)(Code) | | return the PdfIndirectReference to the image with a given name.
Parameters: name - the name of the image a PdfIndirectReference |
getImportedPage | public PdfImportedPage getImportedPage(PdfReader reader, int pageNumber)(Code) | | Use this method to get a page from other PDF document.
The page can be used as any other PdfTemplate.
Note that calling this method more than once with the same parameters
will retrieve the same object.
Parameters: reader - the PDF document where the page is Parameters: pageNumber - the page number. The first page is 1 the template representing the imported page |
getIndirectReferenceNumber | int getIndirectReferenceNumber()(Code) | | |
getInfo | public PdfDictionary getInfo()(Code) | | Use this method to get the info dictionary if you want to
change it directly (add keys and values to the info dictionary).
the info dictionary |
getInstance | public static PdfWriter getInstance(Document document, OutputStream os, DocListener listener) throws DocumentException(Code) | | Use this method to get an instance of the PdfWriter .
a new PdfWriter Parameters: document - The Document that has to be written Parameters: os - The OutputStream the writer has to write to. Parameters: listener - A DocListener to pass to the PdfDocument. throws: DocumentException - on error |
getNewObjectNumber | protected int getNewObjectNumber(PdfReader reader, int number, int generation)(Code) | | |
getOCProperties | public PdfOCProperties getOCProperties()(Code) | | Use this method to get the Optional Content Properties Dictionary.
Each call fills the dictionary with the current layer state.
It's advisable to only call this method right before close
and do any modifications at that time.
the Optional Content Properties Dictionary |
getPageEvent | public PdfPageEvent getPageEvent()(Code) | | Gets the PdfPageEvent for this document or null
if none is set.
the PdfPageEvent for this document or null if none is set |
getPageNumber | public int getPageNumber()(Code) | | Gets the pagenumber of this document.
This number can be different from the real pagenumber,
if you have (re)set the page number previously.
a page number |
getPageReference | public PdfIndirectReference getPageReference(int page)(Code) | | Use this method to get a reference to a page existing or not.
If the page does not exist yet the reference will be created
in advance. If on closing the document, a page number greater
than the total number of pages was requested, an exception
is thrown.
Parameters: page - the page number. The first page is 1 the reference to the page |
getPageSize | public Rectangle getPageSize()(Code) | | Use this method to get the size of the media box.
a Rectangle |
getPdfDocument | PdfDocument getPdfDocument()(Code) | | Gets the PdfDocument associated with this writer.
the PdfDocument |
getPdfIndirectReference | public PdfIndirectReference getPdfIndirectReference()(Code) | | Use this to get an PdfIndirectReference for an object that
will be created in the future.
Use this method only if you know what you're doing!
the PdfIndirectReference |
getPdfTable | public PdfTable getPdfTable(Table table)(Code) | | Gets a pre-rendered table.
(Contributed by dperezcar@fcc.es)
Parameters: table - Contains the table definition. Its contents are deleted, after being pre-rendered. a PdfTable |
getRootOutline | public PdfOutline getRootOutline()(Code) | | Use this method to get the root outline
and construct bookmarks.
the root outline |
getRunDirection | public int getRunDirection()(Code) | | Use this method to set the run direction.
the run direction |
getSpaceCharRatio | public float getSpaceCharRatio()(Code) | | Use this method to gets the space/character extra spacing ratio
for fully justified text.
the space/character extra spacing ratio |
getStructureTreeRoot | public PdfStructureTreeRoot getStructureTreeRoot()(Code) | | Gets the structure tree root. If the document is not marked for tagging it will return null .
the structure tree root |
getTableBottom | public float getTableBottom(Table table)(Code) | | Sometimes it is necessary to know where the just added Table ends.
For instance to avoid to add another table in a page that is ending up, because
the new table will be probably splitted just after the header (it is an
unpleasant effect, isn't it?).
Added on September 8th, 2001
by Francesco De Milato
francesco.demilato@tiscalinet.it
Parameters: table - the Table the bottom height of the just added table |
getUserunit | public float getUserunit()(Code) | | Use this method to get the user unit.
A user unit is a value that defines the default user space unit.
The minimum UserUnit is 1 (1 unit = 1/72 inch).
The maximum UserUnit is 75,000.
Note that this userunit only works starting with PDF1.6!
Returns the userunit. |
getVerticalPosition | public float getVerticalPosition(boolean ensureNewLine)(Code) | | Use this method to get the current vertical page position.
Parameters: ensureNewLine - Tells whether a new line shall be enforced. This may cause side effects for elements that do not terminate the lines they've started because those lines will getterminated. The current vertical page position. |
isFullCompression | public boolean isFullCompression()(Code) | | Use this method to find out if 1.5 compression is on.
the 1.5 compression status |
isStrictImageSequence | public boolean isStrictImageSequence()(Code) | | Use this method to get the strictImageSequence status.
value of property strictImageSequence |
isTagged | public boolean isTagged()(Code) | | Check if the document is marked for tagging.
true if the document is marked for tagging |
isUserProperties | public boolean isUserProperties()(Code) | | Gets the flag indicating the presence of structure elements that contain user properties attributes.
the user properties flag |
open | public void open()(Code) | | Signals that the Document has been opened and that
Elements can be added.
When this method is called, the PDF-document header is
written to the outputstream.
See Also: com.lowagie.text.DocWriter.open |
releaseTemplate | public void releaseTemplate(PdfTemplate tp) throws IOException(Code) | | Use this method to releases the memory used by a template.
This method writes the template to the output.
The template can still be added to any content
but changes to the template itself won't have any effect.
Parameters: tp - the template to release throws: IOException - on error |
reorderPages | public int reorderPages(int order) throws DocumentException(Code) | | Use this method to reorder the pages in the document.
A null argument value only returns the number of pages to process.
It is advisable to issue a Document.newPage() before using this method.
the total number of pages Parameters: order - an array with the new page sequence. It must have thesame size as the number of pages. throws: DocumentException - if all the pages are not present in the array |
resetContent | void resetContent()(Code) | | Resets all the direct contents to empty.
This happens when a new page is started.
|
setBoxSize | public void setBoxSize(String boxName, Rectangle size)(Code) | | Use this method to set the page box sizes.
Allowed names are: "crop", "trim", "art" and "bleed".
Parameters: boxName - the box size Parameters: size - the size |
setCollection | public void setCollection(PdfCollection collection)(Code) | | Use this method to add the Collection dictionary.
Parameters: collection - a dictionary of type PdfCollection |
setCropBoxSize | public void setCropBoxSize(Rectangle crop)(Code) | | Use this method to set the crop box.
The crop box should not be rotated even if the page is rotated.
This change only takes effect in the next page.
Parameters: crop - the crop box |
setDefaultColorspace | public void setDefaultColorspace(PdfName key, PdfObject cs)(Code) | | Use this method to sets the default colorspace that will be applied
to all the document. The colorspace is only applied if another colorspace
with the same name is not present in the content.
The colorspace is applied immediately when creating templates and
at the page end for the main document content.
Parameters: key - the name of the colorspace. It can be PdfName.DEFAULTGRAY , PdfName.DEFAULTRGB or PdfName.DEFAULTCMYK Parameters: cs - the colorspace. A null or PdfNull removes any colorspace with the same name |
setEncryption | public void setEncryption(byte userPassword, byte ownerPassword, int permissions, boolean strength128Bits) throws DocumentException(Code) | | Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
Parameters: userPassword - the user password. Can be null or empty Parameters: ownerPassword - the owner password. Can be null or empty Parameters: permissions - the user permissions Parameters: strength128Bits - true for 128 bit key length, false for 40 bit key length throws: DocumentException - if the document is already open |
setEncryption | public void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions) throws DocumentException(Code) | | Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
Parameters: strength - true for 128 bit key length, false for 40 bit key length Parameters: userPassword - the user password. Can be null or empty Parameters: ownerPassword - the owner password. Can be null or empty Parameters: permissions - the user permissions throws: DocumentException - if the document is already open |
setEncryption | public void setEncryption(int encryptionType, String userPassword, String ownerPassword, int permissions) throws DocumentException(Code) | | Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting.
The permissions can be combined by ORing them.
Parameters: encryptionType - the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext Parameters: userPassword - the user password. Can be null or empty Parameters: ownerPassword - the owner password. Can be null or empty Parameters: permissions - the user permissions throws: DocumentException - if the document is already open |
setFullCompression | public void setFullCompression()(Code) | | Use this method to set the document's compression to the
PDF 1.5 mode with object streams and xref streams.
It can be set at any time but once set it can't be unset.
If set before opening the document it will also set the pdf version to 1.5.
|
setGroup | public void setGroup(PdfDictionary group)(Code) | | Use this method to set the group dictionary.
Parameters: group - New value of property group. |
setLinearPageMode | public void setLinearPageMode()(Code) | | Use this method to make sure the page tree has a lineair structure
(every leave is attached directly to the root).
Use this method to allow page reordering with method reorderPages.
|
setOutlines | public void setOutlines(java.util.List outlines)(Code) | | Sets the bookmarks. The list structure is defined in
SimpleBookmark .
Parameters: outlines - the bookmarks or null to remove any |
setOutputIntents | public void setOutputIntents(String outputConditionIdentifier, String outputCondition, String registryName, String info, byte destOutputProfile) throws IOException(Code) | | Use this method to set the values of the output intent dictionary.
Null values are allowed to suppress any key.
Parameters: outputConditionIdentifier - a value Parameters: outputCondition - a value Parameters: registryName - a value Parameters: info - a value Parameters: destOutputProfile - a value throws: IOException - on error |
setOutputIntents | public boolean setOutputIntents(PdfReader reader, boolean checkExistence) throws IOException(Code) | | Use this method to copy the output intent dictionary
from another document to this one.
Parameters: reader - the other document Parameters: checkExistence - true to just check for the existence of a valid output intentdictionary, false to insert the dictionary if it exists throws: IOException - on error true if the output intent dictionary exists, false otherwise |
setPageEmpty | public void setPageEmpty(boolean pageEmpty)(Code) | | Use this method to make sure a page is added,
even if it's empty. If you use setPageEmpty(false),
invoking newPage() after a blank page will add a newPage.
Parameters: pageEmpty - the state |
setPageEvent | public void setPageEvent(PdfPageEvent event)(Code) | | Sets the PdfPageEvent for this document.
Parameters: event - the PdfPageEvent for this document |
setPageLabels | public void setPageLabels(PdfPageLabels pageLabels)(Code) | | Use this method to add page labels
Parameters: pageLabels - the page labels |
setPageXmpMetadata | public void setPageXmpMetadata(byte[] xmpMetadata)(Code) | | Use this method to set the XMP Metadata for each page.
Parameters: xmpMetadata - The xmpMetadata to set. |
setRunDirection | public void setRunDirection(int runDirection)(Code) | | Use this method to set the run direction.
This is only used as a placeholder as it does not affect anything.
Parameters: runDirection - the run direction |
setSpaceCharRatio | public void setSpaceCharRatio(float spaceCharRatio)(Code) | | Use this method to set the ratio between the extra word spacing and
the extra character spacing when the text is fully justified.
Extra word spacing will grow spaceCharRatio times more
than extra character spacing. If the ratio is PdfWriter.NO_SPACE_CHAR_RATIO
then the extra character spacing will be zero.
Parameters: spaceCharRatio - the ratio between the extra word spacing and the extra character spacing |
setStrictImageSequence | public void setStrictImageSequence(boolean strictImageSequence)(Code) | | Use this method to set the image sequence, so that it follows
the text in strict order (or not).
Parameters: strictImageSequence - new value of property strictImageSequence |
setTagged | public void setTagged()(Code) | | Mark this document for tagging. It must be called before open.
|
setUserProperties | public void setUserProperties(boolean userProperties)(Code) | | Sets the flag indicating the presence of structure elements that contain user properties attributes.
Parameters: userProperties - the user properties flag |
setUserunit | public void setUserunit(float userunit) throws DocumentException(Code) | | Use this method to set the user unit.
A UserUnit is a value that defines the default user space unit.
The minimum UserUnit is 1 (1 unit = 1/72 inch).
The maximum UserUnit is 75,000.
Note that this userunit only works starting with PDF1.6!
Parameters: userunit - The userunit to set. throws: DocumentException - on error |
setXmpMetadata | public void setXmpMetadata(byte[] xmpMetadata)(Code) | | Use this method to set the XMP Metadata.
Parameters: xmpMetadata - The xmpMetadata to set. |
|
|