Search code examples
pdfimagemagickpdftk

letter-size pages scanned to PDF as legal size. How can I "trim" off the top?


We have 22 pages of legal documents that were originally on letter size paper. The originals were lost in a fire. The lawyer's office has a PDF with scans of the originals but the scan was done with "legal" size. Is there any way to redo the PDF and have it only use the "letter size" portion of each page?
I've look at pdftk and magick and haven't seen any options that will do this. My best guess is to explode the 22 page3 PDF to 22 separate graphic files, resize them using Paint.net, then create a new PDF using pdftk. I know how to do all that except the "export PDF page as graphic image" part.

screen capture

Update 18-Jan-24 : I'm unable to include a copy of the original document because it contains PII. Both of the answers below are good. I used the 2nd one as it was easier.


Solution

  • You have posted an image that is already in letter size (612x792pixels). If you really have a PDF in legal format, please post the actual PDF. If that is the case, likely you can do the following in Imagemagick.

    convert -density 72 image.pdf -gravity south -crop 612x792+0+0 +repage result.pdf
    

    ADDITION

    The above works, but since I cannot post the PDF or a zip of it directly, I have used

    convert -density 72 image.pdf -gravity south -crop 612x792+0+0 +repage result.png
    

    enter image description here

    Or whatever output suffix that you want.

    Always best to provide the version of IM that you use and your OS.