How to include a scanned document into a LaTeX-PDF file keeping the file size
small and optionally occupying the whole page?
- Scan the document page with a resolution of about 300dpi. Higher values are
possible, of course, but 300dpi is good enough for most scenarios.
Save the scanned document as a TIFF file or any other lossless image format.
- Open the image file from the previous step in a good graphics program, e.g.
GIMP, and do the following manipulations:
* Change the color mode from RGB to Grayscale unless you *really* need colors.
* Increase the contrast by about 70%. This will lead to black letters with
sharp edges.
* Convert to an Indexed Pallette with a size of about 8-16, depending on the
complexity of the document. For a typical text document, maybe with a logo
somewhere, eight slots should suffice.
* Edit the pallette, find out which slot contains the color used for the
page's background and replace this with pure white, if necessary.
* Save the image as TIFF file without compression
- Include the TIFF file into a LaTeX document using the \includegraphics command
from the graphicx package.
- If you scanned a whole page you will want the scanned image to occupy the full
page width and height. For this scenario use a document like this and process
it with pdflatex:
\documentclass[a4paper]{article}
\pagestyle{empty}
\usepackage[pdftex]{graphicx}
% maximize usable page area
\usepackage{geometry}
\geometry{top=0cm,bottom=0cm,left=0cm,right=0cm,nohead,nofoot}
\begin{document}
\includegraphics[width=0.97\textwidth]{my-scanned-document.tif}
\end{document}
Because of the fact that the \geometry command affects the whole document it
will be hardly possible to mix normal text pages with full page images
directly.
But you can generate seperate documents and then create a mixed document with
pages from both of them. The package pdfpages provides the \includepdf command
that you can use multiple times to build a new document from several PDF
files:
\documentclass[a4paper]{article}
\pagestyle{empty}
\usepackage{pdfpages}
\begin{document}
% include pages 1,2,3 from other.pdf
\includepdf[pages={1-3}]{/path/to/other.pdf}
% include pages 3,4,5,6,7,9 from another.pdf
\includepdf[pages={3-7,9}]{/path/to/another.pdf}
\end{document}
2005-07-25 Joachim Jautz http://www.jay-jay.net/contact.html