quarta-feira, 2 de junho de 2010

pdfposter



Go to official pdfposter website here.

This tool is very simple and good. You can split a PDF document into several to create a poster. See the example bellow:


pdfposter -p 4x4a4 /tmp/drawing.pdf /tmp/out.pdf


input: 1 page, A0, pdf file:
drawing.pdf


output: 16 pages, A4, pdf file:
out.pdf


But there is a problem... printers usually have a printable area, so you need to add a margin to your document in order to don't lose anything when you print it. Here is how I did it for the example above.

First, use pdfposter to create a smaller version (160x247mm, that means 2.5mm of top, bottom, left and right margins).

pdfposter -m160x247mm -pA0 drawing.pdf out.pdf


After that, create a TeX document that will include this pdf, place each page inside a A4 page and include cropping marks. Here is the source code:

\documentclass{article}
% Support for PDF inclusion
\usepackage[final]{pdfpages}
% Support for PDF scaling
\usepackage{graphicx}
\usepackage[dvips=false,pdftex=false,vtex=false]{geometry}
\geometry{
paperwidth=160mm,
paperheight=247mm,
margin=2.5mm,
top=2.5mm,
bottom=2.5mm,
left=2.5mm,
right=2.5mm,
nohead
}
\usepackage[cam,a4,center,dvips]{crop}
\begin{document}
% Globals: include all pages, don't auto scale
\includepdf[pages=-,pagecommand={\thispagestyle{plain}}]{/tmp/out.pdf}
\end{document}


And... voilà! Here is the final pdf. And it page will be like this:

7 comentários:

  1. Very useful, thanks for sharing! :)

    ResponderExcluir
  2. Perfect, exactly what I was looking for. I am wondering why pdfposter doesn't include printing margins in the first place (what's the purpose otherwise?), but this procedure saves this otherwise useless python script.

    ResponderExcluir
  3. There is an overlap_option.patch contained in
    https://build.opensuse.org/package/files?package=pdfposter&project=devel:languages:python

    This patch addresses exactly this issue by adding an overlap margin on the PDF pages. E.g. -O 5 gives an overlap of 5 percent.

    The latex solution looks much nicer, but I wanted to have a solution inside pdfposter itself.

    ResponderExcluir
  4. It seems that the author is working on this feature: https://gitorious.org/pdftools/pdfposter/commits/feature/overlap

    ResponderExcluir
  5. 2.5 mm or 2.5 cm? One time you subtracted 2.5 cm each side, and in the tex file you have written 2.5 mm. That is a little bit confusing.

    ResponderExcluir
  6. Hi

    I have a single A4 landscape PDF page with almost no margin that contains very dense small text.
    I wish to print as 2 x 2 landscape A4 so it is readable and tape the pieces together .

    I tried this with pdfposter (very nice app !).
    Becasue pdfposter does not consider printer margins scaling errors are produced.

    I do not know latex.

    Can anyone help ?

    ResponderExcluir
  7. @K Smith

    The guy has very kindly provided a TeX script. I have never seen TeX or LaTeX before but I googled around was able to make use of it.

    The beauty of his blog post is that you don't need to "know Latex", you just need to "use google".

    Thanks to the original poster!

    ResponderExcluir