7

I have a PDF document containing pages which have crop marks on them. I'd like to copy these pages to another PDF without the crop marks. I'm assuming I have to crop-out the crop marks but is there any way to do this in batch rather than interactively?

2

You can install ImageMagick to create a small batch script

example.bat:

convert yourpdf.pdf tempfile.png
convert -crop widthxheight+xoffset+yoffset *.png
convert *.png newpdf.pdf

This script temporarily convert the pdf pages into a series of images. Then crop all images (specify your width, height, x offset and y offset) Then reassembles all pages to new pdf file.

For more information about ImageMagick: http://www.imagemagick.org/script/command-line-processing.php

  • 4
    ... and pdf with text will became much heavier pdf with images – Alex Bolotov Dec 6 '10 at 22:06
  • 2
    ...non-searchable and non-text-selectable too. – paradroid Oct 25 '11 at 11:50
8

Briss lets you crop the margins of a pdf. It layers all the pages so you can visually crop them in one go. It takes maybe 20 seconds for you to do this for a pdf e-book. Then you can read it on the Kindle with all the original PDF formatting, but without wasting margin space. Usually the text size is around the same or a little bit smaller than the second smallest font size on the Kindle for ebook formats. I usually prefer it to Amazon's PDF converter service for PDF's that have images or code samples.

5

K2pdfopt can do this.

K2pdfopt optimizes the format of PDF files for viewing on small (e.g. 6-inch) mobile reader and smartphone screens such as the Kindle's. It is meant for text-based files on a white background which may also have graphics or figures. It is fully automated and can batch-process PDF files. K2pdfopt works by converting each page of the PDF file to a bitmap and then scanning the bitmap for viewable areas (rectangular regions) and cutting and cropping these regions and assembling them into multiple smaller pages without excess margins so that the viewing region is maximized. Any kind of PDF file (best if it has a primarily white background) can be converted. K2pdfopt works especially well on two-column PDF files such as IEEE and other technical journal articles (see examples below--it auto-detects two-column regions on the PDF page), but even single-column files will often be significantly improved and much easier to read (see examples). K2pdfopt has the advantage over other PDF converters in that it fully preserves the rendered PDF fonts and graphics from the original file, unlike programs that convert the PDF to an e-book format. Also, because k2optpdf is completely independent of language or fonts, it will work equally well on documents in any language.

As an example, to optimize all pdfs in the folder K2pdfopt is located, run k2pdfopt.exe *.pdf.

http://www.willus.com/k2pdfopt/

3

Nitro PDF worked well enough. I selected the area to crop and then applied it to all pages.

Now it would be nice to enlarge the page.

0

Without needing to install anything outside of Office and Acrobat, you can make a VBA/VBS Script the loop the following cropping code:

Sub A4ReportCrop()

    Dim AcroApp As Acrobat.CAcroApp
    Dim Part1Document As Acrobat.CAcroPDDoc
    Dim Part2Document As Acrobat.CAcroPDDoc
    Dim numPages As Integer
    Dim rect, i

    Set AcroApp = CreateObject("AcroExch.App")

    Set Part1Document = CreateObject("AcroExch.PDDoc")
    Part1Document.Open "C:\Users\xyz\Desktop\20171121 IPS SPS DPS.pdf" '20171121 EXE2.pdf"
    Part1Document.OpenAVDoc "Working Doc"

    Set rect = CreateObject("AcroExch.Rect")
    rect.Top = 805
    rect.Left = 36
    rect.bottom = 500
    rect.Right = 500

    AcroApp.Show
    AcroApp.Maximize 1

    i = Part1Document.CropPages(0, 0, 0, rect)
    Debug.Print "Crop Status: " & i

    If Part1Document.Save(PDSaveFull, "C:\Users\xyz\Desktop\Temp_" & _
                        Format(Now, "YYYYMMDDHHNNSS") & ".pdf") = False Then
        MsgBox "Cannot save the modified document"
    End If

    Part1Document.Close
    AcroApp.Exit

End Sub
  • I indented your code, and split a line, for readability; please check that I didn’t damage it. – G-Man Nov 21 '17 at 2:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.