PdfFileInfo

Overview

PdfFileInfo is a class in Aspose.PDF FOSS for .NET. Inherits from: IDisposable.

Facade for accessing PDF document metadata and properties.

This class provides 34 methods for working with PdfFileInfo objects in .NET programs. Available methods include: BindPdf, ClearInfo, Close, Dispose, GetDocumentInfo, GetDocumentPrivilege, GetMetaInfo, GetPageHeight, GetPageRotation, GetPageWidth, GetPageXOffset, GetPageYOffset, and 8 additional methods. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Author, CreationDate, CreationDateValue, Creator, Document, HasCollection, and 26 more.

Properties

NameTypeAccessDescription
DocumentDocument?ReadThe bound Document.
InputFilestring?Read/WritePath of the source PDF.
HasOpenPasswordboolReadWhether the PDF requires a user/open password to open.
HasEditPasswordboolReadWhether the PDF has an owner/edit password (i.e.
PasswordTypePasswordTypeReadWhich kind of password (if any) authenticated the bound PDF.
Titlestring?Read/WriteThe document title.
Authorstring?Read/WriteThe document author.
Subjectstring?Read/WriteThe document subject.
Keywordsstring?Read/WriteThe document keywords.
Creatorstring?Read/WriteThe creator application.
Producerstring?ReadThe producer application that created the PDF.
HeaderDictionary<string, string>Read/WriteCustom metadata entries from the underlying /Info dictionary, keyed by name.
CreationDatestringRead/WriteThe creation date in PDF native format (D:YYYYMMDDHHmmSSOHH’mm’), or empty when absent.
CreationDateValueDateTimeRead/WriteRaw DateTime view of CreationDate (convenience accessor).
ModDatestringRead/WriteThe modification date in PDF native format (D:YYYYMMDDHHmmSSOHH’mm’), or empty when absent.
ModDateValueDateTimeRead/WriteRaw DateTime view of ModDate (convenience accessor).
NumberOfPagesintReadNumber of pages.
PdfVersionstring?ReadThe PDF version string (e.g., “1.4”, “1.7”).
IsEncryptedboolReadWhether the document is encrypted.
HasFormboolReadWhether the document has a form.
HasOutlinesboolReadWhether the document has bookmarks.
HasMetadataboolReadWhether the document has XMP metadata.
HasEmbeddedFilesboolReadWhether the document has embedded files.
HasPageLabelsboolReadWhether the document has page labels.
HasLayersboolReadWhether the document has layers (optional content).
HasCollectionboolReadWhether the document is a PDF Portfolio (has a /Collection entry in the catalog).
IsTaggedboolReadWhether the document is tagged.
PageLayoutstring?ReadThe page layout mode (e.g., “SinglePage”, “TwoColumnLeft”).
PageModestring?ReadThe page mode (e.g., “UseOutlines”, “FullScreen”).
IsPdfFileboolReadWhether the bound document is a valid PDF file (instance property).
InputStreamStream?Read/WriteSource-PDF stream.
UseStrictValidationboolRead/WriteWhen true, the parser applies strict PDF validation rules.

Methods

SignatureDescription
PdfFileInfo()Create an empty PdfFileInfo instance.
PdfFileInfo(document: Document)Create a PdfFileInfo instance wrapping an existing Document.
PdfFileInfo(input: byte[])Create a PdfFileInfo instance from PDF bytes.
PdfFileInfo(input: byte[], password: string)Create a PdfFileInfo instance from PDF bytes with a password.
PdfFileInfo(inputFile: string)Create a PdfFileInfo instance from a file path.
PdfFileInfo(inputFile: string, password: string)Create a PdfFileInfo instance from a file path with a password.
PdfFileInfo(inputStream: Stream)Create a PdfFileInfo instance from a stream.
PdfFileInfo(inputStream: Stream, password: string)Open from a stream with a password.
PdfFileInfo(inputStream: Stream, password: string, customSecurityHandler: Aspose.Pdf.Security.ICustomSecurityHandler)Open from a stream with a password and a custom security handler.
PdfFileInfo(inputFile: string, password: string, customSecurityHandler: Aspose.Pdf.Security.ICustomSecurityHandler)Open from a file path with a password and a custom security handler.
SaveNewInfo()Save the modified info to a new PDF file.
SaveNewInfoWithXmp()Save the modified info to a new PDF file, synchronizing Info dict entries to XMP metadata.
SaveNewInfoWithXmp(outputFileName: string)Save the modified info to a file, synchronizing Info dict entries to XMP metadata.
SetMetaInfo(name: string, value: string)Set a custom metadata property in the document info dictionary.
GetMetaInfo(name: string)Get a custom metadata property from the document info dictionary.
GetPdfVersion()Method-form alias of PdfVersion.
GetPageWidth(pageNum: int)Get the width of a specific page in points (1-based page number).
GetPageHeight(pageNum: int)Get the height of a specific page in points (1-based page number).
GetPageRotation(pageNum: int)Get the rotation of a specific page (0, 90, 180, 270).
GetPageXOffset(pageNum: int)X coordinate of the page’s origin within the page boundary.
GetPageYOffset(pageNum: int)Y coordinate of the page’s origin within the page boundary.
GetDocumentInfo()Get all document metadata as a dictionary.
IsValidPdfBytes(data: byte[])Check if the given bytes represent a valid PDF file.
IsValidPdfStream(stream: Stream)Check if the given stream represents a valid PDF file.
GetDocumentPrivilege()Get the document privileges (permissions).
BindPdf(srcDoc: Document)Bind this facade to an existing Document instance.
ClearInfo()Clears the standard /Info dictionary entries (Title, Author, Subject, Keywords, Creator, Producer, Trapped, CreationDate, ModDate) on the bound document.
BindPdf(path: string)Bind this facade to a PDF file at the given path.
Save(destStream: Stream)Save the bound document to a stream.
Save(destFile: string)Save the bound document to a file path.
Close()Close and release the bound document.
SaveNewInfo(outputStream: Stream)Save the modified Info dictionary to a stream.
SaveNewInfo(outputFile: string)Save the modified Info dictionary to a file.
Dispose()Calls Dispose on this PdfFileInfo instance.

See Also