Class PdfDocument
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfDocument
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
PdfADocument
,PdfSigner.PdfSignerDocument
,PdfUADocument
public class PdfDocument extends java.lang.Object implements java.io.Closeable
Main enter point to work with PDF document.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PdfDocument.DestinationMutationInfo
-
Field Summary
Fields Modifier and Type Field Description protected PdfCatalog
catalog
Document catalog.protected boolean
closed
protected boolean
closeReader
protected boolean
closeWriter
protected DefaultFontStrategy
defaultFontStrategy
private PageSize
defaultPageSize
Default page size.private DIContainer
diContainer
private java.util.Map<PdfIndirectReference,PdfFont>
documentFonts
private java.util.Set<IEventHandler>
documentHandlers
private SequenceId
documentId
protected DocumentInfoHelper
documentInfoHelper
private EncryptedEmbeddedStreamsHandler
encryptedEmbeddedStreamsHandler
protected FingerPrint
fingerPrint
protected boolean
flushUnusedObjects
flag determines whether to write unused objects to result documentprivate PdfDocumentInfo
info
Document info.protected boolean
isClosing
private static org.slf4j.Logger
LOGGER
(package private) MemoryLimitsAwareHandler
memoryLimitsAwareHandler
Handler which will be used for decompression of pdf streams.private PdfString
modifiedDocumentId
The original modified (second) id when the document is read initially.private PdfString
originalDocumentId
The original (first) id when the document is read initially.private static PdfName[]
PDF_NAMES_TO_REMOVE_FROM_ORIGINAL_TRAILER
protected PdfConformance
pdfConformance
protected IPdfPageFactory
pdfPageFactory
protected PdfVersion
pdfVersion
Document version.private java.util.List<PdfDocument.DestinationMutationInfo>
pendingDestinationMutations
To be adjusted destinations.protected StampingProperties
properties
protected PdfReader
reader
PdfReader associated with the document.(package private) java.util.Map<PdfIndirectReference,byte[]>
serializedObjectsCache
Cache of already serialized objects from this document for smart mode.protected SerializeOptions
serializeOptions
protected int
structParentIndex
protected PdfStructTreeRoot
structTreeRoot
protected TagStructureContext
tagStructureContext
protected PdfDictionary
trailer
Document trailed.protected PdfWriter
writer
PdfWriter associated with the document.private XMPMeta
xmpMetadata
XMP Metadata which is used to prevent bytes deserialization for a few times on the same bytes.private byte[]
xmpMetadataBytes
XMP Metadata bytes for the document.(package private) PdfXrefTable
xref
List of indirect objects used in the document.
-
Constructor Summary
Constructors Constructor Description PdfDocument(PdfReader reader)
Open PDF document in reading mode.PdfDocument(PdfReader reader, DocumentProperties properties)
Open PDF document in reading mode.PdfDocument(PdfReader reader, PdfWriter writer)
Opens PDF document in the stamping mode.PdfDocument(PdfReader reader, PdfWriter writer, StampingProperties properties)
Open PDF document in stamping mode.PdfDocument(PdfWriter writer)
Open PDF document in writing mode.PdfDocument(PdfWriter writer, DocumentProperties properties)
Open PDF document in writing mode.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAssociatedFile(java.lang.String description, PdfFileSpec fs)
Adds file associated with PDF document as a whole and identifies the relationship between them.void
addEventHandler(java.lang.String type, AbstractPdfDocumentEventHandler handler)
Adds new event handler.void
addFileAttachment(java.lang.String key, PdfFileSpec fs)
Adds file attachment at document level.PdfFont
addFont(PdfFont font)
Adds aPdfFont
instance to this document so that this font is flushed automatically on document close.void
addNamedDestination(PdfString key, PdfObject value)
This methods adds new name in the Dests NameTree.void
addNamedDestination(java.lang.String key, PdfObject value)
This methods adds new name in the Dests NameTree.PdfPage
addNewPage()
Creates and adds new page to the end of document.PdfPage
addNewPage(int index)
Creates and inserts new page to the document.PdfPage
addNewPage(int index, PageSize pageSize)
Creates and inserts new page to the document.PdfPage
addNewPage(PageSize pageSize)
Creates and adds new page with the specified page size.void
addOutputIntent(PdfOutputIntent outputIntent)
AddsPdfOutputIntent
that shall specify the colour characteristics of output devices on which the document might be rendered.PdfPage
addPage(int index, PdfPage page)
Inserts page to the document.PdfPage
addPage(PdfPage page)
Adds page to the end of document.protected void
checkAndAddPage(int index, PdfPage page)
Checks page before adding and add.protected void
checkAndAddPage(PdfPage page)
Checks page before adding.protected void
checkClosingStatus()
checks whether a method is invoked at the closed documentvoid
checkIsoConformance(IValidationContext validationContext)
private void
cloneOutlines(java.util.Set<PdfOutline> outlinesToCopy, PdfOutline newParent, PdfOutline oldParent, java.util.Map<PdfPage,PdfPage> page2page, PdfDocument toDocument)
This method copies create new outlines in the Document to copy.void
close()
Close PDF document.private void
copyOutlines(java.util.Set<PdfOutline> outlines, PdfDocument toDocument, java.util.Map<PdfPage,PdfPage> page2page)
This method copies all given outlinesjava.util.List<PdfPage>
copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument)
Copies a range of pages from current document totoDocument
appending copied pages to the end.java.util.List<PdfPage>
copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument, int insertBeforePage)
Copies a range of pages from current document totoDocument
.java.util.List<PdfPage>
copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument, int insertBeforePage, IPdfPageExtraCopier copier)
Copies a range of pages from current document totoDocument
.java.util.List<PdfPage>
copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument, IPdfPageExtraCopier copier)
Copies a range of pages from current document totoDocument
appending copied pages to the end.java.util.List<PdfPage>
copyPagesTo(java.util.List<java.lang.Integer> pagesToCopy, PdfDocument toDocument)
Copies a range of pages from current document totoDocument
appending copied pages to the end.java.util.List<PdfPage>
copyPagesTo(java.util.List<java.lang.Integer> pagesToCopy, PdfDocument toDocument, int insertBeforePage)
Copies a range of pages from current document totoDocument
.java.util.List<PdfPage>
copyPagesTo(java.util.List<java.lang.Integer> pagesToCopy, PdfDocument toDocument, int insertBeforePage, IPdfPageExtraCopier copier)
Copies a range of pages from current document totoDocument
.java.util.List<PdfPage>
copyPagesTo(java.util.List<java.lang.Integer> pagesToCopy, PdfDocument toDocument, IPdfPageExtraCopier copier)
Copies a range of pages from current document totoDocument
appending copied pages to the end.PdfIndirectReference
createNextIndirectReference()
Creates next available indirect reference.void
dispatchEvent(AbstractPdfDocumentEvent event)
Dispatches an event.(package private) boolean
doesStreamBelongToEmbeddedFile(PdfStream stream)
private void
enableByteArrayWritingMode()
private void
ensureTreeRootAddedToNames(PdfObject treeRoot, PdfName treeType)
PdfFont
findFont(java.lang.String fontProgram, java.lang.String encoding)
FindPdfFont
from loaded fonts with corresponding fontProgram and encoding or CMAP.void
flushCopiedObjects(PdfDocument sourceDoc)
Flush all copied objects and remove them from copied cache.protected void
flushFonts()
Flushes all newly added or loaded fonts.protected void
flushObject(PdfObject pdfObject, boolean canBeInObjStm)
Flush an object.private void
getAllOutlinesToCopy(PdfOutline outline, java.util.Set<PdfOutline> outlinesToCopy)
This method gets all outlines to be copied including parent outlinesPdfArray
getAssociatedFiles()
Returns files associated with PDF document.PdfCatalog
getCatalog()
Gets PDF catalog.PdfConformance
getConformance()
Get thePdfConformance
PdfFont
getDefaultFont()
Gets default font for the document: Helvetica, WinAnsi.PageSize
getDefaultPageSize()
Gets default page size.DIContainer
getDiContainer()
Gets the container containing all available dependencies.protected java.util.Collection<PdfFont>
getDocumentFonts()
List all newly added or loaded fontslong
getDocumentId()
Obtains numeric document id.SequenceId
getDocumentIdWrapper()
Obtains document id as aSequenceId
.PdfDocumentInfo
getDocumentInfo()
Gets document information dictionary.PdfEncryptedPayloadDocument
getEncryptedPayloadDocument()
Gets the encrypted payload of this document, or returnsnull
if this document isn't an unencrypted wrapper document.FingerPrint
getFingerPrint()
Returns the object containing the registered products.PdfPage
getFirstPage()
Get the first page of the document.PdfFont
getFont(PdfDictionary dictionary)
Create a new instance ofPdfFont
or load already created one.PdfPage
getLastPage()
Gets the last page of the document.MemoryLimitsAwareHandler
getMemoryLimitsAwareHandler()
Gets current memory limits handlerPdfString
getModifiedDocumentId()
Gets modified document idint
getNextStructParentIndex()
Gets next parent index of tagged document.int
getNumberOfPages()
Gets number of pages of the document.int
getNumberOfPdfObjects()
Get number of indirect objects in the document.PdfString
getOriginalDocumentId()
Gets original document idPdfOutline
getOutlines(boolean updateOutlines)
This method returns a complete outline tree of the whole document.PdfPage
getPage(int pageNum)
Gets the page by page number.PdfPage
getPage(PdfDictionary pageDictionary)
Gets thePdfPage
instance byPdfDictionary
.protected IPdfPageFactory
getPageFactory()
Returns the factory for creating page instances.java.lang.String[]
getPageLabels()
This method retrieves the page labels from a document as an array of String objects.int
getPageNumber(PdfDictionary pageDictionary)
Gets page number byPdfDictionary
.int
getPageNumber(PdfPage page)
Gets page number by page.PdfObject
getPdfObject(int objNum)
Gets PdfObject by object number.PdfVersion
getPdfVersion()
Gets PDF version.PdfReader
getReader()
GetsPdfReader
associated with the document.SerializeOptions
getSerializeOptions()
Gets a persistent XMP metadata serialization options.PdfStructTreeRoot
getStructTreeRoot()
GetsPdfStructTreeRoot
of tagged document.TagStructureContext
getTagStructureContext()
Gets documentTagStructureContext
.PdfDictionary
getTrailer()
Gets document trailer.PdfWriter
getWriter()
GetsPdfWriter
associated with the document.XMPMeta
getXmpMetadata()
Gets XMP Metadata.XMPMeta
getXmpMetadata(boolean createNew)
Gets XMP Metadata or create a new one.byte[]
getXmpMetadataBytes()
Gets XMP Metadata.byte[]
getXmpMetadataBytes(boolean createNew)
Gets XMP Metadata or create a new one.(package private) PdfXrefTable
getXref()
Gets list of indirect references.(package private) boolean
hasAcroForm()
boolean
hasEventHandler(AbstractPdfDocumentEventHandler handler)
Checks if provided event handler assigned for this document.boolean
hasOutlines()
Indicates if the document has any outlinesvoid
initializeOutlines()
This method initializes an outline tree of the document and sets outline mode to true.protected void
initTagStructureContext()
InitializeTagStructureContext
.boolean
isAppendMode()
Returnstrue
if the document is opened in append mode, andfalse
otherwise.boolean
isClosed()
Gets close status of the document.boolean
isCloseReader()
Checks, whetherclose()
method will close associated PdfReader.boolean
isCloseWriter()
Checks, whetherclose()
method will close associated PdfWriter.boolean
isClosing()
Checks if the document closing has been started or not.(package private) boolean
isDocumentFont(PdfIndirectReference indRef)
boolean
isFlushUnusedObjects()
Checks, whetherclose()
will flush unused objects, e.g.boolean
isTagged()
Gets tagged status of the document.java.util.List<PdfIndirectReference>
listIndirectReferences()
Gets static copy of cross reference table.void
markStreamAsEmbeddedFile(PdfStream stream)
MarksPdfStream
object as embedded file stream.void
movePage(int pageNumber, int insertBefore)
Moves page to new place in same document with all it tag structureboolean
movePage(PdfPage page, int insertBefore)
Moves page to new place in same document with all it tag structureprotected void
open(PdfVersion newPdfVersion)
Initializes document.private static void
overrideFullCompressionInWriterProperties(WriterProperties properties, boolean readerHasXrefStream)
private void
processReadingError(java.lang.String errorMessage)
private void
readDocumentIds()
boolean
registerProduct(ProductData productData)
Registers a product for debugging purposes.void
removeAllHandlers()
Removes all event handlers for this document.void
removeEventHandler(AbstractPdfDocumentEventHandler handler)
Removes event handler.void
removePage(int pageNum)
Removes page from the document by page number.boolean
removePage(PdfPage page)
Removes the first occurrence of the specified page from this document, if it is present.private void
removeUnusedWidgetsFromFields(PdfPage page)
Removes all widgets associated with a given page from AcroForm structure.private void
resolveDestinations(PdfDocument toDocument, java.util.Map<PdfPage,PdfPage> page2page)
void
setCloseReader(boolean closeReader)
Sets, whetherclose()
method shall close associated PdfReader.void
setCloseWriter(boolean closeWriter)
Sets, whetherclose()
method shall close associated PdfWriter.void
setDefaultPageSize(PageSize pageSize)
Sets default page size.void
setEncryptedPayload(PdfFileSpec fs)
Sets an encrypted payload, making this document an unencrypted wrapper document.void
setFlushUnusedObjects(boolean flushUnusedObjects)
Sets, whetherclose()
shall flush unused objects, e.g.void
setSerializeOptions(SerializeOptions serializeOptions)
Sets a persistent XMP metadata serialization options.PdfDocument
setTagged()
Specifies that document shall contain tag structure.void
setUserProperties(boolean userProperties)
Sets the flag indicating the presence of structure elements that contain user properties attributes.protected void
setXmpMetadata(byte[] xmpMetadata)
Sets the XMP Metadata.void
setXmpMetadata(XMPMeta xmpMeta)
Sets the XMP Metadata.void
setXmpMetadata(XMPMeta xmpMeta, SerializeOptions serializeOptions)
Sets the XMP Metadata.protected void
storeDestinationToReaddress(PdfDestination destination, java.util.function.Consumer<PdfDestination> onPageAvailable, java.util.function.Consumer<PdfDestination> onPageNotAvailable)
Save destinations in a temporary storage for further copying.private void
tryFlushTagStructure(boolean isAppendMode)
protected void
tryInitTagStructure(PdfDictionary str)
Initializes the new instance of document's structure tree rootPdfStructTreeRoot
.protected XMPMeta
updateDefaultXmpMetadata()
Update XMP metadata values fromPdfDocumentInfo
.private void
updatePdfVersionFromCatalog()
private void
updateValueInMarkInfoDict(PdfName key, PdfObject value)
protected void
updateXmpMetadata()
Updates XMP metadata.private boolean
writerHasEncryption()
-
-
-
Field Detail
-
PDF_NAMES_TO_REMOVE_FROM_ORIGINAL_TRAILER
private static final PdfName[] PDF_NAMES_TO_REMOVE_FROM_ORIGINAL_TRAILER
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
properties
protected final StampingProperties properties
-
xref
final PdfXrefTable xref
List of indirect objects used in the document.
-
documentFonts
private final java.util.Map<PdfIndirectReference,PdfFont> documentFonts
-
documentHandlers
private final java.util.Set<IEventHandler> documentHandlers
-
documentId
private final SequenceId documentId
-
pendingDestinationMutations
private final java.util.List<PdfDocument.DestinationMutationInfo> pendingDestinationMutations
To be adjusted destinations. Key - originating page on the source document Value - a hashmap of Parent pdf objects and destinations to be updated
-
writer
protected PdfWriter writer
PdfWriter associated with the document. Not null if document opened either in writing or stamping mode.
-
reader
protected PdfReader reader
PdfReader associated with the document. Not null if document is opened either in reading or stamping mode.
-
catalog
protected PdfCatalog catalog
Document catalog.
-
trailer
protected PdfDictionary trailer
Document trailed.
-
pdfVersion
protected PdfVersion pdfVersion
Document version.
-
pdfConformance
protected PdfConformance pdfConformance
-
fingerPrint
protected FingerPrint fingerPrint
-
serializeOptions
protected SerializeOptions serializeOptions
-
structTreeRoot
protected PdfStructTreeRoot structTreeRoot
-
structParentIndex
protected int structParentIndex
-
closeReader
protected boolean closeReader
-
closeWriter
protected boolean closeWriter
-
isClosing
protected boolean isClosing
-
closed
protected boolean closed
-
flushUnusedObjects
protected boolean flushUnusedObjects
flag determines whether to write unused objects to result document
-
tagStructureContext
protected TagStructureContext tagStructureContext
-
documentInfoHelper
protected DocumentInfoHelper documentInfoHelper
-
defaultFontStrategy
protected DefaultFontStrategy defaultFontStrategy
-
pdfPageFactory
protected IPdfPageFactory pdfPageFactory
-
serializedObjectsCache
java.util.Map<PdfIndirectReference,byte[]> serializedObjectsCache
Cache of already serialized objects from this document for smart mode.
-
memoryLimitsAwareHandler
MemoryLimitsAwareHandler memoryLimitsAwareHandler
Handler which will be used for decompression of pdf streams.
-
defaultPageSize
private PageSize defaultPageSize
Default page size. New page by default will be created with this size.
-
originalDocumentId
private PdfString originalDocumentId
The original (first) id when the document is read initially.
-
modifiedDocumentId
private PdfString modifiedDocumentId
The original modified (second) id when the document is read initially.
-
encryptedEmbeddedStreamsHandler
private EncryptedEmbeddedStreamsHandler encryptedEmbeddedStreamsHandler
-
info
private PdfDocumentInfo info
Document info.
-
xmpMetadataBytes
private byte[] xmpMetadataBytes
XMP Metadata bytes for the document.
-
xmpMetadata
private XMPMeta xmpMetadata
XMP Metadata which is used to prevent bytes deserialization for a few times on the same bytes.
-
diContainer
private final DIContainer diContainer
-
-
Constructor Detail
-
PdfDocument
public PdfDocument(PdfReader reader)
Open PDF document in reading mode.- Parameters:
reader
- PDF reader.
-
PdfDocument
public PdfDocument(PdfReader reader, DocumentProperties properties)
Open PDF document in reading mode.- Parameters:
reader
- PDF reader.properties
- document properties
-
PdfDocument
public PdfDocument(PdfWriter writer)
Open PDF document in writing mode. Document has no pages when initialized.- Parameters:
writer
- PDF writer
-
PdfDocument
public PdfDocument(PdfWriter writer, DocumentProperties properties)
Open PDF document in writing mode. Document has no pages when initialized.- Parameters:
writer
- PDF writerproperties
- document properties
-
PdfDocument
public PdfDocument(PdfReader reader, PdfWriter writer)
Opens PDF document in the stamping mode.- Parameters:
reader
- PDF reader.writer
- PDF writer.
-
PdfDocument
public PdfDocument(PdfReader reader, PdfWriter writer, StampingProperties properties)
Open PDF document in stamping mode.- Parameters:
reader
- PDF reader.writer
- PDF writer.properties
- properties of the stamping process
-
-
Method Detail
-
isClosing
public boolean isClosing()
Checks if the document closing has been started or not.- Returns:
true
if closing process has been started, otherwisefalse
-
setXmpMetadata
public void setXmpMetadata(XMPMeta xmpMeta, SerializeOptions serializeOptions) throws XMPException
Sets the XMP Metadata.The XMP Metadata values are synchronized with information dictionary.
- Parameters:
xmpMeta
- the xmpMetadata to setserializeOptions
- serialization options- Throws:
XMPException
- on serialization errors
-
setXmpMetadata
public void setXmpMetadata(XMPMeta xmpMeta) throws XMPException
Sets the XMP Metadata.The XMP Metadata values are synchronized with information dictionary.
serializeOptions
will be used for serialization, they can be changed bysetSerializeOptions(SerializeOptions)
.- Parameters:
xmpMeta
- the xmpMetadata to set- Throws:
XMPException
- on serialization errors
-
setXmpMetadata
protected void setXmpMetadata(byte[] xmpMetadata)
Sets the XMP Metadata.The XMP Metadata values are synchronized with information dictionary.
- Parameters:
xmpMetadata
- the xmpMetadata bytes to set
-
getXmpMetadata
public XMPMeta getXmpMetadata() throws XMPException
Gets XMP Metadata.XMP Metadata is lazy initialized. It will be initialized during the first call of this method.
To update XMP Metadata of the document, use
setXmpMetadata(XMPMeta)
method.- Returns:
- existed XMP Metadata
- Throws:
XMPException
- on serialization errors
-
getXmpMetadata
public XMPMeta getXmpMetadata(boolean createNew) throws XMPException
Gets XMP Metadata or create a new one.XMP Metadata is lazy initialized. It will be initialized during the first call of this method.
To update XMP Metadata of the document, use
setXmpMetadata(XMPMeta)
method.- Parameters:
createNew
- if true, create a new empty XMP Metadata if it did not present- Returns:
- existed or newly created XMP Metadata
- Throws:
XMPException
- on serialization errors
-
getXmpMetadataBytes
public byte[] getXmpMetadataBytes()
Gets XMP Metadata.XMP Metadata is lazy initialized. It will be initialized during the first call of this method.
To update XMP Metadata of the document, use
setXmpMetadata(XMPMeta)
method.- Returns:
- existed XMP Metadata bytes
-
getXmpMetadataBytes
public byte[] getXmpMetadataBytes(boolean createNew)
Gets XMP Metadata or create a new one.XMP Metadata is lazy initialized. It will be initialized during the first call of this method.
To update XMP Metadata of the document, use
setXmpMetadata(XMPMeta)
method.- Parameters:
createNew
- if true, create a new empty XMP Metadata if it did not present- Returns:
- existed or newly created XMP Metadata byte array
-
getPdfObject
public PdfObject getPdfObject(int objNum)
Gets PdfObject by object number.- Parameters:
objNum
- object number.- Returns:
PdfObject
ornull
, if object not found.
-
getNumberOfPdfObjects
public int getNumberOfPdfObjects()
Get number of indirect objects in the document.- Returns:
- number of indirect objects.
-
getPage
public PdfPage getPage(int pageNum)
Gets the page by page number.- Parameters:
pageNum
- page number.- Returns:
- page by page number.
- Throws:
PdfException
- in case the page tree is broken
-
getPage
public PdfPage getPage(PdfDictionary pageDictionary)
Gets thePdfPage
instance byPdfDictionary
.- Parameters:
pageDictionary
-PdfDictionary
that present page.- Returns:
- page by
PdfDictionary
.
-
getFirstPage
public PdfPage getFirstPage()
Get the first page of the document.- Returns:
- first page of the document.
-
getLastPage
public PdfPage getLastPage()
Gets the last page of the document.- Returns:
- last page.
-
getMemoryLimitsAwareHandler
public MemoryLimitsAwareHandler getMemoryLimitsAwareHandler()
Gets current memory limits handler- Returns:
MemoryLimitsAwareHandler
instance
-
markStreamAsEmbeddedFile
public void markStreamAsEmbeddedFile(PdfStream stream)
MarksPdfStream
object as embedded file stream. Note that this method is for internal usage. To add an embedded file to the PDF document please use specialized API for file attachments. (e.g.addFileAttachment(String, PdfFileSpec)
,PdfPage.addAnnotation(PdfAnnotation)
)- Parameters:
stream
- to be marked as embedded file stream
-
addNewPage
public PdfPage addNewPage()
Creates and adds new page to the end of document.- Returns:
- added page
-
addNewPage
public PdfPage addNewPage(PageSize pageSize)
Creates and adds new page with the specified page size.- Parameters:
pageSize
- page size of the new page- Returns:
- added page
-
addNewPage
public PdfPage addNewPage(int index)
Creates and inserts new page to the document.- Parameters:
index
- position to addPage page to- Returns:
- inserted page
- Throws:
PdfException
- in casepage
is flushed
-
addNewPage
public PdfPage addNewPage(int index, PageSize pageSize)
Creates and inserts new page to the document.- Parameters:
index
- position to addPage page topageSize
- page size of the new page- Returns:
- inserted page
- Throws:
PdfException
- in casepage
is flushed
-
addPage
public PdfPage addPage(PdfPage page)
Adds page to the end of document.- Parameters:
page
- page to add.- Returns:
- added page.
- Throws:
PdfException
- in casepage
is flushed
-
addPage
public PdfPage addPage(int index, PdfPage page)
Inserts page to the document.- Parameters:
index
- position to addPage page topage
- page to addPage- Returns:
- inserted page
- Throws:
PdfException
- in casepage
is flushed
-
getNumberOfPages
public int getNumberOfPages()
Gets number of pages of the document.- Returns:
- number of pages.
-
getPageNumber
public int getPageNumber(PdfPage page)
Gets page number by page.- Parameters:
page
- the page.- Returns:
- page number.
-
getPageNumber
public int getPageNumber(PdfDictionary pageDictionary)
Gets page number byPdfDictionary
.- Parameters:
pageDictionary
-PdfDictionary
that present page.- Returns:
- page number by
PdfDictionary
.
-
movePage
public boolean movePage(PdfPage page, int insertBefore)
Moves page to new place in same document with all it tag structure- Parameters:
page
- page to be moved in document if presentinsertBefore
- indicates before which page new one will be inserted to- Returns:
- true if this document contained the specified page
-
movePage
public void movePage(int pageNumber, int insertBefore)
Moves page to new place in same document with all it tag structure- Parameters:
pageNumber
- number of Page that will be movedinsertBefore
- indicates before which page new one will be inserted to
-
removePage
public boolean removePage(PdfPage page)
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).- Parameters:
page
- page to be removed from this document, if present- Returns:
- true if this document contained the specified page
-
removePage
public void removePage(int pageNum)
Removes page from the document by page number.- Parameters:
pageNum
- the one-based index of the PdfPage to be removed
-
getDiContainer
public DIContainer getDiContainer()
Gets the container containing all available dependencies.- Returns:
- the container containing all available dependencies.
-
getDocumentInfo
public PdfDocumentInfo getDocumentInfo()
Gets document information dictionary.info
is lazy initialized. It will be initialized during the first call of this method.The information dictionary values are synchronized with document XMP Metadata.
- Returns:
- document information dictionary.
-
getOriginalDocumentId
public PdfString getOriginalDocumentId()
Gets original document idIn order to set originalDocumentId
WriterProperties.setInitialDocumentId(com.itextpdf.kernel.pdf.PdfString)
should be used- Returns:
- original document id
-
getModifiedDocumentId
public PdfString getModifiedDocumentId()
Gets modified document idIn order to set modifiedDocumentId
WriterProperties.setModifiedDocumentId(com.itextpdf.kernel.pdf.PdfString)
should be used- Returns:
- modified document id
-
getDefaultPageSize
public PageSize getDefaultPageSize()
Gets default page size. New pages by default are created with this size.- Returns:
- default page size
-
setDefaultPageSize
public void setDefaultPageSize(PageSize pageSize)
Sets default page size. New pages by default will be created with this size.- Parameters:
pageSize
- page size to be set as default
-
addEventHandler
public void addEventHandler(java.lang.String type, AbstractPdfDocumentEventHandler handler)
Adds new event handler.- Parameters:
type
- a type of event to be handledhandler
- event handler
-
dispatchEvent
public void dispatchEvent(AbstractPdfDocumentEvent event)
Dispatches an event.- Parameters:
event
- theAbstractPdfDocumentEvent
to be dispatched
-
hasEventHandler
public boolean hasEventHandler(AbstractPdfDocumentEventHandler handler)
Checks if provided event handler assigned for this document.- Parameters:
handler
- theAbstractPdfDocumentEventHandler
to check- Returns:
true
if event handler is assigned for this document,false
otherwise
-
removeEventHandler
public void removeEventHandler(AbstractPdfDocumentEventHandler handler)
Removes event handler.- Parameters:
handler
-AbstractPdfDocumentEventHandler
event handler to remove for this document
-
removeAllHandlers
public void removeAllHandlers()
Removes all event handlers for this document.
-
getWriter
public PdfWriter getWriter()
GetsPdfWriter
associated with the document.- Returns:
- PdfWriter associated with the document.
-
getReader
public PdfReader getReader()
GetsPdfReader
associated with the document.- Returns:
- PdfReader associated with the document.
-
isAppendMode
public boolean isAppendMode()
Returnstrue
if the document is opened in append mode, andfalse
otherwise.- Returns:
true
if the document is opened in append mode, andfalse
otherwise.
-
createNextIndirectReference
public PdfIndirectReference createNextIndirectReference()
Creates next available indirect reference.- Returns:
- created indirect reference.
-
getPdfVersion
public PdfVersion getPdfVersion()
Gets PDF version.- Returns:
- PDF version.
-
getCatalog
public PdfCatalog getCatalog()
Gets PDF catalog.- Returns:
- PDF catalog.
-
close
public void close()
Close PDF document.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
isClosed
public boolean isClosed()
Gets close status of the document.- Returns:
- true, if the document has already been closed, otherwise false.
-
isTagged
public boolean isTagged()
Gets tagged status of the document.- Returns:
- true, if the document has tag structure, otherwise false.
-
setTagged
public PdfDocument setTagged()
Specifies that document shall contain tag structure. See ISO 32000-1, section 14.8 "Tagged PDF"- Returns:
- this
PdfDocument
instance
-
getStructTreeRoot
public PdfStructTreeRoot getStructTreeRoot()
GetsPdfStructTreeRoot
of tagged document.- Returns:
PdfStructTreeRoot
in case document is tagged, otherwise it returns null.- See Also:
isTagged()
,getNextStructParentIndex()
-
getNextStructParentIndex
public int getNextStructParentIndex()
Gets next parent index of tagged document.- Returns:
- -1 if document is not tagged, or >= 0 if tagged.
- See Also:
isTagged()
,getNextStructParentIndex()
-
getTagStructureContext
public TagStructureContext getTagStructureContext()
Gets documentTagStructureContext
. The document must be tagged, otherwise an exception will be thrown.- Returns:
- document
TagStructureContext
.
-
copyPagesTo
public java.util.List<PdfPage> copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument, int insertBeforePage)
Copies a range of pages from current document totoDocument
. 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.
- Parameters:
pageFrom
- start of the range of pages to be copied.pageTo
- end of the range of pages to be copied.toDocument
- a document to copy pages to.insertBeforePage
- a position where to insert copied pages.- Returns:
- list of copied pages
-
getConformance
public PdfConformance getConformance()
Get thePdfConformance
- Returns:
- the document conformance
-
copyPagesTo
public java.util.List<PdfPage> copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument, int insertBeforePage, IPdfPageExtraCopier copier)
Copies a range of pages from current document totoDocument
. This range is inclusive, bothpage
andpageTo
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.
- Parameters:
pageFrom
- 1-based start of the range of pages to be copied.pageTo
- 1-based end (inclusive) of the range of pages to be copied. This page is included in list of copied pages.toDocument
- a document to copy pages to.insertBeforePage
- a position where to insert copied pages.copier
- a copier which bears a special copy logic. May be null. It is recommended to use the same instance ofIPdfPageExtraCopier
for the same output document.- Returns:
- list of new copied pages
-
copyPagesTo
public java.util.List<PdfPage> copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument)
Copies a range of pages from current document totoDocument
appending copied pages to the end. This range is inclusive, bothpage
andpageTo
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.
- Parameters:
pageFrom
- 1-based start of the range of pages to be copied.pageTo
- 1-based end (inclusive) of the range of pages to be copied. This page is included in list of copied pages.toDocument
- a document to copy pages to.- Returns:
- list of new copied pages
-
copyPagesTo
public java.util.List<PdfPage> copyPagesTo(int pageFrom, int pageTo, PdfDocument toDocument, IPdfPageExtraCopier copier)
Copies a range of pages from current document totoDocument
appending copied pages to the end. This range is inclusive, bothpage
andpageTo
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.
- Parameters:
pageFrom
- 1-based start of the range of pages to be copied.pageTo
- 1-based end (inclusive) of the range of pages to be copied. This page is included in list of copied pages.toDocument
- a document to copy pages to.copier
- a copier which bears a special copy logic. May be null. It is recommended to use the same instance ofIPdfPageExtraCopier
for the same output document.- Returns:
- list of new copied pages.
-
copyPagesTo
public java.util.List<PdfPage> copyPagesTo(java.util.List<java.lang.Integer> pagesToCopy, PdfDocument toDocument, int insertBeforePage)
Copies a range of pages from current document totoDocument
. 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.
- Parameters:
pagesToCopy
- list of pages to be copied.toDocument
- a document to copy pages to.insertBeforePage
- a position where to insert copied pages.- Returns:
- list of new copied pages
-
copyPagesTo
public java.util.List<PdfPage> copyPagesTo(java.util.List<java.lang.Integer> pagesToCopy, PdfDocument toDocument, int insertBeforePage, IPdfPageExtraCopier copier)
Copies a range of pages from current document totoDocument
. 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.
- Parameters:
pagesToCopy
- list of pages to be copied.toDocument
- a document to copy pages to.insertBeforePage
- a position where to insert copied pages.copier
- a copier which bears a special copy logic. May be null. It is recommended to use the same instance ofIPdfPageExtraCopier
for the same output document.- Returns:
- list of new copied pages
-
copyPagesTo
public java.util.List<PdfPage> copyPagesTo(java.util.List<java.lang.Integer> pagesToCopy, PdfDocument toDocument)
Copies a range of pages from current document totoDocument
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.
- Parameters:
pagesToCopy
- list of pages to be copied.toDocument
- a document to copy pages to.- Returns:
- list of copied pages
-
copyPagesTo
public java.util.List<PdfPage> copyPagesTo(java.util.List<java.lang.Integer> pagesToCopy, PdfDocument toDocument, IPdfPageExtraCopier copier)
Copies a range of pages from current document totoDocument
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.
- Parameters:
pagesToCopy
- list of pages to be copied.toDocument
- a document to copy pages to.copier
- a copier which bears a special copy logic. May be null. It is recommended to use the same instance ofIPdfPageExtraCopier
for the same output document.- Returns:
- list of copied pages
-
flushCopiedObjects
public void flushCopiedObjects(PdfDocument sourceDoc)
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.
- Parameters:
sourceDoc
- source document
-
isCloseReader
public boolean isCloseReader()
Checks, whetherclose()
method will close associated PdfReader.- Returns:
- true,
close()
method is going to close associated PdfReader, otherwise false.
-
setCloseReader
public void setCloseReader(boolean closeReader)
Sets, whetherclose()
method shall close associated PdfReader.- Parameters:
closeReader
- true,close()
method shall close associated PdfReader, otherwise false.
-
isCloseWriter
public boolean isCloseWriter()
Checks, whetherclose()
method will close associated PdfWriter.- Returns:
- true,
close()
method is going to close associated PdfWriter, otherwise false.
-
setCloseWriter
public void setCloseWriter(boolean closeWriter)
Sets, whetherclose()
method shall close associated PdfWriter.- Parameters:
closeWriter
- true,close()
method shall close associated PdfWriter, otherwise false.
-
isFlushUnusedObjects
public boolean isFlushUnusedObjects()
Checks, whetherclose()
will flush unused objects, e.g. unreachable from PDF Catalog. By default - false.- Returns:
- false, if
close()
shall not flush unused objects, otherwise true.
-
setFlushUnusedObjects
public void setFlushUnusedObjects(boolean flushUnusedObjects)
Sets, whetherclose()
shall flush unused objects, e.g. unreachable from PDF Catalog.- Parameters:
flushUnusedObjects
- false, ifclose()
shall not flush unused objects, otherwise true.
-
getOutlines
public PdfOutline getOutlines(boolean updateOutlines)
This method returns a complete outline tree of the whole document.- Parameters:
updateOutlines
- if the flag istrue
, the method reads the whole document and creates outline tree. If the flag isfalse
, the method gets cached outline tree (if it was cached via calling getOutlines method before).- Returns:
- fully initialize
PdfOutline
object.
-
initializeOutlines
public void initializeOutlines()
This method initializes an outline tree of the document and sets outline mode to true.
-
addNamedDestination
public void addNamedDestination(java.lang.String key, PdfObject value)
This methods adds new name in the Dests NameTree. It throws an exception, if the name already exists.- Parameters:
key
- Name of the destination.value
- An object destination refers to. Must be an array or a dictionary with key /D and array. See ISO 32000-1 12.3.2.3 for more info.
-
addNamedDestination
public void addNamedDestination(PdfString key, PdfObject value)
This methods adds new name in the Dests NameTree. It throws an exception, if the name already exists.- Parameters:
key
- Name of the destination.value
- An object destination refers to. Must be an array or a dictionary with key /D and array. See ISO 32000-1 12.3.2.3 for more info.
-
listIndirectReferences
public java.util.List<PdfIndirectReference> listIndirectReferences()
Gets static copy of cross reference table.- Returns:
- a static copy of cross reference table
-
getTrailer
public PdfDictionary getTrailer()
Gets document trailer.- Returns:
- document trailer.
-
addOutputIntent
public void addOutputIntent(PdfOutputIntent outputIntent)
AddsPdfOutputIntent
that shall specify the colour characteristics of output devices on which the document might be rendered.- Parameters:
outputIntent
-PdfOutputIntent
to add.- See Also:
PdfOutputIntent
-
checkIsoConformance
public void checkIsoConformance(IValidationContext validationContext)
-
addFileAttachment
public void addFileAttachment(java.lang.String key, PdfFileSpec fs)
Adds file attachment at document level.- Parameters:
key
- name of the destination.fs
-PdfFileSpec
object.
-
addAssociatedFile
public void addAssociatedFile(java.lang.String description, PdfFileSpec fs)
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
addFileAttachment(String, PdfFileSpec)
. However, besides adding file description to Names tree, it adds file to array value of the AF key in the document catalog.For associated files their associated file specification dictionaries shall include the AFRelationship key
- Parameters:
description
- the file descriptionfs
- file specification dictionary of associated file- See Also:
addFileAttachment(String, PdfFileSpec)
-
getAssociatedFiles
public PdfArray getAssociatedFiles()
Returns files associated with PDF document.- Returns:
- associated files array.
-
getEncryptedPayloadDocument
public PdfEncryptedPayloadDocument getEncryptedPayloadDocument()
Gets the encrypted payload of this document, or returnsnull
if this document isn't an unencrypted wrapper document.- Returns:
- encrypted payload of this document.
-
setEncryptedPayload
public void setEncryptedPayload(PdfFileSpec fs)
Sets an encrypted payload, making this document an unencrypted wrapper document. The file spec shall include the AFRelationship key with a value of EncryptedPayload, and shall include an encrypted payload dictionary.- Parameters:
fs
- encrypted payload file spec.PdfEncryptedPayloadFileSpecFactory
can produce one.
-
getPageLabels
public java.lang.String[] getPageLabels()
This method retrieves the page labels from a document as an array of String objects.- Returns:
String
list of page labels if they were found, ornull
otherwise
-
hasOutlines
public boolean hasOutlines()
Indicates if the document has any outlines- Returns:
true
, if there are outlines andfalse
otherwise.
-
setUserProperties
public void setUserProperties(boolean userProperties)
Sets the flag indicating the presence of structure elements that contain user properties attributes.- Parameters:
userProperties
- the user properties flag
-
getFont
public PdfFont getFont(PdfDictionary dictionary)
Create a new instance ofPdfFont
or load already created one.- Parameters:
dictionary
-PdfDictionary
that presentsPdfFont
.- Returns:
- instance of
PdfFont
Note, PdfFont which created with
PdfFontFactory.createFont(PdfDictionary)
won't be cached until it will be added toPdfCanvas
orPdfResources
.
-
getDefaultFont
public PdfFont getDefaultFont()
Gets default font for the document: Helvetica, WinAnsi. One instance per document.- Returns:
- instance of
PdfFont
ornull
on error.
-
addFont
public PdfFont addFont(PdfFont font)
Adds aPdfFont
instance to this document so that this font is flushed automatically on document close. As a side effect, the underlying font dictionary is made indirect if it wasn't the case yet- Parameters:
font
- aPdfFont
instance to add- Returns:
- the same PdfFont instance.
-
registerProduct
public boolean registerProduct(ProductData productData)
Registers a product for debugging purposes.- Parameters:
productData
- product to be registered.- Returns:
- true if the product hadn't been registered before.
-
getFingerPrint
public FingerPrint getFingerPrint()
Returns the object containing the registered products.- Returns:
- fingerprint object
-
findFont
public PdfFont findFont(java.lang.String fontProgram, java.lang.String encoding)
FindPdfFont
from loaded fonts with corresponding fontProgram and encoding or CMAP.- Parameters:
fontProgram
- a font name or path to a font programencoding
- an encoding or CMAP- Returns:
- the font instance, or null if font wasn't found
-
getDocumentId
public long getDocumentId()
Obtains numeric document id.- Returns:
- document id
-
getDocumentIdWrapper
public SequenceId getDocumentIdWrapper()
Obtains document id as aSequenceId
.- Returns:
- document id
-
getSerializeOptions
public SerializeOptions getSerializeOptions()
Gets a persistent XMP metadata serialization options.- Returns:
- serialize options
-
setSerializeOptions
public void setSerializeOptions(SerializeOptions serializeOptions)
Sets a persistent XMP metadata serialization options.- Parameters:
serializeOptions
- serialize options
-
initTagStructureContext
protected void initTagStructureContext()
InitializeTagStructureContext
.
-
storeDestinationToReaddress
protected void storeDestinationToReaddress(PdfDestination destination, java.util.function.Consumer<PdfDestination> onPageAvailable, java.util.function.Consumer<PdfDestination> onPageNotAvailable)
Save destinations in a temporary storage for further copying.- Parameters:
destination
- thePdfDestination
to be updated itself.onPageAvailable
- a destination consumer that will handle the copying when the destination still resolves, it gets the new destination as inputonPageNotAvailable
- a destination consumer that will handle the copying when the destination is not available, it gets the original destination as input
-
flushObject
protected void flushObject(PdfObject pdfObject, boolean canBeInObjStm) throws java.io.IOException
Flush an object.- Parameters:
pdfObject
- object to flush.canBeInObjStm
- indicates whether object can be placed into object stream.- Throws:
java.io.IOException
- on error.
-
open
protected void open(PdfVersion newPdfVersion)
Initializes document.- Parameters:
newPdfVersion
- new pdf version of the resultant file if stamper is used and the version needs to be changed, ornull
otherwise
-
updateXmpMetadata
protected void updateXmpMetadata()
Updates XMP metadata. Shall be overridden.
-
updateDefaultXmpMetadata
protected XMPMeta updateDefaultXmpMetadata() throws XMPException
Update XMP metadata values fromPdfDocumentInfo
.- Returns:
- the XMPMetadata
- Throws:
XMPException
- if the file is not well-formed XML or if parsing fails.
-
getDocumentFonts
protected java.util.Collection<PdfFont> getDocumentFonts()
List all newly added or loaded fonts- Returns:
- List of
PdfFont
.
-
flushFonts
protected void flushFonts()
Flushes all newly added or loaded fonts.
-
checkAndAddPage
protected void checkAndAddPage(int index, PdfPage page)
Checks page before adding and add.- Parameters:
index
- one-base index of the page.page
-PdfPage
to add.
-
checkAndAddPage
protected void checkAndAddPage(PdfPage page)
Checks page before adding.- Parameters:
page
-PdfPage
to add.
-
checkClosingStatus
protected void checkClosingStatus()
checks whether a method is invoked at the closed document
-
getPageFactory
protected IPdfPageFactory getPageFactory()
Returns the factory for creating page instances.- Returns:
- implementation of
IPdfPageFactory
for current document
-
tryInitTagStructure
protected void tryInitTagStructure(PdfDictionary str)
Initializes the new instance of document's structure tree rootPdfStructTreeRoot
. See ISO 32000-1, section 14.7.2 Structure Hierarchy.- Parameters:
str
- dictionary to create structure tree root
-
getXref
PdfXrefTable getXref()
Gets list of indirect references.- Returns:
- list of indirect references.
-
isDocumentFont
boolean isDocumentFont(PdfIndirectReference indRef)
-
doesStreamBelongToEmbeddedFile
boolean doesStreamBelongToEmbeddedFile(PdfStream stream)
-
hasAcroForm
boolean hasAcroForm()
-
enableByteArrayWritingMode
private void enableByteArrayWritingMode()
-
tryFlushTagStructure
private void tryFlushTagStructure(boolean isAppendMode)
-
removeUnusedWidgetsFromFields
private void removeUnusedWidgetsFromFields(PdfPage page)
Removes all widgets associated with a given page from AcroForm structure. Widgets can be either pure or merged.- Parameters:
page
- to remove from.
-
resolveDestinations
private void resolveDestinations(PdfDocument toDocument, java.util.Map<PdfPage,PdfPage> page2page)
-
copyOutlines
private void copyOutlines(java.util.Set<PdfOutline> outlines, PdfDocument toDocument, java.util.Map<PdfPage,PdfPage> page2page)
This method copies all given outlines- Parameters:
outlines
- outlines to be copiedtoDocument
- document where outlines should be copied
-
getAllOutlinesToCopy
private void getAllOutlinesToCopy(PdfOutline outline, java.util.Set<PdfOutline> outlinesToCopy)
This method gets all outlines to be copied including parent outlines- Parameters:
outline
- current outlineoutlinesToCopy
- a Set of outlines to be copied
-
cloneOutlines
private void cloneOutlines(java.util.Set<PdfOutline> outlinesToCopy, PdfOutline newParent, PdfOutline oldParent, java.util.Map<PdfPage,PdfPage> page2page, PdfDocument toDocument)
This method copies create new outlines in the Document to copy.- Parameters:
outlinesToCopy
- - Set of outlines to be copiednewParent
- - new parent outlineoldParent
- - old parent outline
-
ensureTreeRootAddedToNames
private void ensureTreeRootAddedToNames(PdfObject treeRoot, PdfName treeType)
-
writerHasEncryption
private boolean writerHasEncryption()
-
updatePdfVersionFromCatalog
private void updatePdfVersionFromCatalog()
-
readDocumentIds
private void readDocumentIds()
-
processReadingError
private void processReadingError(java.lang.String errorMessage)
-
overrideFullCompressionInWriterProperties
private static void overrideFullCompressionInWriterProperties(WriterProperties properties, boolean readerHasXrefStream)
-
-