Package com.pspdfkit.document.processor
Class PageCanvas
-
- All Implemented Interfaces:
public class PageCanvas
Represents a canvas drawing to be merged onto another PDF page.
-
-
Field Summary
Fields Modifier and Type Field Description public PageZOrder
zOrder
public Matrix
matrix
public PagePosition
position
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
Modifier and Type Method Description PageZOrder
getZOrder()
Returns the z-order of the content to be added to a page. void
setZOrder(@NonNull() PageZOrder zOrder)
Sets z-order of the content, foreground or background. Matrix
getMatrix()
Returns a custom transformation matrix for the content. PagePosition
getPosition()
Returns the alignment of drawn content on the target page. -
-
Constructor Detail
-
PageCanvas
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.
-
PageCanvas
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).
-
PageCanvas
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.
-
-
Method Detail
-
getZOrder
@NonNull() PageZOrder getZOrder()
Returns the z-order of the content to be added to a page.
- Returns:
z-order of the page content, BACKGROUND or FOREGROUND.
-
setZOrder
void setZOrder(@NonNull() PageZOrder zOrder)
Sets z-order of the content, foreground or background. Defaults to foreground.
- Parameters:
zOrder
- z-odder of the content, BACKGROUND or FOREGROUND.
-
getMatrix
@NonNull() 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).
-
getPosition
@Nullable() PagePosition getPosition()
Returns the alignment of drawn content on the target page.
- Returns:
Relative position of the drawn content on the target page.
-
-
-
-