In this code a PSPDFDocument is showing as not valid even though the file exists (and I know it's not password protected). Not sure why this would happen
+ (PSPDFDocument *)fromDocument:(Document *)doc
{
NSString * path = [doc getFilePath];
PSPDFDocument * pspdfdoc = [PSPDFDocument documentWithURL:[NSURL fileURLWithPath:path]];
pspdfdoc.document = doc;
if ([pspdfdoc isValid])
DELogVerbose(@"Valid");
else
{
DELogVerbose(@"Not Valid");
NSFileManager *fileManager = [NSFileManager defaultManager];
DELogVerbose([fileManager fileExistsAtPath:path] ? @"File exists" : @"File does not exist");
}
return pspdfdoc;
}