public static class

PageRenderConfiguration.Builder

extends Object
java.lang.Object
   ↳ com.pspdfkit.configuration.rendering.PageRenderConfiguration.Builder

Class Overview

Builder to create a PageRenderConfiguration instance

Summary

Public Constructors
Builder()
Public Methods
PageRenderConfiguration build()
Creates the configuration for page rendering.
PageRenderConfiguration.Builder cache(boolean useCache)
Use PSPDFKits disk and memory cache to render subsequent bitmaps faster.
PageRenderConfiguration.Builder formHighlightColor(int color)
Sets color used for highlighting editable form fields.
PageRenderConfiguration.Builder formItemHighlightColor(int color)
Sets color used for highlighting selected items inside lists, combo boxes and similar.
PageRenderConfiguration.Builder formRequiredFieldBorderColor(int color)
Sets color of the border around required form fields.
PageRenderConfiguration.Builder invertColors(boolean invertColors)
Sets if the colors will be inverted in the document.
PageRenderConfiguration.Builder paperColor(int color)
Background paper color for contents.
PageRenderConfiguration.Builder redactionAnnotationPreviewEnabled(boolean enable)
Sets redaction annotation preview enabled, false by default.
PageRenderConfiguration.Builder region(int x, int y, int fullPageWidth, int fullPageHeight)
Render a sub-region of the page.
PageRenderConfiguration.Builder renderedDrawables(List<PdfDrawable> pdfDrawables)
PageRenderConfiguration.Builder reuseBitmap(Bitmap bitmap)
Reuse bitmap as the rendering target and prevent allocation of new one.
PageRenderConfiguration.Builder showSignHereOverlay(boolean showOverlay)
Sets whether or not the sign here overlay in signature form fields should be shown.
PageRenderConfiguration.Builder signHereOverlayBackgroundColor(Integer color)
Sets color of the background of the sign here arrow.
PageRenderConfiguration.Builder toGrayscale(boolean toGrayscale)
Sets if the colors will be converted to grayscale.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder ()

Public Methods

public PageRenderConfiguration build ()

Creates the configuration for page rendering.

public PageRenderConfiguration.Builder cache (boolean useCache)

Use PSPDFKits disk and memory cache to render subsequent bitmaps faster. True by default.

Parameters
useCache true to use cache, false otherwise.

public PageRenderConfiguration.Builder formHighlightColor (int color)

Sets color used for highlighting editable form fields. Each editable form field is overlaid with rectangle filled with this color.

Parameters
color ARGB color integer (can be Color#TRANSPARENT).

public PageRenderConfiguration.Builder formItemHighlightColor (int color)

Sets color used for highlighting selected items inside lists, combo boxes and similar.

Parameters
color ARGB color integer (can be Color#TRANSPARENT).

public PageRenderConfiguration.Builder formRequiredFieldBorderColor (int color)

Sets color of the border around required form fields.

Parameters
color ARGB color integer or Color#TRANSPARENT to not show the border.

public PageRenderConfiguration.Builder invertColors (boolean invertColors)

Sets if the colors will be inverted in the document.

Parameters
invertColors true to invert colors, false otherwise.

public PageRenderConfiguration.Builder paperColor (int color)

Background paper color for contents. White by default.

Parameters
color ARGB color integer.

public PageRenderConfiguration.Builder redactionAnnotationPreviewEnabled (boolean enable)

Sets redaction annotation preview enabled, false by default.

Parameters
enable true to enable redaction annotation preview.

public PageRenderConfiguration.Builder region (int x, int y, int fullPageWidth, int fullPageHeight)

Render a sub-region of the page. Region square is determined from the passed full page size parameters and the bitmap size.

For example, if you want to render a center quarter of a square page at 640x640 resolution, you would pass in a 640x640 bitmap, set x and y offsets to 320 and 320 and define full page size as 1280x1280.

Parameters
x x-offset of the rendered region, can be negative.
y y-offset of the rendered region, can be negative.
fullPageWidth Width of the fully sized page.
fullPageHeight Height of the fully sized page.

public PageRenderConfiguration.Builder renderedDrawables (List<PdfDrawable> pdfDrawables)

public PageRenderConfiguration.Builder reuseBitmap (Bitmap bitmap)

Reuse bitmap as the rendering target and prevent allocation of new one. Note that there is no guarantee the bitmap will actually be reused when using cache. Bitmap must be the same size as the size passed in the rendering method.

Parameters
bitmap Bitmap to be reused.

public PageRenderConfiguration.Builder showSignHereOverlay (boolean showOverlay)

Sets whether or not the sign here overlay in signature form fields should be shown. true by default.

Parameters
showOverlay true to show the sign here overlay, false to hide it.

public PageRenderConfiguration.Builder signHereOverlayBackgroundColor (Integer color)

Sets color of the background of the sign here arrow.

Parameters
color ARGB color integer or Color#TRANSPARENT to not show the background.

public PageRenderConfiguration.Builder toGrayscale (boolean toGrayscale)

Sets if the colors will be converted to grayscale.

Parameters
toGrayscale true to covert to grayscale, false otherwise.