PSPDFProcessorDelegate

@protocol PSPDFProcessorDelegate <NSObject>

The type implementing this protocol can receive updates from a PSPDFProcessor.

  • Notifies the delegate that a page has completed processing.

    Declaration

    Objective-C

    - (void)processor:(nonnull PSPDFProcessor *)processor
        didProcessPage:(NSUInteger)currentPage
            totalPages:(NSUInteger)totalPages;

    Swift

    optional func processor(_ processor: PSPDFProcessor, didProcessPage currentPage: UInt, totalPages: UInt)

    Parameters

    processor

    The PSPDFProcessor instance that’s notifying the delegate.

    currentPage

    An unsigned integer representing the page that just completed processing.

    totalPages

    The total number of pages that the PSPDFProcessor needs to process.

  • Notifies the delegate that the processor has finished processing the document.

    Declaration

    Objective-C

    - (void)processor:(nonnull PSPDFProcessor *)processor
        didFinishWithError:(nullable NSError *)error;

    Parameters

    processor

    The PSPDFProcessor instance.

    error

    The error that was generated during the PDF generation operation. Can be nil.

  • Notifies the delegate that a request to cancel documents currently being processed has been received.

    Note

    This method being called does not necesarily mean that the processing itself has stopped altogether, but that the cancellation has been requested and will happen sometime in the future.

    Declaration

    Objective-C

    - (void)processorCancelled:(nonnull PSPDFProcessor *)processor;

    Swift

    optional func processorCancelled(_ processor: PSPDFProcessor)

    Parameters

    processor

    The PSPDFProcessor instance.

  • Notifies the delegate that the processor has completed the PDF generation, and passes the generated data (if any) and the genrated error (if any).

    Declaration

    Objective-C

    - (void)processor:(nonnull PSPDFProcessor *)processor
        didFinishWithData:(nullable NSData *)data
                    error:(nullable NSError *)error;

    Swift

    optional func processor(_ processor: PSPDFProcessor, didFinishWith data: Data?, error: Error?)

    Parameters

    processor

    The PSPDFProcessor instance.

    data

    The PDF data that was generated. It is nil if the processor couldn’t generate the data correctly or there was an error during the operation. Can be nil.

    error

    The error that was generated during the operation. Can be nil.

  • Notifies the delegate that the processor has completed the PDF generation, and passes the URL to which the PDF was written (if there was no error during the operation), and the genrated error (if any).

    Declaration

    Objective-C

    - (void)processor:(nonnull PSPDFProcessor *)processor
        didFinishWithFileURL:(nullable NSURL *)fileURL
                       error:(nullable NSError *)error;

    Swift

    optional func processor(_ processor: PSPDFProcessor, didFinishWithFileURL fileURL: URL?, error: Error?)

    Parameters

    processor

    The PSPDFProcessor instance.

    fileURL

    The URL to which the generated PDF was saved if the operation was successful.

    error

    The error that was generated during the operation. Can be nil.