iText 8.0.5 API
|
This class represents the renderer object for a iText.Layout.Element.Text object. More...
Public Member Functions |
|
TextRenderer (Text textElement) | |
Creates a TextRenderer from its corresponding layout object. More... |
|
TextRenderer (Text textElement, String text) | |
Creates a TextRenderer from its corresponding layout object, with a custom text to replace the contents of the iText.Layout.Element.Text. More... |
|
override 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... |
|
virtual void | ApplyOtf () |
override 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... |
|
virtual void | TrimFirst () |
Trims any whitespace characters from the start of the iText.IO.Font.Otf.GlyphLine to be rendered. More... |
|
virtual float | GetAscent () |
Gets the maximum offset above the base line that this Text extends to. More... |
|
virtual float | GetDescent () |
Gets the maximum offset below the base line that this Text extends to. More... |
|
virtual float | GetYLine () |
Gets the position on the canvas of the imaginary horizontal line upon which the iText.Layout.Element.Text 's contents will be written. More... |
|
virtual void | MoveYLineTo (float y) |
Moves the vertical position to the parameter's value. More... |
|
virtual void | SetText (String text) |
Manually sets the contents of the Text's representation on the canvas, regardless of the Text's own contents. More... |
|
virtual void | SetText (GlyphLine text, PdfFont font) |
Manually set a GlyphLine and PdfFont for rendering. More... |
|
virtual GlyphLine | GetText () |
virtual int | Length () |
The length of the whole text assigned to this renderer. More... |
|
override String | ToString () |
virtual int | CharAt (int pos) |
Gets char code at given position for the text belonging to this renderer. More... |
|
virtual float | GetTabAnchorCharacterPosition () |
override 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... |
|
override MinMaxWidth | GetMinMaxWidth () |
Calculates min and max width values for current renderer. More... |
|
Public Member Functions inherited from iText.Layout.Renderer.AbstractRenderer | |
virtual void | AddChild (IRenderer renderer) |
Adds a child to the current renderer More... |
|
virtual IPropertyContainer | GetModelElement () |
Gets the model element associated with this renderer. More... |
|
virtual IList< IRenderer > | GetChildRenderers () |
Gets the child IRenderer s. More... |
|
virtual bool | HasProperty (int property) |
Checks if this entity has the specified property. More... |
|
virtual bool | HasOwnProperty (int property) |
Checks if this entity has the specified property, i.e. if it was set to this very element earlier More... |
|
virtual bool | HasOwnOrModelProperty (int property) |
Checks if this renderer or its model element have the specified property, i.e. if it was set to this very element or its very model element earlier. More... |
|
virtual void | DeleteOwnProperty (int property) |
Deletes the own property of this entity. More... |
|
virtual void | DeleteProperty (int property) |
Deletes property from this very renderer, or in case the property is specified on its model element, the property of the model element is deleted More... |
|
virtual T1 | GetProperty< T1 > (int key) |
Gets the property from this entity. More... |
|
virtual T1 | GetOwnProperty< T1 > (int property) |
Gets own property from this entity. More... |
|
virtual T1 | GetProperty< T1 > (int property, T1 defaultValue) |
Gets a property from this entity or one of its hierarchical parents. More... |
|
virtual void | SetProperty (int property, Object value) |
Sets a property for this entity. More... |
|
virtual T1 | GetDefaultProperty< T1 > (int property) |
Gets the default property from this entity. More... |
|
virtual PdfFont | GetPropertyAsFont (int property) |
Returns a property with a certain key, as a font object. More... |
|
virtual Color | GetPropertyAsColor (int property) |
Returns a property with a certain key, as a color. More... |
|
virtual TransparentColor | GetPropertyAsTransparentColor (int property) |
Returns a property with a certain key, as a iText.Layout.Properties.TransparentColor. More... |
|
virtual ? float | GetPropertyAsFloat (int property) |
Returns a property with a certain key, as a floating point value. More... |
|
virtual ? float | GetPropertyAsFloat (int property, float? defaultValue) |
Returns a property with a certain key, as a floating point value. More... |
|
virtual ? bool | GetPropertyAsBoolean (int property) |
Returns a property with a certain key, as a boolean value. More... |
|
virtual UnitValue | GetPropertyAsUnitValue (int property) |
Returns a property with a certain key, as a unit value. More... |
|
virtual ? int | GetPropertyAsInteger (int property) |
Returns a property with a certain key, as an integer value. More... |
|
override String | ToString () |
Returns a string representation of the renderer. More... |
|
virtual LayoutArea | GetOccupiedArea () |
Gets the resultant occupied area after the last call to the Layout(iText.Layout.Layout.LayoutContext) method. More... |
|
virtual void | DrawBackground (DrawContext drawContext) |
Draws a background layer if it is defined by a key iText.Layout.Properties.Property.BACKGROUND in either the layout element or this IRenderer itself. More... |
|
virtual void | DrawChildren (DrawContext drawContext) |
Performs the drawing operation for all children of this renderer. More... |
|
virtual void | DrawBorder (DrawContext drawContext) |
Performs the drawing operation for the border of this renderer, if defined by any of the iText.Layout.Properties.Property.BORDER values in either the layout element or this IRenderer itself. More... |
|
virtual bool | IsFlushed () |
Indicates whether this renderer is flushed or not, i.e. if Draw(DrawContext) has already been called. More... |
|
virtual IRenderer | SetParent (IRenderer parent) |
Explicitly sets this object as the child of another IRenderer in the renderer hierarchy. More... |
|
virtual IRenderer | GetParent () |
Gets the parent IRenderer. More... |
|
virtual void | Move (float dxRight, float dyUp) |
Moves the renderer subtree by the specified offset. More... |
|
virtual IList< Rectangle > | InitElementAreas (LayoutArea area) |
Gets all rectangles that this IRenderer can draw upon in the given area. More... |
|
virtual Rectangle | GetOccupiedAreaBBox () |
Gets the bounding box that contains all content written to the DrawContext by this IRenderer. More... |
|
virtual Rectangle | GetBorderAreaBBox () |
Gets the border box of a renderer. More... |
|
virtual Rectangle | GetInnerAreaBBox () |
virtual Rectangle | ApplyMargins (Rectangle rect, bool reverse) |
Applies margins of the renderer on the given rectangle More... |
|
virtual Rectangle | ApplyBorderBox (Rectangle rect, bool reverse) |
Applies the border box of the renderer on the given rectangle If the border of a certain side is null, the side will remain as it was. More... |
|
virtual Rectangle | ApplyPaddings (Rectangle rect, bool reverse) |
Applies paddings of the renderer on the given rectangle More... |
|
virtual bool | IsFirstOnRootArea () |
Static Public Member Functions |
|
static float[] | CalculateAscenderDescender (PdfFont font) |
Get ascender and descender from font metrics. More... |
|
static float[] | CalculateAscenderDescender (PdfFont font, RenderingMode? mode) |
Get ascender and descender from font metrics. More... |
|
Static Public Member Functions inherited from iText.Layout.Renderer.AbstractRenderer | |
static PdfFormXObject | CreateXObject (AbstractLinearGradientBuilder linearGradientBuilder, Rectangle xObjectArea, PdfDocument document) |
Create a iText.Kernel.Pdf.Xobject.PdfFormXObject with the given area and containing a linear gradient inside. More... |
|
Package Functions |
|
TextRenderer (iText.Layout.Renderer.TextRenderer other) | |
override Rectangle | GetBackgroundArea (Rectangle occupiedAreaWithMargins) |
Evaluate the actual background More... |
|
override? float | GetFirstYLineRecursively () |
Gets the first yLine of the nested children recursively. More... |
|
override? float | GetLastYLineRecursively () |
virtual int | LineLength () |
Returns the length of the line which is the result of the layout call. More... |
|
virtual int | BaseCharactersCount () |
virtual int | GetNumberOfSpaces () |
virtual iText.Layout.Renderer.TextRenderer | CreateSplitRenderer () |
virtual iText.Layout.Renderer.TextRenderer | CreateOverflowRenderer () |
virtual iText.Layout.Renderer.TextRenderer[] | Split (int initialOverflowTextPos) |
virtual void | DrawSingleUnderline (Underline underline, TransparentColor fontStrokeColor, PdfCanvas canvas, float fontSize, float italicAngleTan) |
virtual float | CalculateLineWidth () |
virtual bool | ResolveFonts (IList< IRenderer > addTo) |
Resolve iText.Layout.Properties.Property.FONT String[] value. More... |
|
virtual void | SetProcessedGlyphLineAndFont (GlyphLine gl, PdfFont font) |
virtual iText.Layout.Renderer.TextRenderer | CreateCopy (GlyphLine gl, PdfFont font) |
Creates a copy of this TextRenderer , which corresponds to the passed iText.IO.Font.Otf.GlyphLine with iText.Kernel.Font.PdfFont. More... |
|
Package Functions inherited from iText.Layout.Renderer.AbstractRenderer | |
AbstractRenderer () | |
Creates a renderer. More... |
|
AbstractRenderer (IElement modelElement) | |
Creates a renderer for the specified layout element. More... |
|
AbstractRenderer (iText.Layout.Renderer.AbstractRenderer other) | |
Creates a new renderer based on an instance of another renderer. More... |
|
virtual void | BeginElementOpacityApplying (DrawContext drawContext) |
Apply Property.OPACITY property if specified by setting corresponding values in graphic state dictionary opacity will be applied to all elements drawn after calling this method and before calling EndElementOpacityApplying(DrawContext) ()}. More... |
|
virtual void | EndElementOpacityApplying (DrawContext drawContext) |
BeginElementOpacityApplying(DrawContext). More... |
|
virtual bool | ClipBorderArea (DrawContext drawContext, Rectangle outerBorderBox) |
virtual bool | ClipBackgroundArea (DrawContext drawContext, Rectangle outerBorderBox) |
virtual bool | ClipBackgroundArea (DrawContext drawContext, Rectangle outerBorderBox, bool considerBordersBeforeClipping) |
virtual void | ApplyDestinationsAndAnnotation (DrawContext drawContext) |
virtual bool | IsOverflowProperty (OverflowPropertyValue? equalsTo, int overflowProperty) |
virtual ? float | RetrieveWidth (float parentBoxWidth) |
Retrieves element's fixed content box width, if it's set. More... |
|
virtual ? float | RetrieveMaxWidth (float parentBoxWidth) |
Retrieves element's fixed content box max width, if it's set. More... |
|
virtual ? float | RetrieveMinWidth (float parentBoxWidth) |
Retrieves element's fixed content box max width, if it's set. More... |
|
virtual void | UpdateWidth (UnitValue updatedWidthValue) |
Updates fixed content box width value for this renderer. More... |
|
virtual ? float | RetrieveHeight () |
Retrieves the element's fixed content box height, if it's set. More... |
|
virtual void | UpdateHeight (UnitValue updatedHeight) |
Updates fixed content box height value for this renderer. More... |
|
virtual ? float | RetrieveMaxHeight () |
Retrieve element's content box max-ehight, if it's set. More... |
|
virtual void | UpdateMaxHeight (UnitValue updatedMaxHeight) |
Updates content box max-height value for this renderer. More... |
|
virtual ? float | RetrieveMinHeight () |
Retrieves element's content box min-height, if it's set. More... |
|
virtual void | UpdateMinHeight (UnitValue updatedMinHeight) |
Updates content box min-height value for this renderer. More... |
|
virtual ? float | RetrieveUnitValue (float baseValue, int property) |
virtual ? float | RetrieveUnitValue (float baseValue, int property, bool pointOnly) |
virtual IDictionary< int, Object > | GetOwnProperties () |
virtual void | AddAllProperties (IDictionary< int, Object > properties) |
virtual bool | AllowLastYLineRecursiveExtraction () |
virtual Rectangle | ApplyMargins (Rectangle rect, UnitValue[] margins, bool reverse) |
Applies given margins on the given rectangle More... |
|
virtual UnitValue[] | GetMargins () |
Returns margins of the renderer [0] - top; [1] - right; [2] - bottom; [3] - left More... |
|
virtual UnitValue[] | GetPaddings () |
Returns paddings of the renderer [0] - top; [1] - right; [2] - bottom; [3] - left More... |
|
virtual Rectangle | ApplyPaddings (Rectangle rect, UnitValue[] paddings, bool reverse) |
Applies given paddings to the given rectangle. More... |
|
virtual Rectangle | ApplyBorderBox (Rectangle rect, Border[] borders, bool reverse) |
Applies the given border box (borders) on the given rectangle More... |
|
virtual void | ApplyAbsolutePosition (Rectangle parentRect) |
virtual void | ApplyRelativePositioningTranslation (bool reverse) |
virtual void | ApplyDestination (PdfDocument document) |
virtual void | ApplyAction (PdfDocument document) |
virtual void | ApplyLinkAnnotation (PdfDocument document) |
virtual void | UpdateHeightsOnSplit (bool wasHeightClipped, iText.Layout.Renderer.AbstractRenderer splitRenderer, iText.Layout.Renderer.AbstractRenderer overflowRenderer) |
virtual bool | SetMinMaxWidthBasedOnFixedWidth (MinMaxWidth minMaxWidth) |
virtual bool | IsNotFittingHeight (LayoutArea layoutArea) |
virtual bool | IsNotFittingWidth (LayoutArea layoutArea) |
virtual bool | IsNotFittingLayoutArea (LayoutArea layoutArea) |
virtual bool | IsPositioned () |
Indicates whether the renderer's position is fixed or not. More... |
|
virtual bool | IsFixedLayout () |
Indicates whether the renderer's position is fixed or not. More... |
|
virtual bool | IsStaticLayout () |
virtual bool | IsRelativePosition () |
virtual bool | IsAbsolutePosition () |
virtual bool | IsKeepTogether () |
virtual void | AlignChildHorizontally (IRenderer childRenderer, Rectangle currentArea) |
virtual Border[] | GetBorders () |
Gets borders of the element in the specified order: top, right, bottom, left. More... |
|
virtual BorderRadius[] | GetBorderRadii () |
Gets border radii of the element in the specified order: top-left, top-right, bottom-right, bottom-left. More... |
|
virtual iText.Layout.Renderer.AbstractRenderer | SetBorders (Border border, int borderNumber) |
virtual Rectangle | CalculateAbsolutePdfBBox () |
Calculates the bounding box of the content in the coordinate system of the pdf entity on which content is placed, e.g. document page or form xObject. More... |
|
virtual Rectangle | CalculateBBox (IList< Point > points) |
Calculates bounding box around points. More... |
|
virtual IList< Point > | RectangleToPointsList (Rectangle rect) |
virtual IList< Point > | TransformPoints (IList< Point > points, AffineTransform transform) |
virtual float[] | CalculateShiftToPositionBBoxOfPointsAt (float left, float top, IList< Point > points) |
This method calculates the shift needed to be applied to the points in order to position upper and left borders of their bounding box at the given lines. More... |
|
virtual bool | HasAbsoluteUnitValue (int property) |
Check if corresponding property has point value. More... |
|
virtual bool | HasRelativeUnitValue (int property) |
Check if corresponding property has relative value. More... |
|
virtual void | BeginTransformationIfApplied (PdfCanvas canvas) |
virtual void | EndTransformationIfApplied (PdfCanvas canvas) |
Package Attributes |
|
float | yLineOffset |
GlyphLine | text |
GlyphLine | line |
String | strToBeConverted |
bool | otfFeaturesApplied = false |
float | tabAnchorCharacterPosition = -1 |
IList< int[]> | reversedRanges |
GlyphLine | savedWordBreakAtLineEnding |
Package Attributes inherited from iText.Layout.Renderer.AbstractRenderer | |
IList< IRenderer > | childRenderers = new List<IRenderer>() |
IList< IRenderer > | positionedRenderers = new List<IRenderer>() |
IPropertyContainer | modelElement |
bool | flushed = false |
LayoutArea | occupiedArea |
IRenderer | parent |
IDictionary< int, Object > | properties = new Dictionary |
bool | isLastRendererForModelElement = true |
Static Package Attributes |
|
const float | TEXT_SPACE_COEFF = FontProgram.UNITS_NORMALIZATION |
Static Package Attributes inherited from iText.Layout.Renderer.AbstractRenderer | |
const float | EPS = 1e-4f |
The maximum difference between iText.Kernel.Geom.Rectangle coordinates to consider rectangles equal More... |
|
const float | INF = 1e6f |
The infinity value which is used while layouting More... |
|
Additional Inherited Members |
|
Static Public Attributes inherited from iText.Layout.Renderer.AbstractRenderer | |
const float | OVERLAP_EPSILON = 1e-4f |
Static Package Functions inherited from iText.Layout.Renderer.AbstractRenderer | |
static bool | IsBorderBoxSizing (IRenderer renderer) |
static bool | IsOverflowProperty (OverflowPropertyValue? equalsTo, IRenderer renderer, int overflowProperty) |
static bool | IsOverflowProperty (OverflowPropertyValue? equalsTo, OverflowPropertyValue? rendererOverflowProperty) |
static bool | IsOverflowFit (OverflowPropertyValue? rendererOverflowProperty) |
This class represents the renderer object for a iText.Layout.Element.Text object.
This class represents the renderer object for a iText.Layout.Element.Text object. It will draw the glyphs of the textual content on the DrawContext.
|
inline |
Creates a TextRenderer from its corresponding layout object.
textElement | the iText.Layout.Element.Text which this object should manage |
|
inline |
Creates a TextRenderer from its corresponding layout object, with a custom text to replace the contents of the iText.Layout.Element.Text.
textElement | the iText.Layout.Element.Text which this object should manage |
text | the replacement text |
|
inlinestatic |
Get ascender and descender from font metrics.
Get ascender and descender from font metrics. If these values are obtained from typo metrics they are normalized with a scale coefficient.
font | from which metrics will be extracted |
|
inlinestatic |
Get ascender and descender from font metrics.
Get ascender and descender from font metrics. In RenderingMode.DEFAULT_LAYOUT_MODE if these values are obtained from typo metrics they are normalized with a scale coefficient.
font | from which metrics will be extracted |
mode | mode in which metrics will be obtained. Impact on the use of scale coefficient |
|
inlinevirtual |
Gets char code at given position for the text belonging to this renderer.
pos | the position in range [0; length()) |
|
inlinepackagevirtual |
Creates a copy of this TextRenderer , which corresponds to the passed iText.IO.Font.Otf.GlyphLine with iText.Kernel.Font.PdfFont.
Creates a copy of this TextRenderer , which corresponds to the passed iText.IO.Font.Otf.GlyphLine with iText.Kernel.Font.PdfFont.
While processing TextRenderer , iText uses this method to create glyph lines of specific fonts , which represent the TextRenderer 's parts. If one extends TextRenderer , one should override this method, otherwise if iText.Layout.Font.FontSelector related logic is triggered, copies of this TextRenderer will have the default behavior rather than the custom one.
gl | a iText.IO.Font.Otf.GlyphLine which represents some of this TextRenderer 's content |
font | a iText.Kernel.Font.PdfFont for this part of the TextRenderer 's content |
|
inlinevirtual |
Flushes the renderer subtree contents, i.e. draws itself on canvas, adds necessary objects to the iText.Kernel.Pdf.PdfDocument etc.
Reimplemented from iText.Layout.Renderer.AbstractRenderer.
|
inlinevirtual |
Gets the maximum offset above the base line that this Text extends to.
Implements iText.Layout.Renderer.ILeafElementRenderer.
|
inlinepackagevirtual |
Evaluate the actual background
occupiedAreaWithMargins | the current occupied area with applied margins |
Reimplemented from iText.Layout.Renderer.AbstractRenderer.
|
inlinevirtual |
Gets the maximum offset below the base line that this Text extends to.
Implements iText.Layout.Renderer.ILeafElementRenderer.
|
inlinepackagevirtual |
Gets the first yLine of the nested children recursively.
Gets the first yLine of the nested children recursively. E.g. for a list, this will be the yLine of the first item (if the first item is indeed a paragraph). NOTE: this method will no go further than the first child.
Reimplemented from iText.Layout.Renderer.AbstractRenderer.
|
inlinevirtual |
Calculates min and max width values for current renderer.
Reimplemented from iText.Layout.Renderer.AbstractRenderer.
|
inlinevirtual |
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.
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.
If TextRenderer overflows to the next line, iText uses this method to create a renderer for the overflow part. So if one wants to extend TextRenderer , one should override this method: otherwise the default method will be used and thus the default rather than the custom renderer will be created. Another method that should be overridden in case of TextRenderer 's extension is CreateCopy(iText.IO.Font.Otf.GlyphLine, iText.Kernel.Font.PdfFont) . This method is responsible for creation of TextRenderer 's copies, which represent its parts of specific font.
Implements iText.Layout.Renderer.AbstractRenderer.
|
inlinevirtual |
Gets the position on the canvas of the imaginary horizontal line upon which the iText.Layout.Element.Text 's contents will be written.
|
inlinevirtual |
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 |
Implements iText.Layout.Renderer.AbstractRenderer.
|
inlinevirtual |
The length of the whole text assigned to this renderer.
|
inlinepackagevirtual |
Returns the length of the line which is the result of the layout call.
|
inlinevirtual |
Moves the vertical position to the parameter's value.
y | the new vertical position of the Text |
|
inlinepackagevirtual |
Resolve iText.Layout.Properties.Property.FONT String[] value.
addTo | add all processed renderers to. |
|
inlinevirtual |
Manually set a GlyphLine and PdfFont for rendering.
text | the iText.IO.Font.Otf.GlyphLine |
font | the font |
|
inlinevirtual |
Manually sets the contents of the Text's representation on the canvas, regardless of the Text's own contents.
text | the replacement text |
|
inlinevirtual |
Trims any whitespace characters from the start of the iText.IO.Font.Otf.GlyphLine to be rendered.