What does 'TJ' mean in the API documentation of Element class

Hi!

Stumbled over the abbreviation ‘TJ’ in the API docs, e.g. here www.pdftron.com/pdfnet/PDFNetJava/pdftron/PDF/Element.html.

  • getPosAdjustment:

The returned number corresponds to a number value within TJ array. For ‘Tj’ text strings the returned value is always 0.

because CharIterator positioning information already accounts for TJ adjustments this method is rarely used.

  • getTextLength
    … and positioning adjustments on ‘TJ’ elements.

What does it mean?

Regards
Björn

Hello Bjorn

For details on TJ operator please see page #259 (Table 109) in PDF Specification:

http://xodo.com/view/#/c0c11968-ee14-478e-9b09-6dc5635c0915

“Show one or more text strings, allowing individual glyph positioning. Each element of array shall be either a string or a number. If the element is a string, this operator shall show the string. If it is a number, the operator shall adjust the text position by that amount; that is, it shall translate the text matrix, Tm . The number shall be expressed in thousandths of a unit of text space (see 9.4.4, “Text Space Details”). This amount shall be subtracted from the current horizontal or vertical coordinate, depending on the writing mode. In the default coordinate system, a positive adjustment has the effect of moving the next glyph painted either to the left or down by the given amount. Figure 46 shows an example of the effect of passing offsets to TJ.”

Example:

[ (A) 120 (W) 120 (A) 95 (Y again) ] TJ

What are you trying to accomplish?

On Monday, July 28, 2014 1:27:23 AM UTC-7, Björn Weinbrenner wrote:

Hi!

Stumbled over the abbreviation ‘TJ’ in the API docs, e.g. here www.pdftron.com/pdfnet/PDFNetJava/pdftron/PDF/Element.html.

  • getPosAdjustment:

The returned number corresponds to a number value within TJ array. For ‘Tj’ text strings the returned value is always 0.

because CharIterator positioning information already accounts for TJ adjustments this method is rarely used.

  • getTextLength
    … and positioning adjustments on ‘TJ’ elements.

What does it mean?

Regards
Björn