| Modifier and Type | Field and Description |
|---|---|
| private AccessPermission | |
| private boolean | |
| private final COSDocument | |
| private PDDocumentCatalog | |
| private Long | |
| private PDDocumentInformation | |
| private PDEncryption | |
| private final Set | |
| private final Set | |
| private final Collection | |
| private static final Log | |
| private final RandomAccessRead | |
| private static final int[] | RESERVE_BYTE_RANGE
For signing: large reserve byte range used as placeholder in the saved PDF until the actual length of the PDF is known. |
| private ResourceCache | |
| private boolean | |
| private SigningSupport | |
| private SignatureInterface |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PDDocument(RandomAccessStreamCache.
a function to create an instance of a stream cache for buffering PDF streams streamCacheCreateFunctionCreates an empty PDF document. |
| public | PDDocument(COSDocument
The COSDocument that this document wraps. doc)Constructor that uses an existing document. |
| public | PDDocument(COSDocument
The COSDocument that this document wraps. doc, RandomAccessRead input representing the pdf source)Constructor that uses an existing document. |
| public | PDDocument(COSDocument
The COSDocument that this document wraps. doc, RandomAccessRead input representing the pdf source, AccessPermission he access permissions of the pdf permission)Constructor that uses an existing document. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | addSignature(PDSignature
is the PDSignatureField model sigObject)Add parameters of signature to be created externally using default signature options. |
| public void | addSignature(PDSignature
is the PDSignatureField model sigObject, SignatureOptions signature options options)Add parameters of signature to be created externally. |
| public void | addSignature(PDSignature
is the PDSignatureField model sigObject, SignatureInterface is an interface whose implementation provides
signing capabilities. Can be null if external signing if used. signatureInterface)Add a signature to be created using the instance of given interface. |
| public void | addSignature(PDSignature
is the PDSignatureField model sigObject, SignatureInterface is an interface whose implementation provides
signing capabilities. Can be null if external signing if used. signatureInterface, SignatureOptions signature options options)This will add a signature to the document. |
| private void | |
| private void | |
| private void | |
| private boolean | Returns: true if the widget already existed in the annotation list, false if not.the list of PDAnnotation fields. annotations, PDAnnotationWidget the annotation widget. widget)Check if the widget already exists in the annotation list. |
| private boolean | Returns: true if the field already existed in the field list, false if not.iterator on all fields. fieldIterator, PDSignatureField the signature field. signatureField)Check if the field already exists in the field list. |
| public void | |
| private PDSignatureField | Returns: a signature field if found, or null if none was found.iterator on all fields. fieldIterator, PDSignature signature object (the /V part). sigObject)Search acroform fields for signature field with specific signature dictionary. |
| public AccessPermission | Returns: the access permissions for the current user on the document.Returns the access permissions granted when the document was decrypted. |
| public COSDocument | Returns: The document that this layer sits on top of.This will get the low level document. |
| public PDDocumentCatalog | |
| public Long | Returns: the document IDProvides the document ID. This is not the trailer document ID but the time used to create it. |
| public PDDocumentInformation | Returns: The documents /Info dictionary, never null.This will get the document info dictionary. |
| public PDEncryption | Returns: The encryption dictionary(most likely a PDStandardEncryption object)This will get the encryption dictionary for this document. |
| pack-priv Set | |
| public PDSignature | Returns: the last signature asPDSignatureField.This will return the last signature from the field tree. |
| public int | Returns: The total number of pages in the PDF document.This will return the total page count of the PDF document. |
| public PDPage | Returns: the page at the given index.the 0-based page index pageIndex)Returns the page at the given 0-based index. |
| public PDPageTree | |
| public ResourceCache | Returns: the resource cache of the documentReturns the resource cache associated with this document, or null if there is none. |
| public List | Returns: aList of PDSignatureFieldsRetrieve all signature dictionaries from the document. |
| public List | Returns: aList of PDSignatureFieldsRetrieve all signature fields from the document. |
| public float | Returns: the PDF version (e.g. 1.4f)Returns the PDF specification version this document conforms to. |
| public PDPage | Returns: The page that was imported.The page to import. page)This will import and copy the contents from another location. |
| public boolean | Returns: returns true if all security shall be removed otherwise falseIndicates if all security is removed or not when writing the pdf. |
| public boolean | Returns: true If this document is encrypted.This will tell if this document is encrypted or not. |
| private void | |
| private void | prepareVisibleSignature(PDAnnotationWidget firstWidget, PDAcroForm acroForm, COSDocument visualSignature)
|
| public void | protect(ProtectionPolicy
The protection policy. policy)Protects the document with a protection policy. |
| public void | registerTrueTypeFontForClosing(TrueTypeFont
the TrueTypeFont to be registered ttf)For internal PDFBox use when creating PDF documents: register a TrueTypeFont to make sure it is closed when the PDDocument is closed to avoid memory leaks. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | save(OutputStream
The stream to write to. It is recommended to wrap it in a output)java.,
unless it is already buffered.This will save the document to an output stream. |
| public void | save(File
The file to save as. file, CompressParameters The parameters for the document's compression. compressParameters)Save the document using the given compression. |
| public void | save(String
The file to save as. fileName, CompressParameters The parameters for the document's compression. compressParameters)Save the document to a file using the given compression. |
| public void | save(OutputStream
The stream to write to. It is recommended to wrap it in a output, CompressParameters java.,
unless it is already buffered.The parameters for the document's compression. compressParameters)Save the document using the given compression. |
| public void | saveIncremental(OutputStream
stream to write to. It will be closed when done. It must never point to the source
file or that one will be harmed! output)Save the PDF as an incremental update. |
| public void | saveIncremental(OutputStream
stream to write to. It will be closed when done. It must never point to the source
file or that one will be harmed! output, Set<COSDictionary> objects that must be part of the incremental saving. objectsToWrite)Save the PDF as an incremental update. |
| public ExternalSigningSupport | Returns: instance to be used for external signing and setting CMS signaturestream to write the final PDF. It will be closed when the document is closed. It must
never point to the source file or that one will be harmed! output)Save PDF incrementally without closing for external signature creation scenario. |
| public void | setAllSecurityToBeRemoved(boolean
remove all security if set to true removeAllSecurity)Activates/Deactivates the removal of all security when writing the pdf. |
| public void | |
| public void | setDocumentInformation(PDDocumentInformation
The updated document information. info)This will set the document information for this document. |
| public void | setEncryptionDictionary(PDEncryption
The encryption dictionary(most likely a PDStandardEncryption object) encryption)This will set the encryption dictionary for this document. |
| private void | setHighestImportedObjectNumber(PDPage
the imported page. importedPage)Determine the highest object number from the imported page to avoid mixed up numbers when saving the new pdf. |
| public void | setResourceCache(ResourceCache
A resource cache, or null. resourceCache)Sets the resource cache associated with this document. |
| public void | setVersion(float
the new PDF version (e.g. 1.4f) newVersion)Sets the PDF specification version for this document. |
| private void |