I’m splitting multi page PDF files into individual PNG images. Each png is a page from the file.
I’d love to be able to name my png’s according to the bookmark name of the pdf page they were converted from.
Is it possible?
PDF Bookmarks to individual file names
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: PDF Bookmarks to individual file names
Imagemagick cannot read PDF bookmarks. But you can number the pages.
Just use _%02d appended to the filename. This will work for up to 99 pages. If you want more, then use _%03d.
Here I start the scene numbering at 01 rather than 00.
First I create a simply PDF file:
Now I separate the pages
The result is 3 files:
Just use _%02d appended to the filename. This will work for up to 99 pages. If you want more, then use _%03d.
Here I start the scene numbering at 01 rather than 00.
First I create a simply PDF file:
Code: Select all
convert lena.jpg lena.jpg lena.jpg lena.pdf
Code: Select all
convert lena.pdf -scene 1 lena_%02d.png
Code: Select all
lena_01.png
lena_02.png
lena_03.png
Re: PDF Bookmarks to individual file names
Unfortunately appending the file names doesn’t help my situation. The PDF bookmarks contain order numbers. I’d like to name my PNG files according to those order numbers.
Acrobat will let me split the pdf into individual pages & use the bookmark as the file name. I can then convert the entire folder to PNG. It’s a longer less organized process but it gets the job done.
Acrobat will let me split the pdf into individual pages & use the bookmark as the file name. I can then convert the entire folder to PNG. It’s a longer less organized process but it gets the job done.
Re: PDF Bookmarks to individual file names
You need some programming using some library that can handle PDF bookmark, for example Apache PDFBox in Java.
Following page would be your help: https://memorynotfound.com/apache-pdfbo ... f-example/
You can also split it to single page pdf files in it, so then write a script that convert to png using ImageMagick.
Following page would be your help: https://memorynotfound.com/apache-pdfbo ... f-example/
You can also split it to single page pdf files in it, so then write a script that convert to png using ImageMagick.