Using PSPDFkit 7.0 version and I created PDF file.
This files are working perfectly in all browsers and PDF viewer applications. But one problem is IOS Device browsers safari,Chrome and Firefox is not showing this documents. Its showing empty document.
But when i open this pdf in iBook,File browsers and other PDF viewer applications its working perfectly.
My code as follows:
- (void)pdfDocumentDidSave:(PSPDFDocument *)document {
NSLog(@"Successfully saved document.");
//Get path directory
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
//Create PDF_Documents directory
documentsDirectory = [documentsDirectory stringByAppendingPathComponent:@"PDF_Documents"];
[[NSFileManager defaultManager] createDirectoryAtPath:documentsDirectory withIntermediateDirectories:YES attributes:nil error:nil];
NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"hello123.pdf"];
// Create default configuration
PSPDFProcessorConfiguration *configuration = [[PSPDFProcessorConfiguration alloc] initWithDocument:document];
[configuration modifyAnnotationsOfTypes:PSPDFAnnotationTypeAll change:PSPDFAnnotationChangeEmbed];
// Start the conversion from `document` to `scaledDocumentURL`
[PSPDFProcessor generatePDFFromConfiguration:configuration securityOptions:nil outputFileURL:[NSURL URLWithString:filePath] progressBlock:nil error:NULL];
}