PageTemplate

constructor(@NonNull sourceDocument: PdfDocument, @IntRange(from = 0) pageIndex: Int, @NonNull templateName: String, @Nullable previewImage: Drawable)

Creates a new PageTemplate from existing document page. The page templates created form existing pages can't be customized by the user (size, orientation, page color) and are added to the document exactly as is.

Parameters

sourceDocument

The document to use to create the new page.

pageIndex

The page of the source document to use for the new page.

templateName

Title shown to the user when selecting the page template

previewImage

Preview image shown to the user when selecting a new page template. Should be 100x100dp.


constructor(@NonNull pagePattern: PagePattern, @NonNull templateName: String, @Nullable previewImage: Drawable)

Creates a new PageTemplate from page tiling pattern.

Parameters

pagePattern

Tiled Page pattern to use to create new page.

templateName

Title shown to the user when selecting the page template

previewImage

Preview image shown to the user when selecting a new page template. Should be 100x100dp.