Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146738 | Aug 16,2019 01:59 PM UTC | Aug 23,2019 01:22 PM UTC | WinForms | 5 |
![]() |
Tags: PDF |
//Load the existing PDF document.
PdfLoadedDocument pdfLoadedDocument = new PdfLoadedDocument(@"input.pdf");
//Get all the document properties.
PropertyInfo[] documentProperties = pdfLoadedDocument.GetType().GetProperties(BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.Public);
foreach (PropertyInfo property in documentProperties)
{
//Get the PDF Catalog object
if (property.Name == "Catalog")
{
//Get PdfCatalog
object catalogProps = property.GetValue(pdfLoadedDocument, null);
//Get all the catalog properties.
PropertyInfo[] catalogProperties = catalogProps.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
foreach (PropertyInfo prop in catalogProperties)
{
//Get the items property.
if (prop.Name == "Items")
{
//Get Items.
IDictionary ss = prop.GetValue(catalogProps, null) as IDictionary;
foreach (var key in ss.Keys)
{
//Catalog dictionary values.
object value = ss[key];
}
break;
}
}
break;
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.