MCPcopy Create free account
hub / github.com/LibPDF-js/core / handleTJ

Method handleTJ

src/text/text-extractor.ts:220–235  ·  view source on GitHub ↗

* Handle TJ (show strings with positioning) operator.

(operands: ContentToken[])

Source from the content-addressed store, hash-verified

218 * Handle TJ (show strings with positioning) operator.
219 */
220 private handleTJ(operands: ContentToken[]): void {
221 const array = operands[0];
222
223 if (array?.type !== "array") {
224 return;
225 }
226
227 for (const item of array.items) {
228 if (item.type === "string") {
229 this.showString(item.value);
230 } else if (item.type === "number") {
231 // Position adjustment
232 this.state.applyTjAdjustment(item.value);
233 }
234 }
235 }
236
237 /**
238 * Show a string and extract characters.

Callers 1

processOperationMethod · 0.95

Calls 2

showStringMethod · 0.95
applyTjAdjustmentMethod · 0.80

Tested by

no test coverage detected