PdfFileInfo

Overview

PdfFileInfo is a class in Aspose.Pdf FOSS for Java. Inherits from: Closeable.

Provides read-only access to PDF document metadata and properties such as title, author, page count, and encryption status.

Properties

NameTypeAccessDescription
documentDocumentReadReturns the bound document, or {@code null}.
titleStringReadReturns the document title.
authorStringReadReturns the document author.
subjectStringReadReturns the document subject.
keywordsStringReadReturns the document keywords.
creatorStringReadReturns the document creator application.
producerStringReadReturns the PDF producer.
creationDateDateReadReturns the document creation date.
modDateDateReadReturns the document modification date.
encryptedbooleanReadReturns whether the document is encrypted.
pdfFilebooleanReadReturns whether the bound file is a valid PDF.
passwordTypePasswordTypeReadReturns the role of the password used to open the document.
numberOfPagesintReadReturns the total number of pages.
documentPrivilegeDocumentPrivilegeReadReturns document permissions as a facade-compatible privilege object.

Methods

SignatureDescription
PdfFileInfo()Creates a new empty {@code PdfFileInfo} instance.
PdfFileInfo(inputFile: String)Creates a {@code PdfFileInfo} by opening the specified PDF file.
PdfFileInfo(inputFile: String, password: String)Creates a {@code PdfFileInfo} by opening the specified encrypted PDF file
using the provided password.
PdfFileInfo(inputFile: String, password: String, customHandler: ICustomSecurityHandler)Creates a {@code PdfFileInfo} for an encrypted PDF using a custom security handler.
PdfFileInfo(stream: InputStream)Creates a {@code PdfFileInfo} by reading from the specified input stream.
PdfFileInfo(stream: InputStream, password: String)Creates a {@code PdfFileInfo} by reading from the specified encrypted input
stream using the provided password.
PdfFileInfo(stream: InputStream, password: String, customHandler: ICustomSecurityHandler)Creates a {@code PdfFileInfo} by reading an encrypted input stream using
a custom security handler.
PdfFileInfo(document: Document)Creates a {@code PdfFileInfo} bound to an already-loaded document.
getDocument()DocumentReturns the bound document, or {@code null}.
bindPdf(document: Document)booleanBinds an already opened document instance to this info reader.
bindPdf(inputFile: String)booleanBinds a PDF file to this info reader.
bindPdf(inputFile: String, password: String)booleanBinds an encrypted PDF file to this info reader using the provided
password.
bindPdf(inputStream: InputStream)booleanBinds a PDF from an input stream.
bindPdf(inputStream: InputStream, password: String)booleanBinds an encrypted PDF from an input stream using the provided password.
bindPdf(inputFile: String, password: String, customHandler: ICustomSecurityHandler)booleanBinds an encrypted PDF file using a custom security handler.
bindPdf(inputStream: InputStream, password: String, customHandler: ICustomSecurityHandler)booleanBinds an encrypted PDF stream using a custom security handler.
getTitle()StringReturns the document title.
getAuthor()StringReturns the document author.
getSubject()StringReturns the document subject.
getKeywords()StringReturns the document keywords.
getCreator()StringReturns the document creator application.
getProducer()StringReturns the PDF producer.
getCreationDate()DateReturns the document creation date.
getModDate()DateReturns the document modification date.
isEncrypted()booleanReturns whether the document is encrypted.
isPdfFile()booleanReturns whether the bound file is a valid PDF.
hasOpenPassword()booleanReturns whether the encrypted document has an open password entry.
hasEditPassword()booleanReturns whether the encrypted document has an edit password entry.
getPasswordType()PasswordTypeReturns the role of the password used to open the document.
getNumberOfPages()intReturns the total number of pages.
getPageWidth(pageNumber: int)doubleReturns the page width in points (1/72 inch) for the given 1-based page
number, taken from the page’s MediaBox.
getPageHeight(pageNumber: int)doubleReturns the page height in points (1/72 inch) for the given 1-based page
number, taken from the page’s MediaBox.
getDocumentPrivilege()DocumentPrivilegeReturns document permissions as a facade-compatible privilege object.
setMetaInfo(name: String, value: String)Adds (or overwrites) a custom entry in the document’s /Info dictionary.
saveNewInfo(outputFile: String)booleanSaves the bound document — together with any {@link #setMetaInfo} edits —
to {@code outputFile}.
saveNewInfo(outputStream: OutputStream)booleanStream variant of {@link #saveNewInfo(String)}.
clearInfo()Clears the standard document metadata entries from the bound document.
close()Closes this info reader and releases the bound document.

See Also