public class Canvas extends RootElement<Canvas>
| Modifier and Type | Field and Description |
|---|---|
protected PdfPage |
page
Is initialized and used only when Canvas element autotagging is enabled, see
enableAutoTagging(PdfPage). |
protected PdfCanvas |
pdfCanvas |
protected Rectangle |
rootArea |
childElements, defaultFont, defaultSplitCharacters, immediateFlush, pdfDocument, properties, rootRenderer| Constructor and Description |
|---|
Canvas(PdfCanvas pdfCanvas,
PdfDocument pdfDocument,
Rectangle rootArea)
Creates a new Canvas to manipulate a specific document and page.
|
Canvas(PdfCanvas pdfCanvas,
PdfDocument pdfDocument,
Rectangle rootArea,
boolean immediateFlush)
Creates a new Canvas to manipulate a specific document and page.
|
Canvas(PdfFormXObject formXObject,
PdfDocument pdfDocument)
Creates a new Canvas to manipulate a specific
PdfFormXObject. |
| Modifier and Type | Method and Description |
|---|---|
void |
enableAutoTagging(PdfPage page)
Enables canvas content autotagging.
|
protected RootRenderer |
ensureRootRendererNotNull() |
PdfPage |
getPage()
Returned value is not null only in case when autotagging is enabled.
|
PdfCanvas |
getPdfCanvas()
Gets the
PdfCanvas. |
PdfDocument |
getPdfDocument()
Gets the
PdfDocument for this canvas. |
Rectangle |
getRootArea()
Gets the root area rectangle.
|
boolean |
isAutoTaggingEnabled() |
void |
relayout() |
void |
setRenderer(CanvasRenderer canvasRenderer)
Sets the
IRenderer for this Canvas. |
add, add, deleteOwnProperty, getDefaultProperty, getOwnProperty, getProperty, getRenderer, hasOwnProperty, hasProperty, setProperty, showTextAligned, showTextAligned, showTextAligned, showTextAligned, showTextAligned, showTextAligned, showTextAlignedKernedgetHeight, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, getWidth, setBackgroundColor, setBackgroundColor, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderLeft, setBorderRight, setBorderTop, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontKerning, setFontScript, setFontSize, setHeight, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setWidth, setWidth, setWidthPercent, setWordSpacingprotected PdfCanvas pdfCanvas
protected Rectangle rootArea
protected PdfPage page
enableAutoTagging(PdfPage).
It is also used to determine if autotagging is enabled.public Canvas(PdfCanvas pdfCanvas, PdfDocument pdfDocument, Rectangle rootArea)
pdfCanvas - the low-level content stream writerpdfDocument - the document that the resulting content stream will be written torootArea - the maximum area that the Canvas may write uponpublic Canvas(PdfCanvas pdfCanvas, PdfDocument pdfDocument, Rectangle rootArea, boolean immediateFlush)
pdfCanvas - the low-level content stream writerpdfDocument - the document that the resulting content stream will be written torootArea - the maximum area that the Canvas may write uponpublic Canvas(PdfFormXObject formXObject, PdfDocument pdfDocument)
PdfFormXObject.formXObject - the formpdfDocument - the document that the resulting content stream will be written topublic PdfDocument getPdfDocument()
PdfDocument for this canvas.public Rectangle getRootArea()
public PdfCanvas getPdfCanvas()
PdfCanvas.public void setRenderer(CanvasRenderer canvasRenderer)
IRenderer for this Canvas.canvasRenderer - a renderer specific for canvas operationspublic PdfPage getPage()
public void enableAutoTagging(PdfPage page)
page - the page, on which this canvas will be rendered.public boolean isAutoTaggingEnabled()
public void relayout()
protected RootRenderer ensureRootRendererNotNull()
ensureRootRendererNotNull in class RootElement<Canvas>Copyright © 1998–2016 iText Group NV. All rights reserved.