0

Please tell us how you can calculate the values in the TJ array? From the question example:

1 0 0 1 0 188.28799438 cm
BT 
/F2 11.04 Tf
1 0 0 -1 0 9.38000011 Tm 
(Some)Tj ( )Tj 
21.24200058 0 Td 
(text)Tj ( )Tj 

Which I want to turn into this:

1 0 0 1 0 188.28799438 cm
BT 
/F2 11.04 Tf
1 0 0 -1 0 9.38000011 Tm 
[(S)10(o)11(m)12(e)( )]TJ 
21.24200058 0 Td 
[(t)10(e)10(x)10(t)( )]TJ 

How values are calculated(10) (11) (12) ?

so if I open any pdf and find THESE values there, how can I check them? how do they appear?

  • You say you want to turn `(Some)Tj ( )Tj` into `[(S)10(o)11(m)12(e)( )]TJ`. But why? What do you want to achieve? Considering the numeric values in the `TJ` argument, you ask how you can check them and how they appear. But check for what?And they obviously appear because some PDF processor put them there. – mkl Oct 01 '20 at 20:35
  • I want to check whether these values are correct. But I don't understand exactly how each value appears. For example, someone changed `(Some)Tj ( )Tj` to `[(S)10(o)11(m)12(e)( )]TJ` , how do I recalculate the tj values? – mark stoch Oct 01 '20 at 21:10
  • What do you mean by *correct*? Switching from **Tj** to **TJ** and adding those numbers is a change in how the text is drawn. To determine whether that's "correct" you need to know the purpose of the change. There are no "correct" or "incorrect" numbers per se. – mkl Oct 02 '20 at 04:52
  • That's right, I don't understand how the values 10, 11, 12 can appear. So is it PRNG or random? – mark stoch Oct 02 '20 at 07:32
  • For example: I changed the text "Some" to "SomE0" and received value `[(S)4(o)6(m)12(E)15(0 )]TJ` and the Tj values changed, how did this happen? on what basis does 4 appear, why not 33 ? – mark stoch Oct 02 '20 at 07:50
  • *"I changed the text "Some" to "SomE0" and received value [(S)4(o)6(m)12(E)15(0 )]TJ and the Tj values changed, how did this happen? on what basis does 4 appear, why not 33 ?"* - What do you mean by "received"? If you changed the text, it was you who did that, wasn't it? – mkl Oct 02 '20 at 11:15
  • Yes I changed the text but how are the values of the tj array generated? – mark stoch Oct 02 '20 at 11:33
  • received = I changed the text in the editor and parsed the pdf to get the array values. how are they generated? – mark stoch Oct 02 '20 at 11:35
  • Summarized: Apparently there is some PDF editing program you use some function of to change text in a PDF, and this function uses **TJ** operations instead of **Tj** operations and adds small position adjustments. And now you want to know how that function of your PDF editing program determines the values for those position adjustments. Correct? – mkl Oct 02 '20 at 13:16
  • Yes, edit program =Acrobat XI – mark stoch Oct 02 '20 at 13:27
  • however, no matter what program, I still don't understand on what basis any software assigns tj values – mark stoch Oct 02 '20 at 13:35
  • There may be multiple factors in determining those position adjustments, depending on the exact editing function used and its parameters. Often text editing functions use position adjustments to apply [kerning](https://en.wikipedia.org/wiki/Kerning) for a visually more pleasing result. As you can read in that wikipedia article, information on the amount of kerning for pairs of glyphs can be determined from various font file features. Also sometimes text editing functions are used to put more (or less) text into some space and position adjustments can be used to fill the space evenly. – mkl Oct 02 '20 at 14:07
  • Also one can use position adjustments to create a more or less spaced out appearance of certain words. Then there are poor man's bold effects, drawing a glyph twice with a minimal offset to create a bold appearance, here position adjustments can also be used to step back far enough. There may be other uses still. And in a given text, multiple of these factors might be at work and the eventual position adjustment values are sums of the adjustments of all those adjustments. – mkl Oct 02 '20 at 14:16

0 Answers0