public final class PdfFileInfo extends SaveableFacade
Represents a class for accessing meta information of PDF document.
Constructor and Description |
---|
PdfFileInfo()
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class with default
values.
|
PdfFileInfo(IDocument document)
Initializes new
PdfFileInfo object on base of the document . |
PdfFileInfo(InputStream inputStream)
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class.
|
PdfFileInfo(InputStream inputStream,
String password)
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class.
|
PdfFileInfo(String inputFile)
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class.
|
PdfFileInfo(String inputFile,
String password)
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class.
|
Modifier and Type | Method and Description |
---|---|
void |
bindPdf(Document srcDoc)
Initializes the facade.
|
void |
bindPdf(String srcFile,
String password)
Initializes the facade.
|
void |
clearInfo()
Clears all meta information of PDF document.
|
void |
close()
Deinitializes the instance.
|
void |
dispose()
Deinitializes the instance.
|
String |
getAuthor()
Gets the Author information of PDF document.
|
String |
getCreationDate()
Gets the CreationDate information of PDF document.
|
String |
getCreator()
Gets the Creator information of PDF document.
|
DocumentPrivilege |
getDocumentPrivilege()
Gets the PDF document privilege settings.
|
Map<String,String> |
getHeader()
Gets the customized information of PDF document.
|
String |
getInputFile()
Deprecated.
|
InputStream |
getInputStream()
Deprecated.
|
String |
getKeywords()
Gets the Keywords information of PDF document.
|
String |
getMetaInfo(String name)
Gets customized information of PDF document with property name.
|
String |
getModDate()
Gets the ModDate date information of PDF document.
|
int |
getNumberOfPages()
Gets the number of document pages.
|
float |
getPageHeight(int pageNum)
Gets the height of the specified page.
|
int |
getPageRotation(int pageNum)
Gets the rotation of the specified page.
|
float |
getPageWidth(int pageNum)
Gets the width of the specified page.
|
float |
getPageXOffset(int pageNum)
Gets the horizontal offset of the specified page display area.
|
float |
getPageYOffset(int pageNum)
Gets the vertical offset of the specified page display area.
|
int |
getPasswordType()
Returns the type of password which was passed for creating PdfFileInfo instance.
|
String |
getPdfVersion()
Gets the version info of PDF document.
|
String |
getProducer()
Gets the Producer information of PDF document.
|
String |
getSubject()
Gets the Subject information of PDF document.
|
String |
getTitle()
Gets the Title information of PDF document.
|
boolean |
hasCollection()
Returns true if the current input file is a 'Portfolio' file containing collection of PDF
files in it.
|
boolean |
hasEditPassword()
Returns true if password is needed to modify permissions or document security property.
|
boolean |
hasOpenPassword()
Returns true if password is needed to open password protected pdf document.
|
boolean |
isEncrypted()
Checkes whether the PDF document is encrypted.
|
boolean |
isPdfFile()
Checkes whether the source input is a valid PDF file.
|
void |
save(OutputStream destStream)
Saves the PDF document to the specified file.
|
boolean |
saveNewInfo(OutputStream outputStream)
Deprecated.
|
boolean |
saveNewInfo(String outputFile)
Save updated PDF document into specified file.
|
boolean |
saveNewInfoWithXmp(String outputFileName)
Changes the properties specified explicitly by setting file information, other properties
remain.
|
void |
setAuthor(String value)
Sets the Author information of PDF document.
|
void |
setCreationDate(String value)
Sets the CreationDate information of PDF document.
|
void |
setCreator(String value)
Sets the Creator information of PDF document.
|
void |
setHeader(Map<String,String> value)
Sets the customized information of PDF document.
|
void |
setInputFile(String value)
Deprecated.
|
void |
setInputStream(InputStream value)
Deprecated.
|
void |
setKeywords(String value)
Sets the Keywords information of PDF document.
|
void |
setMetaInfo(String name,
String value)
Sets customized information of PDF document.
|
void |
setModDate(String value)
Sets the ModDate date information of PDF document.
|
void |
setSubject(String value)
Sets the Subject information of PDF document.
|
void |
setTitle(String value)
Sets the Title information of PDF document.
|
save
bindPdf, bindPdf, bindPdf, bindPdf, getDocument
public PdfFileInfo()
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class with default values.
public PdfFileInfo(InputStream inputStream)
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class.
inputStream
- Stream where input file is placed.public PdfFileInfo(InputStream inputStream, String password)
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class.
inputStream
- Stream where input file is placed.password
- Password for access to file.public PdfFileInfo(String inputFile)
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class.
inputFile
- Name of file containing input file.public PdfFileInfo(String inputFile, String password)
Initializes a new instance of the com.aspose.pdf.facades.PdfFileInfo class.
inputFile
- Name of file containing input file.password
- Password for access to file.public PdfFileInfo(IDocument document)
Initializes new PdfFileInfo
object on base of the document
.
document
- Pdf document.public void bindPdf(Document srcDoc)
Initializes the facade.
srcDoc
- The Document object.public String getAuthor()
Gets the Author information of PDF document.
public void setAuthor(String value)
Sets the Author information of PDF document.
value
- String valuepublic boolean isEncrypted()
Checkes whether the PDF document is encrypted.
public boolean isPdfFile()
Checkes whether the source input is a valid PDF file.
public String getCreationDate()
Gets the CreationDate information of PDF document.
public void setCreationDate(String value)
Sets the CreationDate information of PDF document.
value
- String valuepublic String getCreator()
Gets the Creator information of PDF document.
public void setCreator(String value)
Sets the Creator information of PDF document.
value
- String valuepublic boolean hasCollection()
Returns true if the current input file is a 'Portfolio' file containing collection of PDF files in it.
public Map<String,String> getHeader()
Gets the customized information of PDF document.
Map<String, String>
objectpublic void setHeader(Map<String,String> value)
Sets the customized information of PDF document.
value
- Map<String, String>
object@Deprecated public String getInputFile()
Gets the input file.
@Deprecated public void setInputFile(String value)
Sets the input file.
value
- String value@Deprecated public InputStream getInputStream()
Gets the input stream.
@Deprecated public void setInputStream(InputStream value)
Sets the input stream.
value
- InputStream objectpublic String getKeywords()
Gets the Keywords information of PDF document.
public void setKeywords(String value)
Sets the Keywords information of PDF document.
value
- String valuepublic String getModDate()
Gets the ModDate date information of PDF document.
public void setModDate(String value)
Sets the ModDate date information of PDF document.
value
- String valuepublic int getNumberOfPages()
Gets the number of document pages.
public String getProducer()
Gets the Producer information of PDF document.
public String getSubject()
Gets the Subject information of PDF document.
public void setSubject(String value)
Sets the Subject information of PDF document.
value
- String valuepublic String getTitle()
Gets the Title information of PDF document.
public void setTitle(String value)
Sets the Title information of PDF document.
value
- String valuepublic void clearInfo()
Clears all meta information of PDF document.
public DocumentPrivilege getDocumentPrivilege()
Gets the PDF document privilege settings.
public String getMetaInfo(String name)
Gets customized information of PDF document with property name. If there is no property match the name it will return a blank string.
name
- Custom meta property key.public float getPageHeight(int pageNum)
Gets the height of the specified page.
pageNum
- Page number.public int getPageRotation(int pageNum)
Gets the rotation of the specified page.
pageNum
- Page number.public float getPageWidth(int pageNum)
Gets the width of the specified page.
pageNum
- Page number.public float getPageXOffset(int pageNum)
Gets the horizontal offset of the specified page display area.
pageNum
- Page number.public float getPageYOffset(int pageNum)
Gets the vertical offset of the specified page display area.
pageNum
- Page number.public String getPdfVersion()
Gets the version info of PDF document.
@Deprecated public boolean saveNewInfo(OutputStream outputStream)
Save updated PDF document into specified stream.
outputStream
- Output stream.public boolean saveNewInfo(String outputFile)
Save updated PDF document into specified file.
outputFile
- Output file.public void save(OutputStream destStream)
Saves the PDF document to the specified file.
save
in interface ISaveableFacade
save
in class SaveableFacade
destStream
- The destination stream.public void setMetaInfo(String name, String value)
Sets customized information of PDF document.
name
- Custom meta property key.value
- Custom meta property value.public boolean saveNewInfoWithXmp(String outputFileName)
Changes the properties specified explicitly by setting file information, other properties remain.
outputFileName
- Output file.public int getPasswordType()
Returns the type of password which was passed for creating PdfFileInfo instance. See possible
values in PasswordType
. Pay attention that pdf document can be opened using both user
(or open) password and owner (or permissions, edit) password.
PasswordType
public boolean hasOpenPassword()
Returns true if password is needed to open password protected pdf document.
public boolean hasEditPassword()
Returns true if password is needed to modify permissions or document security property. Pay
attention that this property can be read only if valid password was provided in
PdfFileInfo
constructor. In case PasswordType is Inaccessible (means that invalid
password was provided) reading this property will fail with InvalidPasswordException
.
public void close()
Deinitializes the instance.