1
I have a scanned PDF file, where different pages have different page widths due to how the PDF was concatenated from multiple sources. This tends to trip up viewers.
Is there some command line tool, that can assign all pages the same width?
Since the scan is large and already strongly compressed, the actual bitmap images should remain unchanged, and OCR text, if any, should be preserved in the process.
For example:
- Before.
- Page size 15x10 cm
- Image display size 15x10 cm
- Image pixel size 1500x1000
- After.
- Page size 30x20 cm
- Image display size 30x20 cm
- Image pixel size 1500x1000, unchanged binary data stream.
A solution using imagemagick would be preferred, as it is readily available to shell scripts through Cygwin. I do however suspect, that it may not be possible to prevent imagemagick from re-encoding the images.
That works indeed! Except for the weird corner case, that pages with landscape proportions are automatically rotated 90° counter-clockwise. Do you know, if there is any way to keep the orientation? – kdb – 2018-09-28T16:12:07.280