[Tex/LaTex] Full page image as title page

graphicskoma-scripttitles

Background

Wrote a technical manual in LyX. The technical manual currently has two parts:

  • Cover image (PDF)
  • Manual text (PDF)

Problem

When merging the two PDF files (with GhostScript or other software tools), there are a number of issues:

  • Bookmarks (lost in merging)
  • Colours (obvious changes)
  • PDF tags (lost in merging)

I would rather include the cover page image as a full page (no margins) at the start of the manual and have LyX (LaTeX) generate the front page when it creates the PDF. In this fashion, the cover page and the manual text need not be merged as a separate step.

Question

How do you instruct LaTeX to generate a full page image as the first page in a PDF using KOMA-Script?

Update

Using the pdfpages package produces the following result:

Image

Note the white space above and below the image. The white space is removed using the following:

\includepdf[fitpaper]{cover}

Update

Part of the preamble contains:

% Resize figures that are too wide for the page.
\let\oldincludegraphics\includegraphics
\renewcommand\includegraphics[2][]{%
  \graphicsformat{%
    \oldincludegraphics[width=\ScaleIfNeeded,#1]{#2}%
  }%
}

The full preamble is at: http://pastebin.com/qHKEDPeU

The error message is:

!pdfTeX error: pdflatex (file cover.pdf): cannot find image file

The file ch_02.lyx and test.latex are in the same directory. The file test.latex is the document in Martin's post. The file test.latex can find the file cover.pdf, yet the file ch_02.lyx cannot find the file. Both use the following code:

\includepdf[fitpaper]{cover.pdf}

Update

The most minimal LyX example that produces the problem:

#LyX 1.6.7 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass scrbook
\begin_preamble
\usepackage{pdfpages}
\end_preamble
\use_default_options false
\language english
\inputencoding utf8
\font_roman lmodern
\font_sans helvet
\font_typewriter courier
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\float_placement H
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks false
\pdf_backref false
\pdf_pdfusetitle true
\papersize letterpaper
\use_geometry false
\use_amsmath 2
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\bullet 0 5 11 -1
\bullet 1 5 24 -1
\bullet 2 0 0 -1
\tracking_changes false
\output_changes false
\author "" 
\author "" 
\end_header

\begin_body

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
includepdf[fitpaper]{cover.pdf}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Test
\end_layout

\end_body
\end_document

Thank you!

Best Answer

You can use the pdfpages packages (not to be confused with pgfpages) to include a PDF image/page as single page(s) to your document. This is useful for appendices or cover pages. Depending on your needs you should make sure that the page numbers are not counted for the cover page and the white filler page after it.

\documentclass{scrbook}

\usepackage{pdfpages}

\begin{document}
\includepdf{cover}
\cleardoublepage
\frontmatter
\tableofcontents
\mainmatter
\chapter{A}
...
\chapter{B}
...
\end{document}

Update:

As Bruno already commented, the fitpaper option of the pdfpages package will fit the page size of the first page to the size of the cover, removing excess white space. The option can be used as part of the \includepdf[<options>]{<file>} command.

This is fine for screen view, but for print-outs you should ensure that the cover and the normal pages have the same size from the beginning, either by recreating the cover with a larger height or by reducing the document size.