PSPDFNewPageConfiguration


@interface PSPDFNewPageConfiguration : NSObject

This class configures a new page for the PSPDFProcessor or PSPDFDocumentEditor. You can configure what type of page it should be and also add images or logos from a PDF.

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Instantiates a new page configuration from the provided template and configuration block.

    Declaration

    Objective-C

    + (nonnull instancetype)
    newPageConfigurationWithPageTemplate:(nonnull PSPDFPageTemplate *)pageTemplate
                            builderBlock:
                                (nullable void (^)(PSPDFNewPageConfigurationBuilder
                                                       *_Nonnull))builderBlock;

    Swift

    convenience init(pageTemplate: PSPDFPageTemplate, builderBlock: ((PSPDFNewPageConfigurationBuilder) -> Void)? = nil)

    Parameters

    pageTemplate

    The PSPDFPageTemplate to use for the new page configuration.

    builderBlock

    Block that’ll be executed to build the new page configuration.

    Return Value

    PSPDFNewPageConfiguration instance.

  • The configured page size. If this is CGSizeZero, the size of the first page in the resulting document will be used.

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGSize pageSize;

    Swift

    var pageSize: CGSize { get }
  • The configured page rotation. Can only be 0, 90, 180 or 270.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFRotation pageRotation;

    Swift

    var pageRotation: Rotation { get }
  • The configured background color. If nil, no background color will be set in the resulting page.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) UIColor *backgroundColor;

    Swift

    var backgroundColor: UIColor? { get }
  • The page margins. This is mainly useful for aligning items.

    Declaration

    Objective-C

    @property (readonly, nonatomic) UIEdgeInsets pageMargins;

    Swift

    var pageMargins: UIEdgeInsets { get }
  • The tiled pattern that is configured.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFPageTemplate *pageTemplate;

    Swift

    var pageTemplate: PSPDFPageTemplate? { get }
  • The item that will be added to the new page.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFProcessorItem *item;

    Swift

    var item: PSPDFProcessorItem? { get }
  • Deprecated

    Deprecated in PSPDFKit 7.6 for iOS. Please use +newPageConfigurationWithPageTemplate:builderBlock. Use PSPDFPageTemplate.blankTemplate to generate a blank page configuration.

    Configures a PSPDFNewPageConfiguration with an empty page and allows you to set additional properties with the PSPDFNewPageConfigurationBuilder.

    Declaration

    Objective-C

    + (nonnull instancetype)newPageConfigurationWithEmptyPageBuilder:
        (nullable void (^)(PSPDFNewPageConfigurationBuilder *_Nonnull))builderBlock;

    Swift

    convenience init(emptyPageBuilder builderBlock: ((PSPDFNewPageConfigurationBuilder) -> Void)? = nil)
  • Deprecated

    Deprecated in PSPDFKit 7.6 for iOS. Please use +newPageConfigurationWithPageTemplate:builderBlock.

    Configures a PSPDFNewPageConfiguration with a tiled pattern page and allows you to set additional properties with the PSPDFNewPageConfigurationBuilder. See PSPDFNewPagePatternDot5mm, PSPDFNewPagePatternGrid5mm, PSPDFNewPagePatternLines5mm and PSPDFNewPagePatternLines7mm for tiled patterns.

    Declaration

    Objective-C

    + (nonnull instancetype)
    newPageConfigurationWithTiledPattern:(nonnull NSString *)pattern
                            builderBlock:
                                (nullable void (^)(PSPDFNewPageConfigurationBuilder
                                                       *_Nonnull))builderBlock;

    Swift

    convenience init(tiledPattern pattern: String, builderBlock: ((PSPDFNewPageConfigurationBuilder) -> Void)? = nil)
  • Deprecated

    Deprecated in PSPDFKit 7.6 for iOS. Please use +newPageConfigurationWithPageTemplate:builderBlock, and provide a PSPDFPageTemplate built with a document.

    Configures a PSPDFNewPageConfiguration with a page from a different document and allows you to set additional properties with the PSPDFNewPageConfigurationBuilder.

    Note

    You must ensure that the sourceDocument remains valid until the new pages are persisted (saved) intro the destination document.

    Declaration

    Objective-C

    + (nonnull instancetype)
    newPageConfigurationWithDocument:(nonnull PSPDFDocument *)sourceDocument
                     sourcePageIndex:(NSUInteger)sourcePageIndex
                        builderBlock:
                            (nullable void (^)(PSPDFNewPageConfigurationBuilder
                                                   *_Nonnull))builderBlock;

    Swift

    convenience init(document sourceDocument: PSPDFDocument, sourcePageIndex: UInt, builderBlock: ((PSPDFNewPageConfigurationBuilder) -> Void)? = nil)