iText 8.0.5 API
|
A renderer object is responsible for drawing a corresponding layout object on a document or canvas. More...
Public Member Functions |
|
void | AddChild (IRenderer renderer) |
Adds a child to the current renderer More... |
|
LayoutResult | Layout (LayoutContext layoutContext) |
This method simulates positioning of the renderer, including all of its children, and returns the iText.Layout.Layout.LayoutResult , representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc. More... |
|
void | Draw (DrawContext drawContext) |
Flushes the renderer subtree contents, i.e. draws itself on canvas, adds necessary objects to the iText.Kernel.Pdf.PdfDocument etc. More... |
|
LayoutArea | GetOccupiedArea () |
Gets the resultant occupied area after the last call to the Layout(iText.Layout.Layout.LayoutContext) method. More... |
|
T1 | GetProperty< T1 > (int property, T1 defaultValue) |
Gets a property from this entity or one of its hierarchical parents. More... |
|
IRenderer | SetParent (IRenderer parent) |
Explicitly sets this object as the child of another IRenderer in the renderer hierarchy. More... |
|
IRenderer | GetParent () |
Gets the parent IRenderer. More... |
|
IPropertyContainer | GetModelElement () |
Gets the model element associated with this renderer. More... |
|
IList< IRenderer > | GetChildRenderers () |
Gets the child IRenderer s. More... |
|
bool | IsFlushed () |
Indicates whether this renderer is flushed or not, i.e. if Draw(DrawContext) has already been called. More... |
|
void | Move (float dx, float dy) |
Moves the renderer subtree by the specified offset. More... |
|
IRenderer | GetNextRenderer () |
Gets a new instance of this class to be used as a next renderer, after this renderer is used, if Layout(iText.Layout.Layout.LayoutContext) is called more than once. More... |
|
Public Member Functions inherited from iText.Layout.IPropertyContainer | |
bool | HasProperty (int property) |
Checks if this entity has the specified property. More... |
|
bool | HasOwnProperty (int property) |
Checks if this entity has the specified property, i.e. if it was set to this very element earlier More... |
|
T1 | GetProperty< T1 > (int property) |
Gets the property from this entity. More... |
|
T1 | GetOwnProperty< T1 > (int property) |
Gets own property from this entity. More... |
|
T1 | GetDefaultProperty< T1 > (int property) |
Gets the default property from this entity. More... |
|
void | SetProperty (int property, Object value) |
Sets a property for this entity. More... |
|
void | DeleteOwnProperty (int property) |
Deletes the own property of this entity. More... |
|
A renderer object is responsible for drawing a corresponding layout object on a document or canvas.
A renderer object is responsible for drawing a corresponding layout object on a document or canvas. Every layout object has a renderer, by default one of the corresponding type, e.g. you can ask an iText.Layout.Element.Image for its ImageRenderer. Renderers are designed to be extensible, and custom implementations can be seeded to layout objects (or their custom subclasses) at runtime.
void iText.Layout.Renderer.IRenderer.AddChild | ( | IRenderer | renderer | ) |
Adds a child to the current renderer
renderer | a child to be added |
Implemented in iText.Layout.Renderer.FlexContainerRenderer, iText.Layout.Renderer.AbstractRenderer, iText.Layout.Renderer.TableRenderer, iText.Layout.Renderer.GridContainerRenderer, iText.Layout.Renderer.CanvasRenderer, iText.Layout.Renderer.RootRenderer, and iText.Layout.Renderer.AreaBreakRenderer.
void iText.Layout.Renderer.IRenderer.Draw | ( | DrawContext | drawContext | ) |
Flushes the renderer subtree contents, i.e. draws itself on canvas, adds necessary objects to the iText.Kernel.Pdf.PdfDocument etc.
drawContext | contains the iText.Kernel.Pdf.PdfDocument to which the renderer subtree if flushed, the iText.Kernel.Pdf.Canvas.PdfCanvas on which the renderer subtree is drawn and other additional parameters needed to perform drawing |
Implemented in iText.Layout.Renderer.TableRenderer, iText.Layout.Renderer.TextRenderer, iText.Layout.Renderer.AbstractRenderer, iText.Layout.Renderer.BlockRenderer, iText.Layout.Renderer.ImageRenderer, iText.Forms.Form.Renderer.AbstractFormFieldRenderer, iText.Forms.Form.Renderer.AbstractSelectFieldRenderer, iText.Layout.Renderer.AreaBreakRenderer, iText.Layout.Renderer.ListItemRenderer, iText.Layout.Renderer.LinkRenderer, iText.Layout.Renderer.TabRenderer, and iText.Svg.Renderers.SvgImageRenderer.
IList<IRenderer> iText.Layout.Renderer.IRenderer.GetChildRenderers | ( | ) |
Gets the child IRenderer s.
Implemented in iText.Layout.Renderer.AbstractRenderer, and iText.Layout.Renderer.AreaBreakRenderer.
IPropertyContainer iText.Layout.Renderer.IRenderer.GetModelElement | ( | ) |
Gets the model element associated with this renderer.
Implemented in iText.Layout.Renderer.AbstractRenderer, iText.Layout.Renderer.AreaBreakRenderer, and iText.Layout.Renderer.CellRenderer.
IRenderer iText.Layout.Renderer.IRenderer.GetNextRenderer | ( | ) |
Gets a new instance of this class to be used as a next renderer, after this renderer is used, if Layout(iText.Layout.Layout.LayoutContext) is called more than once.
Implemented in iText.Layout.Renderer.AbstractRenderer, iText.Layout.Renderer.TableRenderer, iText.Layout.Renderer.TextRenderer, iText.Layout.Renderer.LineRenderer, iText.Layout.Renderer.ParagraphRenderer, iText.Layout.Renderer.ImageRenderer, iText.Layout.Renderer.ListItemRenderer, iText.Layout.Renderer.CellRenderer, iText.Layout.Renderer.AreaBreakRenderer, iText.Forms.Form.Renderer.ButtonRenderer, iText.Forms.Form.Renderer.SignatureAppearanceRenderer, iText.Layout.Renderer.CanvasRenderer, iText.Layout.Renderer.MulticolRenderer, iText.Layout.Renderer.TabRenderer, iText.Layout.Renderer.ListRenderer, iText.Layout.ColumnDocumentRenderer, iText.Layout.Renderer.LinkRenderer, iText.Forms.Form.Renderer.TextAreaRenderer, iText.Layout.Renderer.DocumentRenderer, iText.Layout.Renderer.FlexContainerRenderer, iText.Layout.Renderer.LineSeparatorRenderer, iText.Forms.Form.Renderer.RadioRenderer, iText.Forms.Form.Renderer.SelectFieldComboBoxRenderer, iText.Forms.Form.Renderer.CheckBoxRenderer, iText.Forms.Form.Renderer.InputFieldRenderer, iText.Forms.Form.Renderer.SelectFieldListBoxRenderer, iText.Layout.Renderer.DivRenderer, and iText.Layout.Renderer.GridContainerRenderer.
LayoutArea iText.Layout.Renderer.IRenderer.GetOccupiedArea | ( | ) |
Gets the resultant occupied area after the last call to the Layout(iText.Layout.Layout.LayoutContext) method.
iText.Layout.Layout.LayoutArea instance
Implemented in iText.Layout.Renderer.AbstractRenderer, iText.Layout.Renderer.AreaBreakRenderer, and iText.Layout.Renderer.DocumentRenderer.
IRenderer iText.Layout.Renderer.IRenderer.GetParent | ( | ) |
Gets the parent IRenderer.
Implemented in iText.Layout.Renderer.AbstractRenderer, and iText.Layout.Renderer.AreaBreakRenderer.
T1 iText.Layout.Renderer.IRenderer.GetProperty< T1 > | ( | int | property, |
T1 | defaultValue | ||
) |
Gets a property from this entity or one of its hierarchical parents.
Gets a property from this entity or one of its hierarchical parents. If the property is not found, defaultValue will be returned.
T1 | the return type associated with the property |
property | the property to be retrieved |
defaultValue | a fallback value |
Implemented in iText.Layout.Renderer.AbstractRenderer, and iText.Layout.Renderer.AreaBreakRenderer.
bool iText.Layout.Renderer.IRenderer.IsFlushed | ( | ) |
Indicates whether this renderer is flushed or not, i.e. if Draw(DrawContext) has already been called.
Implemented in iText.Layout.Renderer.AbstractRenderer, and iText.Layout.Renderer.AreaBreakRenderer.
LayoutResult iText.Layout.Renderer.IRenderer.Layout | ( | LayoutContext | layoutContext | ) |
This method simulates positioning of the renderer, including all of its children, and returns the iText.Layout.Layout.LayoutResult , representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc.
This method simulates positioning of the renderer, including all of its children, and returns the iText.Layout.Layout.LayoutResult , representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc. iText.Layout.Layout.LayoutResult can be extended to return custom layout results for custom elements, e.g. TextRenderer uses iText.Layout.Layout.TextLayoutResult as its result. This method can be called standalone to learn how much area the renderer subtree needs, or can be called before Draw(DrawContext) , to prepare the renderer to be flushed to the output stream.
layoutContext | the description of layout area and any other additional information |
Implemented in iText.Layout.Renderer.RootRenderer, iText.Layout.Renderer.TableRenderer, iText.Layout.Renderer.TextRenderer, iText.Forms.Form.Renderer.SignatureAppearanceRenderer, iText.Forms.Form.Renderer.AbstractFormFieldRenderer, iText.Forms.Form.Renderer.TextAreaRenderer, iText.Layout.Renderer.ImageRenderer, iText.Layout.Renderer.FlexContainerRenderer, iText.Layout.Renderer.MulticolRenderer, iText.Layout.Renderer.ParagraphRenderer, iText.Layout.Renderer.AreaBreakRenderer, iText.Layout.Renderer.LineRenderer, iText.Forms.Form.Renderer.SelectFieldListBoxRenderer, iText.Layout.Renderer.ListItemRenderer, iText.Layout.Renderer.GridContainerRenderer, iText.Layout.Renderer.BlockRenderer, iText.Forms.Form.Renderer.AbstractSelectFieldRenderer, iText.Layout.Renderer.ListRenderer, iText.Layout.Renderer.TabRenderer, iText.Layout.Renderer.LineSeparatorRenderer, and iText.Layout.Renderer.AbstractRenderer.
void iText.Layout.Renderer.IRenderer.Move | ( | float | dx, |
float | dy | ||
) |
Moves the renderer subtree by the specified offset.
Moves the renderer subtree by the specified offset. This method affects occupied area of the renderer.
dx | the x-axis offset in points. Positive value will move the renderer subtree to the right. |
dy | the y-axis offset in points. Positive value will move the renderer subtree to the top. |
Implemented in iText.Layout.Renderer.TableRenderer, iText.Layout.Renderer.AbstractRenderer, iText.Layout.Renderer.ParagraphRenderer, iText.Layout.Renderer.ImageRenderer, and iText.Layout.Renderer.AreaBreakRenderer.
Explicitly sets this object as the child of another IRenderer in the renderer hierarchy.
Explicitly sets this object as the child of another IRenderer in the renderer hierarchy. Some implementations also use this method internally to create a consistent hierarchy tree.
parent | the object to place higher in the renderer hierarchy |
Implemented in iText.Layout.Renderer.AbstractRenderer, and iText.Layout.Renderer.AreaBreakRenderer.