0

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];


}
PREMKUMAR
  • 8,283
  • 8
  • 28
  • 51

1 Answers1

0

The code you posted does not use the PSPDFKit PDF SDK. You load a file into memory, build another file path and store the loaded file into that path.

I'm happy to take a closer look and help you debug this issue if you share the PSPDFKit API code you use to create the file.

As additional data point, you can also compare loading a PDF via iOS Safari, which uses the Apple internal renderer, and then compare it with PDF Viewer by PSPDFKit, our free app available for iOS and Android which includes our own proprietary render engine.

PSPDFKit is a commercial SDK for annotating documents, filling out forms and also for creating PDF documents. We offer commercial support for customer both evaluating a license and for license owners. Please report your ticket to our support page - Thanks!

Note: As we are available on iOS, Android, Web, Web Standalone, macOS and Windows, please also detail on which platform and via what version you created the document - lots of combinations and we want to help you effectively.

Edit: Thanks for adding the code and for submitting the same to our support. This is an issue related to Third-Party Compatibility, it will work using compliant PDF renderers such as Adobe Acrobat.

steipete
  • 7,581
  • 5
  • 47
  • 81