PHP - Get number of pages in a Word document(PHP - 获取 Word 文档中的页数)
问题描述
有没有办法使用 PHP 计算现有 Word 文档的页数?
Is there a way to count number of pages using PHP for existing Word documents?
感谢您的帮助.
谢谢
推荐答案
要从 PHP 中获取 doc、docx、ppt 和 pptx 的元数据属性,例如页数、幻灯片数,我遵循了以下过程,并且效果很好我很高兴,以下是我遵循的过程,希望对某人有帮助
To get meta data properties of doc,docx,ppt and pptx like number of pages, number of slides from PHP i followed the following process and it worked liked charm and iam so happy, below is the process i followed , hope it helps someone
Download and configure Apache Tika.
完成后,您可以尝试执行以下命令,它将提供有关您文件的所有元数据
once its done you could try executing the following commadn it will give all the meta data about your file
java -jar tika-app-1.5.jar -m test.docx
java -jar tika-app-1.5.jar -m test.doc
java -jar tika-app-1.5.jar -m test.pptx
java -jar tika-app-1.5.jar -m test.ppt
经过测试后,您可以在PHP 脚本
中执行此命令.谢谢.
once tested you can execute this comman in PHP script
. Thanks.
这篇关于PHP - 获取 Word 文档中的页数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP - 获取 Word 文档中的页数


基础教程推荐
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- PHP 守护进程/worker 环境 2022-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 使用 PDO 转义列名 2021-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01