【发布时间】:2010-11-30 20:23:47
【问题描述】:
给定一个 PDF,如何使用 PHP lib 或 linux 命令行工具获得 PDF 的布局模式(或相对宽度/高度)?
使用 http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf 可以在新 PDF 上设置此变量,但对于 adobe 中的现有 pdf。
考虑将 pdf 转换为 ps,或以其他方式使用 gs - 比如先将其转换为图像,然后获取其宽度和高度。这是最好的方法吗?
【问题讨论】:
-
没有“PDF 的布局模式”之类的东西。什么是“页面的布局模式”。您所假设的(PDF 始终具有相同的页面大小和方向)只是一种特殊情况(具有讽刺意味的是,这可能有些普遍)!另见how to take into account the trim box and the rotation setting of PDF pages...
标签: php linux pdf ghostscript cups