How to read a PDF text matrix

后端 未结 3 1462
梦如初夏
梦如初夏 2021-02-03 14:26

I am writing a program to create PDF file directly from my Program. I have used the PDF Reference manual and managed to figure out everything except for 1 thing. The Text Matrix

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-03 15:01

    The matrices used in PDFs are Affine transforms.

    tm loads the parameters into:

    |a b 0|
    |c d 0|
    |e f 1|

    Where:

    a is Scale_x
    b is Shear_x
    c is Shear_y
    d is Scale_y
    e is offset x
    f is offset y
    

    A good introduction can be found at http://docstore.mik.ua/orelly/java-ent/jfc/ch04_11.htm

    Hope this helps someone.

提交回复
热议问题