我有以下内容用于获取 PDF 文档中的总页数:
identify -format %n test.pdf
然后我去除所有非数字字符以从响应中获取单个整数。
有时会产生以下错误,这会导致上面产生错误的页数,因为它们是与响应中的页面无关的其他数字。
**** Warning: Fonts with Subtype = /TrueType should be embedded.
The following fonts were not embedded:
Arial
Arial,Bold
Arial,Italic
Times New Roman
**** This file had errors that were repaired or ignored.
**** The file was produced by:
**** >>>> Microsoft« Office Word 2007 <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.
9
“9”是文档中的页数。
如何抑制警告消息,我尝试使用“-quiet”标志,但仍然产生消息。