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;
}
RadaeePDF SDK for iOS
Created : 2018-04-19 15:41:18, Last Modified : 2018-04-19 15:41:24