Generated by
JDiff

com.itextpdf.kernel.pdf Documentation Differences

This file contains all the changes in documentation in the package com.itextpdf.kernel.pdf as colored differences. Deletions are shown like this , and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a tag will cause all subsequent paragraphs to be displayed differently.

Class PdfCatalog, PdfNameTree getNameTree(PdfName)

This method gets Names tree from the catalog. @param treeType type of the tree (Dests, AP, EmbeddedFiles etc). @return returns PdfNameTree
Class PdfCatalog, PdfOCProperties getOCProperties(boolean)

Use this method to get the Optional Content Properties Dictionary. Note that if you call this method, then the PdfDictionary with OCProperties will be generated from PdfOCProperties object right before closing the PdfDocument, so if you want to make low-level changes in Pdf structures themselves (PdfArray, PdfDictionary, etc), then you should address directly those objects, e.g.: PdfCatalog pdfCatalog = pdfDoc.getCatalog(); PdfDictionary ocProps = pdfCatalog.getAsDictionary(PdfName.OCProperties); // manipulate with ocProps. Also note that this method is implicitly called when creating a new PdfLayer instance, so you should either use hi-level logic of operating with layers, or manipulate low-level Pdf objects by yourself. @param createIfNotExists true to create new /OCProperties entry in catalog if not exists, false to return null if /OCProperties entry in catalog is not present. @return the Optional Content Properties Dictionary
Class PdfCatalog, PdfNumTree getPageLabelsTree(boolean)

This method returns the NumberTree of Page Labels @param createIfNotExists defines whether the NumberTree of Page Labels should be created if it didn't exist before before @return returns PdfNumTree
Class PdfCatalog, PdfCatalog put(PdfName, PdfObject)

Add key and value to PdfCatalog dictionary. @param key the dictionary key corresponding with the PDF object @param value the value of key key @return the key and value
Class PdfCatalog, PdfCatalog remove(PdfName)

Remove key from catalog dictionary. @param key the dictionary key corresponding with the PDF object object @return the key
Class PdfCatalog, PdfCatalog setAdditionalAction(PdfName, PdfAction)

The actions that shall be taken in response to various trigger events affecting the document as a whole. See ISO 32000-1, Table 28 # Entries in the catalog dictionary. @param key the key of which the associated value needs to be returned @param action instance of PdfAction. @return additional action
Class PdfCatalog, PdfCatalog setCollection(PdfCollection)

Sets collection dictionary that a conforming reader shall use to enhance the presentation of file attachments stored in the PDF document. @param collection dictionary @return PdfCatalog instance with applied collection dictionary
Class PdfCatalog, PdfCatalog setOpenAction(PdfAction)

A value specifying an action that shall be performed when the document is opened. See ISO 32000-1, Table 28 # Entries in the catalog dictionary. @param action instance of PdfAction. @return action
Class PdfCatalog, PdfCatalog setOpenAction(PdfDestination)

A value specifying a destination that shall be displayed when the document is opened. See ISO 32000-1, Table 28 # Entries in the catalog dictionary. @param destination instance of PdfDestination. @return destination
Class PdfCatalog, PdfCatalog setPageLayout(PdfName)

This method sets a page layout of the document @param pageLayout page layout of the document document @return PdfCatalog instance with applied page layout
Class PdfCatalog, PdfCatalog setPageMode(PdfName)

This method sets a page mode of the document.
Valid values are: {@code PdfName.UseNone}, {@code PdfName.UseOutlines}, {@code PdfName.UseThumbs}, {@code PdfName.FullScreen}, {@code PdfName.UseOC}, {@code PdfName.UseAttachments}. @param pageMode page mode. @return current instance of PdfCatalog
Class PdfCatalog, PdfCatalog setViewerPreferences(PdfViewerPreferences)

This method sets the document viewer preferences, specifying the way the document shall be displayed on the screen @param preferences document's viewer preferences @return PdfCatalog instance with applied viewer preferences

Class PdfDictionary, PdfDictionary getAsDictionary(PdfName)

Returns the value associated to this key as a PdfDictionary. If the value isn't a PdfDictionary, null is returned. @param key the key of which the associated value needs to be returned @return PdfDictionary associated with this key

Class PdfDocument, constructor PdfDocument(PdfReader, DocumentProperties)

Open PDF document in reading mode. @param reader PDF reader. @param properties document properties
Class PdfDocument, constructor PdfDocument(PdfWriter, DocumentProperties)

Open PDF document in writing mode. Document has no pages when initialized. @param writer PDF writer @param properties document properties
Class PdfDocument, void addAssociatedFile(String, PdfFileSpec)

Adds file associated with PDF document as a whole and identifies the relationship between them.

Associated files may be used in Pdf/A-3 and Pdf 2.0 documents. The method is very similar to PdfDocument.addFileAttachment(String, PdfFileSpec). However, besides adding file description to Names tree, it adds file to array value of the AF key in the document document catalog.

For associated files their associated file specification dictionaries shall include the AFRelationship key @param description the file description @param fs file specification dictionary of associated file file @see PdfDocument#addFileAttachment(String, PdfFileSpec)

Class PdfDocument, PdfPage addNewPage(PageSize)

Creates and adds new page with the specified page size. @param pageSize page size of the new page page @return added page
Class PdfDocument, PdfPage addNewPage(int)

Creates and inserts new page to the document. @param index position to addPage page to to @return inserted page page @throws PdfException in case {@code page} is flushed
Class PdfDocument, PdfPage addNewPage(int, PageSize)

Creates and inserts new page to the document. @param index position to addPage page to @param pageSize page size of the new page page @return inserted page page @throws PdfException in case {@code page} is flushed
Class PdfDocument, void addOutputIntent(PdfOutputIntent)

Adds PdfOutputIntent that shall specify the colour characteristics of output devices on which the document might be rendered. @param outputIntent PdfOutputIntent to add. @see PdfOutputIntent
Class PdfDocument, PdfPage addPage(PdfPage)

Adds page to the end of document. @param page page to add. @return added page. @throws PdfException in case {@code page} is flushed
Class PdfDocument, PdfPage addPage(int, PdfPage)

Inserts page to the document. @param index position to addPage page to @param page page to addPage addPage @return inserted page page @throws PdfException in case {@code page} is flushed
Class PdfDocument, void checkIsoConformance(Object, IsoKey, PdfResources, PdfStream)

Checks whether PDF document conforms a specific standard. Shall be override. @param obj an object to conform. @param key type of object to conform. @param resources PdfResources associated with an object to check. @param contentStream current content stream
Class PdfDocument, List copyPagesTo(List, PdfDocument)

Copies a range of pages from current document to {@code toDocument} appending copied pages to the end. Use this method if you want to copy pages across tagged documents. This will keep resultant PDF structure consistent.

If outlines destination names are the same in different documents, all such outlines will lead to a single location in the resultant document. In this case iText will log a warning. This can be avoided by renaming destinations names in the source document. @param pagesToCopy list of pages to be copied. @param toDocument a document to copy pages to. @return list of copied pages

Class PdfDocument, List copyPagesTo(List, PdfDocument, IPdfPageExtraCopier)

Copies a range of pages from current document to {@code toDocument} appending copied pages to the end. Use this method if you want to copy pages across tagged documents. This will keep resultant PDF structure consistent.

If outlines destination names are the same in different documents, all such outlines will lead to a single location in the resultant document. In this case iText will log a warning. This can be avoided by renaming destinations names in the source document. @param pagesToCopy list of pages to be copied. @param toDocument a document to copy pages to. @param copier a copier which bears a special copy logic. May be null. It is recommended to use the same instance of IPdfPageExtraCopier for the same output document. @return list of copied pages

Class PdfDocument, List copyPagesTo(List, PdfDocument, int)

Copies a range of pages from current document to {@code toDocument}. Use this method if you want to copy pages across tagged documents. This will keep resultant PDF structure consistent.

If outlines destination names are the same in different documents, all such outlines will lead to a single location in the resultant document. In this case iText will log a warning. This can be avoided by renaming destinations names in the source document. @param pagesToCopy list of pages to be copied. @param toDocument a document to copy pages to. @param insertBeforePage a position where to insert copied pages. @return list of new copied pages

Class PdfDocument, List copyPagesTo(List, PdfDocument, int, IPdfPageExtraCopier)

Copies a range of pages from current document to {@code toDocument}. Use this method if you want to copy pages across tagged documents. This will keep resultant PDF structure consistent.

If outlines destination names are the same in different documents, all such outlines will lead to a single location in the resultant document. In this case iText will log a warning. This can be avoided by renaming destinations names in the source document. @param pagesToCopy list of pages to be copied. @param toDocument a document to copy pages to. @param insertBeforePage a position where to insert copied pages. @param copier a copier which bears a special copy logic. May be null. It is recommended to use the same instance of IPdfPageExtraCopier for the same output document. @return list of new copied pages

Class PdfDocument, List copyPagesTo(int, int, PdfDocument)

Copies a range of pages from current document to {@code toDocument} appending copied pages to the end. This range is inclusive, both {@code page} and {@code pageTo} are included in list of copied pages. Use this method if you want to copy pages across tagged documents. This will keep resultant PDF structure consistent.

If outlines destination names are the same in different documents, all such outlines will lead to a single location in the resultant document. In this case iText will log a warning. This can be avoided by renaming destinations names in the source document. @param pageFrom 1-based start of the range of pages to be copied. @param pageTo 1-based end (inclusive) of the range of pages to be copied. This page is included in list of of copied pages. @param toDocument a document to copy pages to. @return list of new copied pages

Class PdfDocument, List copyPagesTo(int, int, PdfDocument, IPdfPageExtraCopier)

Copies a range of pages from current document to {@code toDocument} appending copied pages to the end. This range is inclusive, both {@code page} and {@code pageTo} are included in list of copied pages. Use this method if you want to copy pages across tagged documents. This will keep resultant PDF structure consistent.

If outlines destination names are the same in different documents, all such outlines will lead to a single location in the resultant document. In this case iText will log a warning. This can be avoided by renaming destinations names in the source document. @param pageFrom 1-based start of the range of pages to be copied. @param pageTo 1-based end (inclusive) of the range of pages to be copied. This page is included in list of of copied pages. @param toDocument a document to copy pages to. @param copier a copier which bears a special copy logic. May be null. It is recommended to use the same instance of IPdfPageExtraCopier for the same output document. @return list of new copied pages.

Class PdfDocument, List copyPagesTo(int, int, PdfDocument, int)

Copies a range of pages from current document to {@code toDocument}. Use this method if you want to copy pages across tagged documents. This will keep resultant PDF structure consistent.

If outlines destination names are the same in different documents, all such outlines will lead to a single location in the resultant document. In this case iText will log a warning. This can be avoided by renaming destinations names in the source document. @param pageFrom start of the range of pages to be copied. @param pageTo end of the range of pages to be copied. @param toDocument a document to copy pages to. @param insertBeforePage a position where to insert copied pages. @return list of copied pages

Class PdfDocument, List copyPagesTo(int, int, PdfDocument, int, IPdfPageExtraCopier)

Copies a range of pages from current document to {@code toDocument}. This range is inclusive, both {@code page} and {@code pageTo} are included in list of copied pages. Use this method if you want to copy pages across tagged documents. This will keep resultant PDF structure consistent.

If outlines destination names are the same in different documents, all such outlines will lead to a single location in the resultant document. In this case iText will log a warning. This can be avoided by renaming destinations names in the source document. @param pageFrom 1-based start of the range of pages to be copied. @param pageTo 1-based end (inclusive) of the range of pages to be copied. This page is included in list list of copied pages. @param toDocument a document to copy pages to. @param insertBeforePage a position where to insert copied pages. @param copier a copier which bears a special copy logic. May be null. It is recommended to use the same instance of IPdfPageExtraCopier for the same output document. @return list of new copied pages

Class PdfDocument, PdfFont findFont(String, String)

Find PdfFont from loaded fonts with corresponding fontProgram and encoding or CMAP. @param fontProgram a font name or path to a font program @param encoding an encoding or CMAP @return the font instance, or null if font wasn't found
Class PdfDocument, void flushCopiedObjects(PdfDocument)

Flush all copied objects and remove them from copied cache.

Note, if you will copy objects from the same document, duplicated objects will be created. That's why usually this method is meant to be used when all copying from source document is finished. For other cases one can also consider other flushing mechanisms, e.g. pages-based flushing. @param sourceDoc source document

Class PdfDocument, void flushObject(PdfObject, boolean)

Flush an object. @param pdfObject object to flush. @param canBeInObjStm indicates whether object can be placed into object stream. @throws IOException on error.
Class PdfDocument, PdfString getModifiedDocumentId()

Gets modified document id id

In order to set modifiedDocumentId WriterProperties.setModifiedDocumentId should be used @return modified document id

Class PdfDocument, PdfString getOriginalDocumentId()

Gets original document id id

In order to set originalDocumentId WriterProperties.setInitialDocumentId should be used @return original dccument id

Class PdfDocument, PdfOutline getOutlines(boolean)

This method returns a complete outline tree of the whole document. @param updateOutlines if the flag is {@code true}, the method reads the whole document and creates outline tree. If the flag is {@code false}, the method gets cached outline tree (if it was cached via calling getOutlines method before). @return fully initialize PdfOutline object.
Class PdfDocument, PdfPage getPage(PdfDictionary)

Gets the PdfPage instance by PdfDictionary. @param pageDictionary PdfDictionary that present page. @return page by PdfDictionary.
Class PdfDocument, PdfPage getPage(int)

Gets the page by page number. @param pageNum page number. @return page by page number. may return {@code null} in case the page tree is broken
Class PdfDocument, int getPageNumber(PdfDictionary)

Gets page number by PdfDictionary. @param pageDictionary PdfDictionary that present page. @return page number by PdfDictionary.
Class PdfDocument, int getPageNumber(PdfPage)

Gets page number by page. @param page the page. @return page number.
Class PdfDocument, PdfObject getPdfObject(int)

Gets PdfObject by object number. @param objNum object number. @return PdfObject or {@code null}, if object not found.
Class PdfDocument, byte[] getXmpMetadata(boolean)

Gets XMPMetadata or create a new one. @param createNew if true, create a new empty XMPMetadata if it did not present. @return existed or newly created XMPMetadata byte array.
Class PdfDocument, List listIndirectReferences()

Gets static copy of cross reference table. @return a static copy of cross reference table
Class PdfDocument, boolean movePage(PdfPage, int)

Moves page to new place in same document with all it tag structure @param page page to be moved in document if present @param insertBefore indicates before which page new one will be inserted to to @return true if this document contained the specified page
Class PdfDocument, void movePage(int, int)

Moves page to new place in same document with all it tag structure @param pageNumber number of Page that will be moved @param insertBefore indicates before which page new one will be inserted to
Class PdfDocument, void open(PdfVersion)

Initializes document. @param newPdfVersion new pdf version of the resultant file if stamper is used and the version needs to be be changed, or {@code null} otherwise
Class PdfDocument, boolean registerProduct(ProductData)

Registers a product for debugging purposes. @param productData product to be registered. @return true if the product hadn't been registered before.
Class PdfDocument, boolean removePage(PdfPage)

Removes the first occurrence of the specified page from this document, if it is present. Returns true if this document contained the specified element (or equivalently, if this document changed as a result of the call). @param page page to be removed from this document, if present present @return true if this document contained the specified page
Class PdfDocument, void setXmpMetadata(XMPMeta, SerializeOptions)

Sets the XMP Metadata. @param xmpMeta the xmpMetadata to set @param serializeOptions serialization options @throws XMPException on serialization errors
Class PdfDocument, void storeLinkAnnotation(PdfPage, PdfLinkAnnotation)

Save the link annotation in a temporary storage for further copying. Save destinations in a temporary storage for further copying. @param page just copied PdfPage link annotation belongs to. @param annotation PdfLinkAnnotation itself. @deprecated will be removed in next major version, it is being replaced with storeDestinationToReaddress
Class PdfDocument, XMPMeta updateDefaultXmpMetadata()

Update XMP metadata values from PdfDocumentInfo. @return the XMPMetadata XMPMetadata @throws XMPException if the file is not well-formed XML or if parsing fails.

Class PdfIndirectReference, boolean isFree()

Checks if this PdfIndirectReference instance corresponds to free indirect reference. Indirect reference might be in a free state either because it was read as such from the opened existing PDF document or because it was set free via PdfIndirectReference.setFree() method. @return {@code true} if this PdfIndirectReference is free, {@code false} otherwise.
Class PdfIndirectReference, PdfObject setState(short)

Sets special states of current object. @param state special flag of current object

Class PdfObject, boolean checkState(short)

Checks state of the flag of current object. @param state special flag to check check @return true if the state was set.
Class PdfObject, PdfObject clearState(short)

Clear state of the flag of current object. @param state special flag state to clear clear @return this PdfObject
Class PdfObject, PdfObject copyTo(PdfDocument)

Copies object to a specified document.

NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown. @param document document to copy object to. @return copied object.
Class PdfObject, PdfObject copyTo(PdfDocument, boolean)

Copies object to a specified document.

NOTE: Works only for objects that are read from document opened in reading mode, otherwise an exception is thrown. @param document document to copy object to. @param allowDuplicating indicates if to allow copy objects which already have been copied. If object is associated with any indirect reference and allowDuplicating is is false then already existing reference will be returned instead of copying object. If allowDuplicating is true then object will be copied and new indirect indirect reference will be assigned. @return copied object.
Class PdfObject, PdfObject makeIndirect(PdfDocument)

Marks object to be saved as indirect. @param document a document the indirect reference will belong to. @return object itself.
Class PdfObject, PdfObject makeIndirect(PdfDocument, PdfIndirectReference)

Marks object to be saved as indirect. @param document a document the indirect reference will belong to. @param reference indirect reference which will be associated with this document document @return object itself.
Class PdfObject, PdfObject setModified()

Sets the 'modified' flag to the indirect object, the flag denotes that the object was modified since since the document opening. It is recommended to set this flag after changing any PDF object.

For example flag is used in the append mode (see StampingProperties.useAppendMode()). In append mode the whole document is preserved as is, and only changes to the document are appended to the end of the document file. Because of this, only modified objects need to be flushed and are allowed to be flushed (i.e. to be written). @return this PdfObject instance.

Class PdfObject, PdfObject setState(short)

Sets special states of current object. @param state special flag of current object object @return this PdfObject

Class PdfWriter, constructor PdfWriter(File)

Create a PdfWriter writing to the passed File and with default writer properties. @param file File to write to. @throws FileNotFoundException if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
Class PdfWriter, constructor PdfWriter(String)

Create a PdfWriter writing to the passed filename and with default writer properties. @param filename filename of the resulting pdf. @throws FileNotFoundException if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
Class PdfWriter, constructor PdfWriter(String, WriterProperties)

Create a PdfWriter writing to the passed filename and using the passed writer properties. @param filename filename of the resulting pdf. @param properties writerproperties to use. @throws FileNotFoundException if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
Class PdfWriter, PdfWriter setCompressionLevel(int)

Sets default compression level for @see PdfStream. For more details @see com.itextpdf.io.source.DeflaterOutputStream. @param compressionLevel compression level. @return this PdfWriter instance
Class PdfWriter, PdfWriter setSmartMode(boolean)

Sets the smart mode.
In smart mode when resources (such as fonts, images,...) are encountered, a reference to these resources is saved in a cache, so that they can be reused. This requires more memory, but reduces the file size of the resulting PDF document. @param smartMode True for enabling smart mode. @return this PdfWriter instance