Method GetMetadata
GetMetadata(string)
Returns the metadata of a PDF file.
public static PdfMetadata GetMetadata(string inputPath)
Parameters
inputPathstringPath to the PDF file.
Returns
- PdfMetadata
A PdfMetadata instance containing the document metadata.
Examples
using LMKit.Document.Pdf;
var meta = PdfInfo.GetMetadata("report.pdf");
Console.WriteLine($"Title: {meta.Title}");
Console.WriteLine($"Author: {meta.Author}");
Console.WriteLine($"Created: {meta.CreationDate}");
Exceptions
- ArgumentNullException
Thrown when
inputPathisnull.- FileNotFoundException
Thrown when
inputPathdoes not exist.
GetMetadata(Attachment)
Returns the metadata of a PDF attachment.
public static PdfMetadata GetMetadata(Attachment source)
Parameters
sourceAttachmentThe source PDF attachment.
Returns
- PdfMetadata
A PdfMetadata instance containing the document metadata.
Exceptions
- ArgumentNullException
Thrown when
sourceisnull.- ArgumentException
Thrown when the source attachment is not a PDF.