Hi All,
interesting situation here. I have a few PDFs where random pages are inverted with white text on black background. I want to convert the entire document back to black text on white background, by specifying on the command line which pages to invert.
I found this useful blog post: http://blog.dillfrog.com/how-to-invert- ... agemagick/
It shows to specify frame/page numbers like so:
convert -density 300 -negate "in.pdf[24-28]" out.pdf
The problem is, there are pages I want to skip in the inversion process, but still have them in the final "out.pdf".
Is this possible? Can I specify only to invert pages 1 and 2 of a 10-page document, but still have a 10 page output file (with pages 3-10 untouched)?
I was thinking something such as this would be useful, using the caret to specify which pages to skip: convert -density 300 -negate "in.pdf[^0-23][24-28]" out.pdf
Specifying pages/frames to read - converting PDF
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Specifying pages/frames to read - converting PDF
I do not believe that you can do what you want. You will likely have to process it in two commands, one for the inverted pages and another for the non-inverted pages.
You can skip frames, but you only get output the frames you tell it to use.
You can skip frames, but you only get output the frames you tell it to use.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Specifying pages/frames to read - converting PDF
Also as IM is using ghostscript to convert the pages to raster format it will convert ALL the pages first then extract the ones specified. It does not have a true understanding of the PDF format.
you are better off using PDF specific tools to extract the desired pages first, then use ImageMagick later.
you are better off using PDF specific tools to extract the desired pages first, then use ImageMagick later.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/