Knowledge Base - Get OpenAction metadata using Advanced properties (Windows)

Using the Advanced properties, you can get the initial View mode (managed by Acrobat) from metadata, check the below code:

Note: a premium license is needed.

 

String viewMode = "Fit";
PDFRef pdfRef = m_doc.Advance_GetRef();                   
PDFObj rootObj = m_doc.Advance_GetObj(pdfRef);
if (rootObj != null)
{
         int count = rootObj.DictGetItemCount();
         for (int cur = 0; cur < count; cur++)
         {
                String tag = rootObj.DictGetItemTag(cur);
                PDFObj item = rootObj.DictGetItem(cur);
                if (tag.Equals("OpenAction") && item.type == 8)
                {
                      rootObj = m_doc.Advance_GetObj(item.RefVal);
                      if (rootObj.DictGetItemCount() > 0 && rootObj.DictGetItem(0).type == 6)
                      {
                            item = rootObj.DictGetItem(0);
                            int arrayCount = item.ArrayGetItemCount();
                            if (arrayCount > 1)
                            {
                                  viewMode = item.ArrayGetItem(1).NameVal;
                                  break;
                            }
                       }
                 }
          }
}   
Applies To

RadaeePDF SDK for Windows 10

Related Articles

Get OpenAction metadata using Advanced properties

Details

Created : 2018-04-18 14:28:04, Last Modified : 2018-04-18 14:29:12