public static class

NewPage.Builder

extends Object
java.lang.Object
   ↳ com.pspdfkit.document.processor.NewPage.Builder

Class Overview

Builder for NewPage objects.

Summary

Public Methods
NewPage.Builder backgroundColor(int backgroundColor)
Sets background color for the page.
NewPage build()
Creates a NewPage object.
NewPage.Builder rotation(int rotation)
Rotates the page.
NewPage.Builder withMargins(RectF margins)
Sets page margins in PDF points.
NewPage.Builder withPageItem(PageCanvas canvas)
Merges content of canvas drawing to this page.
NewPage.Builder withPageItem(PageImage image)
Adds an image to this page.
NewPage.Builder withPageItem(PagePdf pdf)
Merges content of another PDF page to this page.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public NewPage.Builder backgroundColor (int backgroundColor)

Sets background color for the page.

Parameters
backgroundColor Background color, default is Color#TRANSPARENT which is rendered white on most renderers.

public NewPage build ()

Creates a NewPage object.

public NewPage.Builder rotation (int rotation)

Rotates the page.

Parameters
rotation Rotation of the page, valid values are 0, 90, 180 or 270.

public NewPage.Builder withMargins (RectF margins)

Sets page margins in PDF points.

Parameters
margins Rect representing page margins.

public NewPage.Builder withPageItem (PageCanvas canvas)

Merges content of canvas drawing to this page. Only one page item can be added at a time.

Parameters
canvas Page canvas to be merged onto this page.

public NewPage.Builder withPageItem (PageImage image)

Adds an image to this page. Only one page item can be added at a time.

Parameters
image Image to be added to the page.

public NewPage.Builder withPageItem (PagePdf pdf)

Merges content of another PDF page to this page. Only one page item can be added at a time.

Parameters
pdf Page to be merged onto this page.