/// <summary>Creates a new TextRenderInfo object</summary> /// <param name="str">the PDF string that should be displayed</param> /// <param name="gs">the graphics state (note: at this time, this is not immutable, so don't cache it)</param> /// <param name="textMatrix">the text matrix at the time of the render operation</param> /// <param name="canvasTagHierarchy">the marked content tags sequence, if available</param> public TextRenderInfo(PdfString str, CanvasGraphicsState gs, Matrix textMatrix, Stack <CanvasTag> canvasTagHierarchy ) { this.@string = str; this.textToUserSpaceTransformMatrix = textMatrix.Multiply(gs.GetCtm()); this.gs = gs; this.canvasTagHierarchy = JavaCollectionsUtil.UnmodifiableList <CanvasTag>(new List <CanvasTag>(canvasTagHierarchy )); this.fontMatrix = gs.GetFont().GetFontMatrix(); }
/// <summary>Used for creating sub-TextRenderInfos for each individual character</summary> /// <param name="parent">the parent TextRenderInfo</param> /// <param name="string">the content of a TextRenderInfo</param> /// <param name="horizontalOffset">the unscaled horizontal offset of the character that this TextRenderInfo represents /// </param> private TextRenderInfo(iText.Kernel.Pdf.Canvas.Parser.Data.TextRenderInfo parent, PdfString @string, float horizontalOffset) { this.@string = @string; this.textToUserSpaceTransformMatrix = new Matrix(horizontalOffset, 0).Multiply(parent.textToUserSpaceTransformMatrix ); this.gs = parent.gs; this.canvasTagHierarchy = parent.canvasTagHierarchy; this.fontMatrix = gs.GetFont().GetFontMatrix(); }