为什么当我将2个pdf文件与`gs`(ghostscript)合并时,identify命令无法获取页数?

时间:2016-11-26 13:30:54

标签: pdf merge ghostscript identify

这是我的gs命令,而不是合并2页的一页pdf文件:

gs -dNOPAUSE -dSAFER -sDEVICE=pdfwrite -sOUTPUTFILE=/tmp/blahblahblah.pdf -dBATCH page1.pdf page2.pdf

这是输出:

GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Processing pages 1 through 1.
Page 1
Can't find (or can't open) font file /usr/share/ghostscript/8.70/Resource/Font/ArialMT.
Can't find (or can't open) font file ArialMT.
Can't find (or can't open) font file /usr/share/ghostscript/8.70/Resource/Font/ArialMT.
Can't find (or can't open) font file ArialMT.
Querying operating system for font files...
Can't find (or can't open) font file /usr/share/ghostscript/8.70/Resource/Font/ArialMT.
Can't find (or can't open) font file ArialMT.
Didn't find this font on the system!
Substituting font Helvetica for ArialMT.
Loading NimbusSanL-Regu font from /usr/share/fonts/default/Type1/n019003l.pfb... 3397696 1943901 17192756 15861178 3 done.

找不到字体ArialMTHelvetica替换为scp。我通过identify -format %n '/tmp/blahblahblah.pdf' 从服务器获取合并文件,并在我的本地系统中打开它。该文件已正确合并,包括2页。所以文件没有问题。现在我使用下面的命令来获取PDF页面数:

identify: Postscript delegate failed `/tmp/blahblahblah.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/664.

此命令无法获取页数并给出以下错误:

/tmp/blahblahblah.pdf

NB:我应该注意identify路径中存在该文件!

为什么我无法通过def create # Here!!!! @goal = current_user.goals.new(goal_params) @goal.save redirect_to root_path, notice: "Objectif sauvegardé" end 获取页数?

示例文件附在以下链接中:
2 PDF sample file

0 个答案:

没有答案