concept text matrix in category itext

appears as: text matrix
iText in Action, Second Edition

This is an excerpt from Manning's book iText in Action, Second Edition.

Text state is a subset of graphics state. In section 2.2, you learned that a computer font is a program that knows how to draw glyphs. These glyphs are shapes that are filled with a fill color. No borders are drawn unless you change the text-rendering mode with setTextRenderingMode(). You used this text state operator in listing 3.1 to draw the words “SOLD OUT” in white letters with a red border. You also used setFontAndSize() to choose a font and a font size, setTextMatrix() to change the text matrix, and showText() to draw the glyphs. You’ll find an overview of all the possible graphics state and text state operators in section 14.4.

Table 14.11. Text object operators

PDF

iText method

Description

BT beginText() Begins a text object. Initializes the text, text line, and identity matrix. Don’t nest text objects; a second BT is forbidden before an ET.
ET endText() Ends a text object, discards the text matrix.
  • The text-line matrix— This captures the value of the text matrix at the beginning of a line of text.
  • The text-rendering matrix— This is an intermediate result that combines the effects of text state parameters, the text matrix, and the CTM.
  • sitemap

    Unable to load book!

    The book could not be loaded.

    (try again in a couple of minutes)

    manning.com homepage
    test yourself with a liveTest