Page 1 of 1
Add images in existing pdf file from command line
Posted: 2017-08-06T23:23:54-07:00
by and
Hello!
I must add images to the end of an existing PDF file.
Tried using the command:
convert 1.jpg -adjoin 1.pdf.
The file is rewrite with only one this image.
Is it possible to do this at all with the command line?
Re: Add images in existing pdf file from command line
Posted: 2017-08-06T23:31:35-07:00
by fmw42
You need an output image and an input image and the extra page image. So if you have 1.pdf and want to add 1.jpg, you would do
But Imagemagick will rasterize your pdf. So any vector data will not be preserved. Also you may need to specify the density for decoding your input pdf.
Code: Select all
convert -density XXX 1.pdf 1.jpg 1.pdf
Please, always provide your IM version and platform when asking questions, since syntax may differ.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at
viewtopic.php?f=1&t=9620
For novices, see
viewtopic.php?f=1&t=9620http://http://w ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
Re: Add images in existing pdf file from command line
Posted: 2017-08-07T00:50:43-07:00
by and
Both commands lead to an error.
D:\Projects\01_Digitizer\11_Usable\ImageMagic\ImageMagick-7.0.6-4-portable-Q16-x
86>convert 1.pdf 1.jpg 1.pdf
convert: FailedToExecuteCommand `"gswin32c.exe" -q -dQUIET -dSAFER -dBATCH -dNOP
AUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=
pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=C:/Us
ers/VELGAN~1/AppData/Local/Temp/magick-4456wVRL28w5MGQB%d" "-fC:/Users/VELGAN~1/
AppData/Local/Temp/magick-4456iOaLzm191n5n" "-fC:/Users/VELGAN~1/AppData/Local/T
emp/magick-44567wxTnrZfMIPY"' (Can not find the specified file.
) @ error/delegate.c/ExternalDelegateCommand/460.
convert: PDFDelegateFailed `Can not find the specified file.
' @ error/pdf.c/ReadPDFImage/793.
We use IM: 7.0.6-4;
Windows 7 x64. SP1.
Re: Add images in existing pdf file from command line
Posted: 2017-08-07T07:59:06-07:00
by snibgo
IM is trying to run Ghostscript, and failing. Perhaps GS isn't installed. You can install it from
https://www.ghostscript.com/download/gsdnld.html