PTPrintPrepareDocumentHandler


@interface PTPrintPrepareDocumentHandler : NSObject

A utility class that handles preparing PDF documents for printing.

  • Initializes a new PTPrintPrepareDocumentHandler instance with a source document.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithSourcePDFDoc:(nonnull PTPDFDoc *)sourcePDFDoc;

    Swift

    init(sourcePDFDoc: PTPDFDoc)

    Parameters

    sourcePDFDoc

    The PDF document to be prepared.

    Return Value

    An initialized PTPrintPrepareDocumentHandler instance.

  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    + (instancetype)new NS_UNAVAILABLE;
  • The PDF document to be prepared.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) PTPDFDoc *_Nonnull sourcePDFDoc;

    Swift

    var sourcePDFDoc: PTPDFDoc { get }
  • The OCG context specifying the content to be printed.

    Note

    The default value of this property is nil.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) PTContext *context;

    Swift

    var context: PTContext? { get set }
  • Starts a new preparation operation with the current settings.

    Declaration

    Objective-C

    - (void)prepareWithCompletionHandler:
        (nonnull void (^)(PTPDFDoc *_Nullable,
                          NSError *_Nullable))completionHandler;

    Swift

    func prepare() async throws -> PTPDFDoc

    Parameters

    completionHandler

    The block to be called when the operation finishes. The outputPDFDoc parameter contains the prepared output PDF document, or nil if an error occurred and the error parameter provides the detailed error information.

  • Cancels any ongoing preparation operations.

    Declaration

    Objective-C

    - (void)cancel;

    Swift

    func cancel()