This my gs command than merges 2 one-page pdf file:
gs -dNOPAUSE -dSAFER -sDEVICE=pdfwrite -sOUTPUTFILE=/tmp/blahblahblah.pdf -dBATCH page1.pdf page2.pdf
And this is the output:
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.
The font ArialMT
is not found and Helvetica
is substituted with it. I got the merged file from server by scp
and opened it in my local system. The file is properly merged including 2 pages. So file has no problem. Now I use the below command in order to get the PDF page count:
identify -format %n '/tmp/blahblahblah.pdf'
This command cannot get the page count and gives the below error:
identify: Postscript delegate failed `/tmp/blahblahblah.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/664.
NB: I should note that file exist in /tmp/blahblahblah.pdf
path!
Why I cannot get page count via identify
?
Sample files are attached in link below:
2 PDF sample file