PTAddPagesManager
@interface PTAddPagesManager
: NSObject <PTOverridable, UIImagePickerControllerDelegate,
UINavigationControllerDelegate, UIDocumentPickerDelegate,
VNDocumentCameraViewControllerDelegate,
PTPageTemplateViewControllerDelegate>
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.
-
Returns a new instance of a
PTAddPagesManager.Declaration
Objective-C
- (nonnull instancetype)initWithToolManager: (nonnull PTToolManager *)toolManager;Swift
init(toolManager: PTToolManager)Parameters
toolManagerthe
PTToolManagerassociated with the manager. -
The tool manager used by this view.
Declaration
Objective-C
@property (nonatomic, strong, readonly) PTToolManager *_Nonnull toolManager;Swift
var toolManager: PTToolManager { get }
-
Shows a
PTPageTemplateViewControllerfor adding blank pages to the document.Declaration
Objective-C
- (void)showPageTemplateViewController;Swift
func showPageTemplateViewController() -
Shows a
UIImagePickerControllerto 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
UIDocumentPickerViewControllerto 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
UIViewControllerwhich 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
UIBarButtonItemused 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
PTPDFDocwith 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) -> PTPDFDocParameters
pageTemplateThe
PTPageTemplateStyleto use as a template.pageSizeThe size in inches of the document.
backgroundColorThe background color of the document.
pageCountThe number of pages to create.
portraitWhether or not the page layout should be in portrait.
-
Adds all the pages from the source document to the document associated with the
PDFViewCtrllinked to thePTToolManager.Declaration
Objective-C
- (void)addPagesFromDoc:(nonnull PTPDFDoc *)srcDoc afterPageNumber:(int)pageNumber;Swift
func addPages(from srcDoc: PTPDFDoc, afterPageNumber pageNumber: Int32)Parameters
srcDocThe document containing the pages to add to the document.
pageNumberThe page number of the destination document after which to insert the pages.
-
This is called after pages have been added to the document associated with the
PDFViewCtrllinked to thePTToolManager.Declaration
Objective-C
- (void)didAddPagesForPageNumbers:(nonnull NSIndexSet *)pageNumbers afterPageNumber:(int)pageNumber;Swift
func didAddPages(forPageNumbers pageNumbers: IndexSet, afterPageNumber pageNumber: Int32)Parameters
pageNumbersThe page numbers which were inserted to the document.
pageNumberThe page number of the destination document after which the pages were inserted.
-
Undocumented
Declaration
Objective-C
- (instancetype)init PT_UNAVAILABLE; -
Undocumented
Declaration
Objective-C
- (instancetype)initWithCoder:(NSCoder *)aDecoder PT_UNAVAILABLE;
PTAddPagesManager Class Reference