proper PDF cropping impossible for gnu linux users?
Anonymous <[email protected]> Fri, 25 Oct 2013 20:17:20 -0400 (EDT)
| Newsgroups | gmane.test,gmane.comp.video.image-magick.user |
|---|---|
| Message-ID | <[email protected]> |
I've struggled for a good ten years to find a way to simply crop a PDF
document of a scanned and OCRd image. To date, this is the best
approach:
1) use pdfshuffler to "crop" the raster image contained in the PDF
(via the gui).
Note that like all PDF cropping tools, pdfshuffler does not
perform an honest crop. That is, it merely gives the /illusion/
that the image is cropped by changing the displayed portion
(called the "CropBox" in postscript terms). This means if you do
a crop to remove sensitive information from a PDF document before
distribution, the recipients can easily extract the entire
original image!
2) Then use imagemagick to make it an "honest" crop. Normally one
would:
convert -define pdf:use-cropbox=true\
dishonest_crop_from_pdfshuffler.pdf\
honest_crop_from_im_72dpi.pdf
But there's a problem with that. Imagemagick does not preserve
quality automatically. To perform the above without losing
quality, add the density option:
convert -define pdf:use-cropbox=true\
-density 300\
dishonest_crop_from_pdfshuffler.pdf\
honest_crop_from_im_300dpi.pdf
Although the above approach results in a true and honest crop, there
is still a problem. OCRd text is lost in the process, leaving the
user purely with a 1-bit raster image.
Windows users have the option of using "Paperport", which can crop a
text+graphics PDF file, preserve the OCRd text, and trully destroy the
bits of the image that are cropped off. Is there no way to do this
with gnu tools?