public final class PdfFormat extends DocumentFormat<PdfMetadata,PdfMetadataProperty,DocumentInfo> implements IXmp, IInspectable<PdfInspectionResult,PdfInspectionOptions>, IProtectableFormat, ISignedFormat
Represents PDF format.
filePath, stream
Constructor and Description |
---|
PdfFormat(InputStream input)
Initializes a new instance of the
PdfFormat class. |
PdfFormat(String fileName)
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 . |
void |
clearCustomProperties()
Removes all custom document properties in
PdfFormat . |
PdfMetadata |
getDocumentProperties()
Gets the document properties in
PdfFormat . |
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
true if document contains DigitalSignature . |
boolean |
hasXmp()
Gets true if
PdfFormat contains XMP data. |
PdfInspectionResult |
inspectDocument()
Inspects document and return hidden data such as attachments, annotations etc.
|
boolean |
isProtected()
Returns true if the 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, extractDocumentProperties, getDocumentInfo, getThumbnail, readDocumentPropertyByKey, readPropertyByName, setProperties
dispose, getMetadata, getMIMEType, readByMetadataKey, save, save, save
public PdfFormat(String fileName)
Initializes a new instance of the PdfFormat
class.
fileName
- Absolute path to the file.public PdfFormat(InputStream input)
Initializes a new instance of the PdfFormat
class.
input
- File stream.public int getType()
Gets document type.
Value: Document type.getType
in class FormatBase
public final String getVersion()
Gets PDF version. Read-only property.
Value: PDF version.public PdfMetadata getDocumentProperties()
Gets the document properties in PdfFormat
.
getDocumentProperties
in class DocumentFormat<PdfMetadata,PdfMetadataProperty,DocumentInfo>
public final boolean hasDigitalSignatures()
Gets true
if document contains DigitalSignature
.
hasDigitalSignatures
in interface ISignedFormat
GroupDocsException
- Could not read digital signatures.
Value:
true
if document has digital signatures; otherwise, false
.public int getFileType()
Gets file type.
Value: The file type.getFileType
in class DocumentFormat<PdfMetadata,PdfMetadataProperty,DocumentInfo>
public final boolean isProtected()
Returns true if the PDF document is encrypted and requires a password to open.
Value: Getstrue
if PDF is protected; otherwise, false
.isProtected
in interface IProtectableFormat
public final boolean hasXmp()
Gets true if 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.com.aspose.ms.System.ArgumentNullException
- Xmp packet could not be null.public final void removeXmpData()
Removes all XMP data.
removeXmpData
in interface IXmp
public void cleanMetadata()
Remove custom metadata and reset built-in properties like PdfMetadata.CreatedDate
.
cleanMetadata
in class FormatBase
public void clearCustomProperties()
Removes all custom document properties in PdfFormat
.
clearCustomProperties
in class DocumentFormat<PdfMetadata,PdfMetadataProperty,DocumentInfo>
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.com.aspose.ms.System.ArgumentNullException
- Inspection options could not be null.Copyright © 2017. All rights reserved.