1

My PDF has a custom paper format of 170mm:240mm and is intended for print publishing in that size. At home, I can only print on A4 paper. How do I print the PDF in such a way that

  • the content is printed in original size (not scaled up/down) and
  • the borders of the intended paper size are visible (e.g. black lines around the 170mm:240mm within the A4 sheet that comes out of the printer)?

This is needed because I have to manually adjust the margins, and seeing the margins on paper is better for me than seeing the file on screen. I use evince to print the file, but am not limited to that. A command line solution would be appreciated.

I intend to make adaptions quickly: print, maybe cut the intended page out of the A4 sheet, change margins in in source, recompile, repeat. In this workflow, adding a border using gimp is not a good solution.

The document is created in LaTeX, and it’s probably possible to create the borders in LaTeX, but I would prefer a command line solution that doesn’t mess with the soure. If this isn’t possible, I’ll head over to tex.sx.

2 Answers 2

4

You can do it with pdflatex itself and the pdfpages package; you can keep the original file unmodified and process it with a separate file:

\documentclass[a4paper]{article} \usepackage{pdfpages} \begin{document} \includepdf[noautoscale=true,frame=true]{smaller-size.pdf} \end{document} 

Name that big-size.tex and just run pdflatex on that, and you're all set.

Or you can use pdfjam (which itself uses pdflatex and pdfpages for you) from the command line in a single step:

pdfjam --scale 1.0 --frame true --noautoscale true --a4paper -o big-size.pdf smaller-size.pdf 

I think pdfjam comes bundled with TeXlive at least in most distributions.

1
  • Perfect, I didn’t know about pdfjam. Works as intended! Commented Mar 25, 2022 at 10:03
0

If the pdf file is not very big (few pages only), you could import it in GIMP, extend each page (treated as layer in GIMP) to A4, draw the border, then export back to pdf. This can also be automated if you write a personalized GIMP script...

1
  • Thanks, but since I will make only small adaptions and then recompile, importing in gimp and editing there is just too much of a hassle Commented Mar 25, 2022 at 12:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.