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

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.

-(BOOL)existOpenActionInDoc:(PDFDoc *)m_doc

{

    NSString *viewMode = @"Fit";

    PDFObj *rootObj = [m_doc advanceGetObj:[m_doc advanceGetRef]];

    if (rootObj!=nil)

    {

        int count = [rootObj dictGetItemCount];

        for (int cur = 0; cur<count; cur++) {

            NSString *tag = [rootObj dictGetItemTag:cur];

            PDFObj *item = [rootObj dictGetItemByIndex:cur];

            if ([tag isEqualToString:@"OpenAction"] && item.getType == 8)

            {

                rootObj = [m_doc advanceGetObj:[item getReferenceVal]];

                if ([rootObj dictGetItemCount] > 0 && [[rootObj dictGetItemByIndex:0] getType] == 6)

                {

                    item = [rootObj dictGetItemByIndex:0];

                    int arrayCount = [item arrayGetItemCount];

                    if (arrayCount > 1)

                    {

                        viewMode = [[item arrayGetItem:1] getNameVal];

                        NSLog(@"%@", viewMode);

                        return YES;

                    }

                }

            }

        }

    }

    return NO;

}
Applies To

RadaeePDF SDK for iOS

Details

Created : 2018-04-19 15:41:18, Last Modified : 2018-04-19 15:41:24