PSPDFDocumentDelegate

@protocol PSPDFDocumentDelegate <NSObject>

Delegate to receive events regarding PSPDFDocument.

  • Allow resolving custom path tokens (Documents, Bundle are automatically resolved; you can add e.g. Book and resolve this here). Will only get called for unknown tokens.

    Declaration

    Objective-C

    - (nonnull NSString *)pdfDocument:(nonnull PSPDFDocument *)document
        resolveCustomAnnotationPathToken:(nonnull NSString *)pathToken;

    Swift

    optional func pdfDocument(_ document: PSPDFDocument, resolveCustomAnnotationPathToken pathToken: String) -> String
  • Called after saving was successful. If document wasn’t modified, delegates will not be called. - warning: Might be called from a background thread.

    Declaration

    Objective-C

    - (void)pdfDocumentDidSave:(nonnull PSPDFDocument *)document;

    Swift

    optional func pdfDocumentDidSave(_ document: PSPDFDocument)
  • Called after saving failed. - warning: Might be called from a background thread.

    Declaration

    Objective-C

    - (void)pdfDocument:(nonnull PSPDFDocument *)document
        saveDidFailWithError:(nonnull NSError *)error;

    Swift

    optional func pdfDocument(_ document: PSPDFDocument, saveDidFailWithError error: Error)