使用 PHP 从 .pdf 中提取页面

发布于 2024-10-07 01:40:14 字数 153 浏览 0 评论 0原文

是否可以从 .PDF 文件中提取一页或多页,并将每一页另存为 .JPG / .PNG / ...?

我已经找到了 ImageMagick,但我想知道是否有任何解决方案不需要安装任何 PHP 扩展/插件。我目前正在使用 PHP5。

多谢!

尼尔斯

Is it possible to extract one or more pages from a .PDF-file, and save each page as a .JPG / .PNG / ...?

I already found ImageMagick but I want to know if there are any solutions where you don't need to install any extentions / plugins to PHP. I'm currently using PHP5.

Thanks a lot!

Niels

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

机场等船 2024-10-14 01:40:14

PHP 中没有内置任何用于读取 PDF 的内容(从 php 5 开始,有用于创建 PDF 的内容)。您可以找到一些可以完成此操作的类,并且您不必安装 PEAR 模块,只需包含该文件即可。或者,您可以尝试通过 exec 或反引号从命令行使用 imagemagick,许多主机已经安装了它以在 shell 中使用。

There is nothing built into PHP for reading PDFs (there is for creating, as of php 5). You can find some classes out there which will do it, and you won't have to install a PEAR module, just include the file. Alternately, you could try and use imagemagick from the command line with exec or backticks, a lot of hosts already have it installed for use in the shell.

许你一世情深 2024-10-14 01:40:14

不确定如何从 pdf 页面创建图像,但您可以使用 xpdf 从 php 中的 pdf 文件读取文本: http://www.foolabs.com/xpdf/about.html

您可能还想了解一下 fpdf:http://www.fpdf.org/ 可能有您正在寻找的功能

Not sure about creating an image from pages in pdfs, but you can use xpdf to read text from pdf files in php: http://www.foolabs.com/xpdf/about.html

Something else you may want to look into is fpdf: http://www.fpdf.org/ which may have the features you're looking for

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文