public class

PageCanvas

extends Object
java.lang.Object
   ↳ com.pspdfkit.document.processor.PageCanvas

Class Overview

Represents a canvas drawing to be merged onto another PDF page.

Summary

Public Constructors
PageCanvas(Size pageSize, NewPage.OnDrawCanvasCallback callback)
PDF page created from a Canvas holding all the draw calls.
PageCanvas(Size pageSize, NewPage.OnDrawCanvasCallback callback, Matrix matrix)
PDF page created from a Canvas holding all the draw calls.
PageCanvas(Size pageSize, NewPage.OnDrawCanvasCallback callback, PagePosition position)
PDF page created from a Canvas holding all the draw calls.
Public Methods
Matrix getMatrix()
Returns a custom transformation matrix for the content.
PagePosition getPosition()
Returns the alignment of drawn content on the target page.
PageZOrder getZOrder()
Returns the z-order of the content to be added to a page.
void setZOrder(PageZOrder zOrder)
Sets z-order of the content, foreground or background.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PageCanvas (Size pageSize, NewPage.OnDrawCanvasCallback callback)

PDF page created from a Canvas holding all the draw calls.

Parameters
pageSize Canvas page size in PDF points.
callback An NewPage.OnDrawCanvasCallback that should be called to perform the drawing on the canvas.

public PageCanvas (Size pageSize, NewPage.OnDrawCanvasCallback callback, Matrix matrix)

PDF page created from a Canvas holding all the draw calls.

Parameters
pageSize Canvas page size in PDF points.
callback An NewPage.OnDrawCanvasCallback that should be called to perform the drawing on the canvas.
matrix Custom transformation matrix for the drawn content, identity matrix means alignment on bottom left at coordinate (0,0).

public PageCanvas (Size pageSize, NewPage.OnDrawCanvasCallback callback, PagePosition position)

PDF page created from a Canvas holding all the draw calls.

Parameters
pageSize Canvas page size in PDF points.
callback An NewPage.OnDrawCanvasCallback that should be called to perform the drawing on the canvas.
position Alignment of the drawn content on the target page.

Public Methods

public Matrix getMatrix ()

Returns a custom transformation matrix for the content.

Returns
  • Custom transformation matrix for the content, identity matrix means alignment on bottom left at coordinate (0,0).

public PagePosition getPosition ()

Returns the alignment of drawn content on the target page.

Returns
  • Relative position of the drawn content on the target page.

public PageZOrder getZOrder ()

Returns the z-order of the content to be added to a page.

Returns

public void setZOrder (PageZOrder zOrder)

Sets z-order of the content, foreground or background. Defaults to foreground.

Parameters
zOrder z-odder of the content, BACKGROUND or FOREGROUND.