I use 'convert' to create huge PDF files from a set of JPG images. Each image becomes one page in the resulting PDF.
is there a way to make the file names of the JPG files appear as well in the created PDF, as an annotation somewhere on each page?
convert set of jpg files into huge pdf: how to add filenames
Re: convert set of jpg files into huge pdf: how to add filen
Try -set label %f.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert set of jpg files into huge pdf: how to add filen
If you do not mind the filenames add outside the image, then try
montage -label "%f" -tile 1x1 image1.jpg image2.jpg .... result.pdf
montage -label "%f" -tile 1x1 image1.jpg image2.jpg .... result.pdf
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert set of jpg files into huge pdf: how to add filen
Here is another way that lets you put the filename inside the image. You can place it with -gravity ... -geometry ...
convert image1.jpg image2.jpg ....imageN.jpg -set filename:myfilename '%f' \
-gravity north -pointsize 15 -fill white -annotate 0 "%[filename:myfilename]" result.pdf
convert image1.jpg image2.jpg ....imageN.jpg -set filename:myfilename '%f' \
-gravity north -pointsize 15 -fill white -annotate 0 "%[filename:myfilename]" result.pdf
Re: convert set of jpg files into huge pdf: how to add filen
Thanks a lot for the swift and excellent help.
As these are grayscale scan documents, some near white, some near black, I used the third recommended version, with 'fill red'
and got escellent results.
As these are grayscale scan documents, some near white, some near black, I used the third recommended version, with 'fill red'
and got escellent results.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: convert set of jpg files into huge pdf: how to add filen
Note I would not use filename:filename whcih is special for use in output filenames not for annotations
Why not just use %f directly in the annotation?
Why not just use %f directly in the annotation?
Code: Select all
convert image1.jpg image2.jpg ....imageN.jpg \
-gravity north -pointsize 15 -fill white -annotate 0 "%f" \
result.pdf
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/