3

I have a file fooo.pdf with dimension 210mm x 70mm and 6 pages (simple grey background).

I'm using pdfpages to include the pages inside an A4 page.

So the ideal number is 4 pages per page. But the problem is that the output has a blank page at the beginning.

Why? How to fix it?

MWE

\documentclass{report}
\usepackage[margin=0cm,a4paper]{geometry}
\usepackage{pdfpages}
\begin{document}%
\noindent\includepdf[nup=1x4,pages=-]{fooo.pdf}%
\end{document}

Output

enter image description here

  • 2
    What happens without \noindent? If the problem persists, you can always discard it internally using atbegshi... – Werner Jan 6 '15 at 18:49
  • I can not believe!! So simple! It works. Thanks @Werner. – Sigur Jan 6 '15 at 18:50
  • It token me 5 minutes to prepare the counter example and just 5 seconds to solve. – Sigur Jan 6 '15 at 18:51
  • @Werner, how can I know that \parindent is not being used in front of included pdf page? Just setting the left margin to zero is not enough to remove the space! – Sigur Jan 6 '15 at 18:56
  • The placement of pages using \includepdf always inserts it on a blank page and doesn't take any of the page margins into account (as far as I know). You can change things like the offset or deltas. The only reason why page layout would be considered is if you use \includegraphics[page=..]{<pdf>}. – Werner Jan 6 '15 at 19:02
2

pdfpages inserts \newpage before inserting any content, as well as after the content has been inserted. As such, anything set before the issue of the \newpage would cause a complete page break. The primitive \noindent here switches to horizontal mode and therefore initiates a paragraph, even though nothing is set. As such, the \newpage leaves a visible blank page. Remove it to avoid the first blank page.

You could also consider using atbegshi to process pages before they're shipped out, and perhaps conditionally (\AtBeginShipoutFirst) discard them using \AtBeginShipoutDiscard.

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.