PTAddPagesManager


@interface PTAddPagesManager
    : NSObject <PTOverridable, UIImagePickerControllerDelegate,
                UINavigationControllerDelegate, UIDocumentPickerDelegate,
                VNDocumentCameraViewControllerDelegate>

An object that manages the controls for adding new pages to a document. New pages can be created from blank page templates (e.g. lined, grid, dotted), added from other documents, or created from images.

  • Shows a PTPageTemplateViewController for adding blank pages to the document.

    Declaration

    Objective-C

    - (void)showPageTemplateViewController;

    Swift

    func showPageTemplateViewController()
  • Shows a UIImagePickerController to insert an image as a page into the document.

    Declaration

    Objective-C

    - (void)showImagePickerController;

    Swift

    func showImagePickerController()
  • Shows the camera to take a photo to add as a page into the document.

    Declaration

    Objective-C

    - (void)showCamera;

    Swift

    func showCamera()
  • Shows the camera to scan a photo to add as a page into the document.

    Declaration

    Objective-C

    - (void)showScanner;

    Swift

    func showScanner()
  • Shows a UIDocumentPickerViewController to insert pages from another document into the current document.

    Declaration

    Objective-C

    - (void)showDocumentPickerViewController;

    Swift

    func showDocumentPickerViewController()
  • The page number after which the manager will insert new pages.

    If this value is negative then the viewer’s current page number will be used (default behavior). If this value exceeds the number of pages in the document then the pages will be inserted at the end of the document.

    Declaration

    Objective-C

    @property (nonatomic) int pageNumber;

    Swift

    var pageNumber: Int32 { get set }
  • Whether or not the page number selection dialog is shown when adding pages.

    Defaults to YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL showsPageNumberDialog;

    Swift

    var showsPageNumberDialog: Bool { get set }
  • The UIViewController which will be used to present the manager’s UI controls.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) UIViewController *presentingViewController;

    Swift

    weak var presentingViewController: UIViewController? { get set }
  • The UIBarButtonItem used when a popover presentation is required.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) UIBarButtonItem *barButtonItem;

    Swift

    weak var barButtonItem: UIBarButtonItem? { get set }
  • The source view used when a popover presentation is required.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) UIView *sourceView;

    Swift

    weak var sourceView: UIView? { get set }
  • The default white page background color

    Declaration

    Objective-C

    @property (class, nonatomic, strong, readonly) UIColor *_Nonnull whitePageColor;

    Swift

    class var whitePageColor: UIColor { get }
  • The default yellow page background color

    Declaration

    Objective-C

    @property (class, nonatomic, strong, readonly) UIColor *_Nonnull yellowPageColor;

    Swift

    class var yellowPageColor: UIColor { get }
  • The default blueprint page background color

    Declaration

    Objective-C

    @property (class, nonatomic, strong, readonly) UIColor *_Nonnull blueprintPageColor;

    Swift

    class var blueprintPageColor: UIColor { get }
  • Creates a new PTPDFDoc with the specified parameters.

    Declaration

    Objective-C

    + (nonnull PTPDFDoc *)createDocWithTemplate:(PTPageTemplateStyle)pageTemplate
                                       pageSize:(CGSize)pageSize
                                backgroundColor:(nonnull UIColor *)backgroundColor
                                      pageCount:(int)pageCount
                                       portrait:(BOOL)portrait;

    Swift

    class func createDoc(withTemplate pageTemplate: PTPageTemplateStyle, pageSize: CGSize, backgroundColor: UIColor, pageCount: Int32, portrait: Bool) -> PTPDFDoc

    Parameters

    pageTemplate

    The PTPageTemplateStyle to use as a template.

    pageSize

    The size in inches of the document.

    backgroundColor

    The background color of the document.

    pageCount

    The number of pages to create.

    portrait

    Whether or not the page layout should be in portrait.

  • Adds all the pages from the source document to the document associated with the PDFViewCtrl linked to the PTToolManager.

    Declaration

    Objective-C

    - (void)addPagesFromDoc:(nonnull PTPDFDoc *)srcDoc
            afterPageNumber:(int)pageNumber;

    Swift

    func addPages(from srcDoc: PTPDFDoc, afterPageNumber pageNumber: Int32)

    Parameters

    srcDoc

    The document containing the pages to add to the document.

    pageNumber

    The page number of the destination document after which to insert the pages.

  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init PT_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithCoder:(NSCoder *)aDecoder PT_UNAVAILABLE;