Rotate every second page of a pdf-document
I have several thousand 2-page PDF-files where the second page is rotated 180 degrees relative to the first. I would like to rotate the upside down page so that I have a nice straight forward document. I am able to do this using several Imagemagic commands per document:
convert -density 300x300 original.pdf[0] scra01.pdf convert -density 300x300 -rotate 180 original.pdf[1] scra02.pdf convert -density 300x300 scra01.pdf scra02.pdf new_complete.pdf But can I do this in one command? Knut |
Hi!
If it is the second document always, you can use a loop and a counter, and only change those documents (pdfs) who are even numbered (based on the counter). In pseudo code: Code:
counter = 0 HMW |
@HMW: The OP wants to rotate *pages* in a document, not documents.
PDFTK has options to rotate single pages. From the man-page: Quote:
Edit: Okay, PDF Chain is cool, too. It lets you work on several documents simultaneously, select pages and manipulate only selected pages. Rotation is easy. |
PDFtk looks fine, I would rather avoid convert pdf to image (makes text non searchable, non selectable etc)
|
Quote:
HMW |
Quote:
|
PDFtk or Imagemagic
Thank you for your answers and recomendation of PDFtk. I already looked into it and I'm quite sure it will do the job. But since Fedora 23, with KDE, do not have this in its standard repositories I found it a bit more of a hassle to install it. Besides I'm also curious as to how to work with multi page documents (PDF or TIFF) in Imagemagic.
Knut |
All times are GMT -5. The time now is 03:44 PM. |