[英]Which unit of measurement is returned by the PDFBox's getXDirAdj() method
I am using the PDFBox to extract the character coordinates from the read PDF.我正在使用 PDFBox 从读取的 PDF 中提取字符坐标。 However, I can't identify the unit of measurement of the value returned by the getXDirAdj () and getYDirAdj () methods?
但是,getXDirAdj() 和getYDirAdj() 方法返回的值的计量单位我无法识别?
@Override
protected void processTextPosition(TextPosition text) {
String tChar = text.getCharacter();
System.out.println("String[" + text.getXDirAdj() + ","
+ text.getYDirAdj() + " fs=" + text.getFontSize() + " xscale="
+ text.getXScale() + " height=" + text.getHeightDir() + " space="
+ text.getWidthOfSpace() + " width="
+ text.getWidthDirAdj() + "]" + text.getCharacter());
}
1 unit = 1/72 inch 1 个单位 = 1/72 英寸
"how to obtain the rotation of the character read": from the ExtractText.java tool: “如何获得读取字符的旋转”:来自 ExtractText.java 工具:
static int getAngle(TextPosition text) { Matrix m = text.getTextMatrix().clone(); m.concatenate(text.getFont().getFontMatrix()); return (int) Math.round(Math.toDegrees(Math.atan2(m.getShearY(), m.getScaleY()))); }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.