【发布时间】:2016-09-28 22:34:58
【问题描述】:
我无法理解PDPageContentStream.setTextMatrix(Matrix m) 的参数矩阵m 中的6 个值表示什么。以前它使用 6 个值,但现在它需要一个包含所有值的矩阵。
是的,我已阅读文档,但发现解释完全没用 -
public void setTextMatrix(double a,
double b,
double c,
double d,
double e,
double f)
throws IOException
The Tm operator. Sets the text matrix to the given values. A current text matrix will be replaced with the new one.
Parameters:
a - The a value of the matrix.
b - The b value of the matrix.
c - The c value of the matrix.
d - The d value of the matrix.
e - The e value of the matrix.
f - The f value of the matrix.
我也搜索了示例,但我没有找到对这些值的解释。另外,奇怪的是,当我对 2 个不同的 PDF 文件尝试相同的值时,结果不同,所以我假设这与边距和距离等有关。
我觉得我在做猜测工作是在浪费时间。对论点的直接解释将非常好。
编辑
我知道矩阵以及如何传递值。我不知道矩阵中的值实际上是什么意思。
【问题讨论】:
-
查看所做的编辑。
-
可以去看看java文档中关于AffineTransform的解释,除了参数不同外,这个是一样的。另见 Matrix 的静态方法。*
-
另请阅读处理坐标系的 pdf 规范部分。
-
scaleXm00 ShearYm10 ShearXm01 scaleYm11 transXm02 transYm12 - 这很令人困惑,因为 Adobe 使用了不同于 java 的排序方式。