【问题标题】:Ghostscript txtwrite bbox limitsGhostscript txtwrite bbox 限制
【发布时间】:2019-01-23 07:42:11
【问题描述】:

当我将ghostscripttextwrite 设备一起使用时,我得到一个描述我的pdfXML 文件,即

<page>
    <block>
        <line>
            <span bbox="95 97 357 97" font="..." size="9.0000">
                <char bbox="95 97 106 97" c="a"/>
                <char bbox="106 97 117 97" c="b"/>
                <char bbox="117 97 126 97" c="c"/>
                ...
            </span>
        </line>
    </block>
    <block>
    ...

我的问题是bbox(边界框)坐标(X1,Y1,X2,Y2)是否有已知比例,或者它们是否依赖于页面?无论如何,我可以以任何方式获取页面网格以了解其高度和宽度吗?

我的主要观点是太了解特征,例如角色是否位于页面中心之外等。

我将pdf 转换为XML 的完整命令:

ghostscript -q -sPAPERSIZE=a4 -r200 -sDEVICE=txtwrite" -sOutputFile=<output-path.xml> -dTextFormat=1 -dBATCH -dNOPAUSE <input-path.pdf>

【问题讨论】:

    标签: pdf ghostscript bounding-box pdf-parsing


    【解决方案1】:

    边界框采用 PostScript/PDF 单位,1/72 英寸。请注意,输出并不是真正的 XML,而是“类似”的 XML。

    【讨论】:

    猜你喜欢
    • 2021-08-28
    • 1970-01-01
    • 1970-01-01
    • 2012-08-25
    • 1970-01-01
    • 1970-01-01
    • 2018-09-08
    • 2017-03-01
    • 1970-01-01
    相关资源
    最近更新 更多