public final class PdfFormat extends DocumentFormat<PdfMetadata,PdfMetadataProperty,DocumentInfo> implements IXmp, IInspectable<PdfInspectionResult,PdfInspectionOptions>, IProtectableFormat, ISignedFormat
Represents PDF format.
Constructor and Description |
---|
PdfFormat(InputStream input)
Initializes a new instance of the
PdfFormat class. |
PdfFormat(InputStream input,
LoadOptions loadOptions)
Initializes a new instance of the
PdfFormat class. |
PdfFormat(String fileName)
Initializes a new instance of the
PdfFormat class. |
PdfFormat(String fileName,
LoadOptions loadOptions)
Initializes a new instance of the
PdfFormat class. |
Modifier and Type | Method and Description |
---|---|
void |
cleanMetadata()
Remove custom metadata and reset built-in properties like
PdfMetadata.CreatedDate . |
protected void |
dispose(boolean disposing)
Releases unmanaged and optionally managed resources.
|
PdfMetadata |
getDocumentProperties()
Gets the document properties in
PdfFormat . |
DublinCoreMetadata |
getDublinCore()
Gets Dublin Core metadata.
|
int |
getFileType()
Gets file type.
|
int |
getType()
Gets document type.
|
String |
getVersion()
Gets PDF version.
|
XmpPacketWrapper |
getXmpData()
Returns the XMP packet.
|
XmpProperties |
getXmpProperties()
Returns all XMP properties presented in PDF document.
|
XmpEditableCollection |
getXmpValues()
Gets
XmpEditableCollection . |
boolean |
hasDigitalSignatures()
Gets a value indicating whether document contains
DigitalSignature . |
boolean |
hasXmp()
Gets a value indicating whether
PdfFormat contains XMP data. |
PdfInspectionResult |
inspectDocument()
Inspects document and return hidden data such as attachments, annotations etc.
|
boolean |
isProtected()
Gets a value indicating whether PDF document is encrypted and requires a password to open.
|
void |
removeHiddenData(PdfInspectionOptions options)
Removes the hidden data.
|
void |
removeXmpData()
Removes all XMP data.
|
boolean |
setXmpData(XmpPacketWrapper package_)
Updates XMP packet.
|
clearBuiltInProperties, clearCustomProperties, extractDocumentProperties, getDocumentInfo, getThumbnail, readDocumentPropertyByKey, readPropertyByName, readThumbnail, setProperties
close, dispose, getMetadata, getMIMEType, readByMetadataKey, save, save, save
public PdfFormat(String fileName)
Initializes a new instance of the PdfFormat
class.
fileName
- The absolute path to the file.public PdfFormat(String fileName, LoadOptions loadOptions)
Initializes a new instance of the PdfFormat
class.
fileName
- The absolute path to the file.loadOptions
- Additional options to use when loading the document.public PdfFormat(InputStream input)
Initializes a new instance of the PdfFormat
class.
input
- The stream containing the file.public PdfFormat(InputStream input, LoadOptions loadOptions)
Initializes a new instance of the PdfFormat
class.
input
- The stream containing the file.loadOptions
- Additional options to use when loading the document.public int getType()
Gets document type.
getType
in class FormatBase
public final String getVersion()
Gets PDF version. Read-only property.
public PdfMetadata getDocumentProperties()
Gets the document properties in PdfFormat
.
getDocumentProperties
in class DocumentFormat<PdfMetadata,PdfMetadataProperty,DocumentInfo>
public final boolean hasDigitalSignatures()
Gets a value indicating whether document contains DigitalSignature
.
hasDigitalSignatures
in interface ISignedFormat
true
if document has digital signatures; otherwise, false
.GroupDocsException
- Could not read digital signatures.
Value:
true
if document has digital signatures; otherwise, false
.public int getFileType()
Gets file type.
getFileType
in class DocumentFormat<PdfMetadata,PdfMetadataProperty,DocumentInfo>
public final boolean isProtected()
Gets a value indicating whether PDF document is encrypted and requires a password to open.
isProtected
in interface IProtectableFormat
true
if PDF is protected; otherwise, false
.public final boolean hasXmp()
Gets a value indicating whether PdfFormat
contains XMP data.
public final XmpEditableCollection getXmpValues()
Gets XmpEditableCollection
. Provides access for all XMP properties in edit mode.
getXmpValues
in interface IXmp
public final XmpPacketWrapper getXmpData()
Returns the XMP packet.
getXmpData
in interface IXmp
XmpPacketWrapper
if XMP data is presented; otherwise null.public final XmpProperties getXmpProperties()
Returns all XMP properties presented in PDF document.
getXmpProperties
in interface IXmp
XmpProperties
if XMP data is presented; otherwise null.public final boolean setXmpData(XmpPacketWrapper package_)
Updates XMP packet.
setXmpData
in interface IXmp
package
- XMP packet wrapper.true
if the XMP is successfully updated; otherwise false.ArgumentNullException
- Xmp packet could not be null.public final void removeXmpData()
Removes all XMP data.
removeXmpData
in interface IXmp
public final DublinCoreMetadata getDublinCore()
Gets Dublin Core metadata.
getDublinCore
in interface IDublinCore
DublinCoreMetadata
if Dublin Core metadata is presented; otherwise null.
public void cleanMetadata()
Remove custom metadata and reset built-in properties like PdfMetadata.CreatedDate
.
cleanMetadata
in class FormatBase
public final PdfInspectionResult inspectDocument()
Inspects document and return hidden data such as attachments, annotations etc.
inspectDocument
in interface IInspectable<PdfInspectionResult,PdfInspectionOptions>
PdfInspectionResult
.
public final void removeHiddenData(PdfInspectionOptions options)
Removes the hidden data.
removeHiddenData
in interface IInspectable<PdfInspectionResult,PdfInspectionOptions>
options
- The options.ArgumentNullException
- Inspection options could not be null.protected void dispose(boolean disposing)
Releases unmanaged and optionally managed resources.
dispose
in class FormatBase
disposing
- true
to release both managed and unmanaged resources;
false
to release only unmanaged resources.Copyright © 2019. All rights reserved.