0

it goes like this

q
0.1199951 0 0 0.1199951 0 0 cm
1 g
824 4101 267 389 re
f
Q
q
0.1199951 0 0 0.1199951 0 0 cm
1 g
824 4853 267 25 re
f
Q
q
0.1199951 0 0 0.1199951 0 0 cm
1 g
824 5241 267 25 re
f
Q
q
0.1199951 0 0 0.1199951 0 0 cm
1 g
1090 578 3081 1988 re
f
Q
q
0.1199951 0 0 0.1199951 0 0 cm
603 586 m
603 1800 l
649 1800 l
649 586 l
h
W n
8.3336724 0 0 8.3336724 0 0 cm
BT
/T1_0 5.04 Tf
0 1.0002 -1 0 76.8 70.32 Tm
(J)Tj  

I want to ask what should be coordinate for J ? My cropbox is 0 0 612 792 , Rotate value is 90.

So according to me
Th=1 default,
Tfs=5.04, from {/T1_0 5.04 Tf}
Trise=0 default,

teststatematrix
5.04 1 0
0 5.04 0
0 0 1

Tm
0 1.0002 0
-1 0 0
76.8 70.32 1

TRM = textstatematrix X Tm
-1 5.041 0
-5.040 0 0
76.800 70.320 1

So
[x,y,1] = [76.8, 70.32, 1] X TRM = [-354.413 457.469 1]

So x coordinate in user space is coming to be a negative number. Can you please Explain What mistake i am doing?

sakivns
  • 55
  • 6
  • You might want to study [this answer](http://stackoverflow.com/a/16483429/1729265) and the documents referenced from it. – mkl Feb 13 '15 at 13:04
  • *what should be coordinate for J* - you also have to tell in which coordinate system. – mkl Feb 13 '15 at 13:40
  • Sir, I have some doubt which i explained above, can you please suggest solution to this. – sakivns Feb 14 '15 at 15:09
  • Why do you apply the TRM to [76.8, 70.32, 1]? Shouldn't you apply it to [0 0 1]? – mkl Feb 14 '15 at 18:40
  • According to me current X and Y coordinate in Text space is set by Tm and it will be equal to 76.8 and 70.32 respectively. Please suggest. – sakivns Feb 15 '15 at 16:06
  • *According to me current X and Y coordinate in Text space is set by Tm* - TRM includes Tm. If you feed the result of Tm into TRM, you essentially apply Tm twice. Which is wrong. – mkl Feb 15 '15 at 21:01

1 Answers1

0

The matrix Trm calculated by the OP as

-1      5.041  0
-5.040  0      0
76.800 70.320  1

is the text rendering matrix described as follows in the PDF specification:

Conceptually, the entire transformation from text space to device space may be represented by a text rendering matrix, Trm:

Trm = ...

(section 9.4.2, ISO 32000-1:2008)

The OP's mistake is not in calculating this matrix but in using it: This matrix contains the entire transformation from text space to device space,

Tj and other text-showing operators shall position the origin of the first glyph to be painted at the origin of text space.

(section 9.2.4 ISO 32000-1:2008)

and

The glyph origin is the point (0, 0) in the glyph coordinate system

(ibidem)

To determine, therefore, where the OP's

(J)Tj 

puts the origin of the glyph J, one has to apply that matrix to the origin (0, 0), not to (76.8, 70.32) as the OP did.

Thus,

[x,y,1] = [0, 0, 1] X Trm = [76.8, 70.32, 1]

i.e. the coordinates of J are (76.8, 70.32) in device space. As the OP assumed the initial transformation matrix to have been the identity matrix, this device space essentially is the default user space.

Unfortunately the OP did not explain the coordinates in which coordinate system he is looking for. Thus, these coordinates probably are not the coordinates he was looking for.

mkl
  • 90,588
  • 15
  • 125
  • 265
  • Thanks a lot for such a nice explanation. I got my mistake and now solved the problem. :) – sakivns Feb 23 '15 at 16:31
  • Great. In that case you might want to mark the answer as [accepted answer](http://stackoverflow.com/help/accepted-answer). – mkl Feb 25 '15 at 09:17