Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add margin to pdf page

Tags:

printing

pdf

I have a pdf book that is not showing up completely. I have attached a screenshot of acrobat's print preview showing what the issue is. As you can see there is more conentent on the left of the page that is not showing up.

PDF book with more content to the left

I have tried: Changing the paper size Changing the dimensions to "fit" Opening in Google docs Opening in mac's preview Opening in Google Books.

Any ideas of what I can try

like image 833
Dejan Zelic Avatar asked Jan 15 '14 20:01

Dejan Zelic


People also ask

Can you add margins to a PDF?

This can be either a single page or a multiple page document. Select the Crop tool on the toolbar. In the toolbar below, select Add Margins. Hint: You can also access this feature by clicking either Edit, Page, Add Margins or Edit, Document, Add Margins on the PDF Annotator menu.

Can you adjust margins in Adobe Acrobat?

Click on Page Setup at the bottom of the section. In the Page Setup that appears, click on “Margins”. Set the margins and then press OK.

How can I add a border to a PDF?

In order to insert border in PDF, you can click the "Comment" > "Rectangle" option. Then you can select a rectangle and drawn throughout the document.


2 Answers

As a late answer and when using Linux, one can use the command line tool "pdfjam".

Add margins to pages

Desired result: remove 0.5 cm from top and bottom of page, add 2 cm to right margin. Keep page size (important)

pdfjam --fitpaper true --trim "0cm 0.5cm -2cm 0.5cm" input.pdf -o output.pdf
  • Negative numbers in the trim-argument means "add", while a positive means "remove".
  • The four numbers within the trim-arguments relates to the left, bottom, right and top margin
  • If fitpaper is set to false the trim will move the content around the page and not resize the page.
  • You can add "--frame true" to see what's going on.

Move content to the left

Desired result: make right margin 1 cm larger and left margin 1 cm smaller

pdfjam --offset "-1cm 0cm" input.pdf -o output.pdf

The command below will move the content of the page 1 cm from right to left.

pdfjam and documentation

Documentation about pdfjam can be found here: http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-research/firth/software/pdfjam

The combination of pdfinfo, pdftk and pdfjam can be used to modify PDFs quickly on a more advanced level.

like image 94
user3760158 Avatar answered Sep 20 '22 19:09

user3760158


If I was you, I would check if PDF page boxes are correct. Especially if document looks fine in viewer but offset in print preview.

The issue might be caused by any of the boxes defined so they are outside of MediaBox.

Another approach to try is to impose this document onto other document with some offset. Others recommend Multivalent and Ghostscript for the task.

like image 28
Bobrovsky Avatar answered Sep 18 '22 19:09

Bobrovsky