PTAddPagesManager
@interface PTAddPagesManager
: NSObject <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.
-
Returns a new instance of a
PTAddPagesManager
.Declaration
Objective-C
- (nonnull instancetype)initWithToolManager: (nonnull PTToolManager *)toolManager;
Swift
init(toolManager: PTToolManager)
Parameters
toolManager
the
PTToolManager
associated 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
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.
Declaration
Objective-C
@property (nonatomic) int pageNumber;
Swift
var pageNumber: Int32 { 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.