How to use the PDF margin tool
- Drop a PDF onto the box or press Choose a file.
- Enter Top, Bottom, Left and Right in millimetres. Each starts at 15 mm; set a side to 0 to leave it alone.
- In Pages, leave
allor type the pages to change, for example1orodd. - Press Add margins and download the result, named with
-marginsadded.
What it does and when to use it
Some PDFs are made edge to edge, with text right up to the border. That causes trouble in a few common situations:
- Hole punching and binding. A ring binder or comb binding eats 10–20 mm of the left edge. Add a left gutter so no words are punched through.
- Notes and marking. Teachers and reviewers want white space to write comments on a printout.
- Printers that cannot print to the edge. Most office printers leave an unprinted strip, and anything placed there is cut off.
- Slides and screenshots that look cramped when placed in a report.
For the reverse job, trimming white edges off, use the PDF cropper.
How it works
A PDF page has a set of boxes that define its size: the media box (the full sheet) and the crop, trim and bleed boxes inside it. pdf-lib (@cantoo/pdf-lib) extends all four outwards by your margins, so the page itself gets bigger while the drawing on it is untouched. Margins follow the page as you see it, so on a page that is displayed rotated, “Top” is still the top as it appears on screen. Millimetres are converted at 72 ÷ 25.4 points per millimetre. It all happens in your browser and the file is never uploaded.
Worked examples
Binding margin on an A4 report. Top 15, Bottom 15, Left 25, Right 15, Pages all, on a 12-page A4 file. The summary reads Margins added (top 15, right 15, bottom 15, left 25 mm) — pages are larger, nothing is scaled. Each 210 × 297 mm page becomes 250 × 327 mm, with the content shifted 25 mm in from the left edge.
A 20 mm gutter for hole punching. Top 0, Bottom 0, Left 20, Right 0. An A4 page becomes 230 × 297 mm, and the extra space is all on the left.
Space for a cover stamp. Top 30 and the other sides 0, Pages 1. Only the first page grows by 30 mm at the top, leaving room for a received stamp or a note. Add typed text there with Add Text to PDF.
Limits and tips
- Pages of different sizes all get the same margins in millimetres, so they stay different sizes.
- To put page numbers in the new space, run PDF page numbering afterwards and set the distance from the edge to suit.
- Password-protected files must be unlocked first with Unlock PDF.
- A page number outside the file gives an “out of range” message.
Frequently asked questions
Will my pages still print on A4?
Is the content changed or squashed?
How do I add a gutter for double-sided binding?
Can margins be different on each side?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.