使用Imagemagick - PHP计算PDF文件中的页面 [英] Count pages in PDF file using Imagemagick - PHP

查看:84
本文介绍了使用Imagemagick - PHP计算PDF文件中的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows Vista PC 中使用 PHP 5和Apache 。我已经安装并配置了 Imagemagick 。我想使用 imagick 计算pdf文件中的总页数。

I am using PHP 5 with Apache in my Windows Vista PC. I have Imagemagick already installed and configured. I want to count the total number of pages in a pdf file using imagick.

我提供了一个解决方案 这里 ,但不知道如何打开pdf文件作为文本和计数页面。

I fount one solution here, but dont know how to open pdf file as text and count pages.

有人给我一个使用imagemagick计算页面的明确解决方案

识别-format%n testfile.pdf

identify -format %n testfile.pdf

通过谷歌搜索,我找到了一些解决方法或示例;

From googling, I found some workarounds or examples;


  1. imagick(识别-format%n testfile.pdf)

  2. 识别-density 12 -format %ptestfile.pdf

  3. 识别-format%n testfile.pdf

  1. imagick(identify -format %n testfile.pdf)
  2. identify -density 12 -format "%p" testfile.pdf
  3. identify -format %n testfile.pdf

我不知道如何利用这些东西..

I don't know how to make use of this stuff..

推荐答案

我用它解决了它;

exec(identify -format%n $ file)

这篇关于使用Imagemagick - PHP计算PDF文件中的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆