Imposition of pages using LaTeX

Imposition is one of the fundamental steps in the prepress printing process. It is the arrangement of the printed product’s pages on the printer’s sheet, in order to obtain faster printing, simplified binding and reduced paper waste. Example:

For more info read following link:


  • Install LaTeX using command: $ sudo apt-get install texlive-full
  • A pdf you want to print as a book e.g.


  1. If you want two blank pages at the start and end of the booklet, then follow this step. Copy the following code in tex file.
\usepackage[final]{pdfpages} % for including pdf file
\includepdf[pages={{},{},-,{},{}}]{complete path to your pdf file} % two empty pages at the start and end of the pdf

Compile the above code using command: $ pdflatex filename.  This will give you a pdf with four empty pages two starting and two at the end (means four extra pages)

 2. Rotate the pages at 90° angle with imposition of two pages on a single page. For this use following code:

\pdfpagewidth 283mm
\pdfpageheight 460mm
\usepackage[final]{pdfpages} %for including pdf files 
\includepdf[pages=-, signature=32,landscape]{demo.pdf} % dash means all pages, signature is the number of pages in each package landscape=90° angle
  • In the above code pages=- means all the pages in a pdf
  •  signature is the number of pages in each package(bundle)
  • Here I take this value 32 because I need 32 pages in a bundle.
  • landscape=90° angle

Compile the code with same command. o/p file is: two pages on one page with 90° rotation. And number of pages get reduced by half.

3. Now If you want four pages on single page, do following. Now in a bundle, 32 pages are on 16 pages because two pages on a single page thats why here I take signature as 16

\pdfpagewidth 7.25in
\pdfpageheight 15in
\usepackage[final]{pdfpages} % to include pdf
\includepdf[pages=-,signature=16,landscape]{imp.pdf} % dash means all pages, signature is the number of pages in each package landscape=90° angle

Convert rgb pdf file to cmyk

First we need imagemagick. Install it using following command:

$sudo apt-get install imagemagick

Following commands convert the rgb pdf file  to cmyk

1. Check whether the test.pdf is rgb or cmyk

$ identify -verbose ‘test.pdf’

It displayes the many properties. Check colorspace: rgb /cmyk

If it displayes cmyk, then its ok. Otherwise need to convert into cmyk

2. To convert rbg to cmyk use following command:

$ gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite -sColorConversionStrategy=CMYK -dProcessColorModel=/DeviceCMYK -sOutputFile=output.pdf input.pdf

It displays the following output:

Replace the input.pdf with your test pdf file

3. Now again check the properties of pdf file by following command:

$ identify -verbose 'test.pdf'

It displays the following output:

Installation of LaTeX

Install LaTeX in Ubuntu

To install LaTeX on Linux do following steps:

$ sudo apt-get install texlive

The above command will install a basic subset of TeX Live’s functionality. To install all the packages in the LaTeX distribution,  you have to run the following command.

$ sudo apt-get install texlive-full

Introduction to LaTeX

LaTeX  is a document markup language and document preparation system for the TEX typesetting
program. Within the typesetting system, its name is styled as LaTeX. LaTeX refers only to the language in which
documents are written, not to the editor used to write those documents. In order to create
a document in LaTeX, a .tex file must be created using some form of text editor. While most
text editors can be used to create a LaTeX document, a number of editors have been created
speci cally for working with LaTeX.
LaTeX is most widely used by mathematicians, scientists, engineers, philosophers, lin-
guists, economists and other scholars in academia. As a primary or intermediate format,
e.g., translating DocBook and other XML-based formats to PDF, LaTeX is used because
of the high quality of typesetting achievable by TeX. The typesetting system off ers pro-grammable

desktop publishing features and extensive facilities for automating most aspects
of typesetting and desktop publishing, including numbering and cross-referencing, tables and
gures, page layout and bibliographies.

LATEX was originally written in the early 1980s by Leslie Lamport at SRi international

Convert pdf file to html file

Two methods for converting the pdf  file into html file

  1. Use online converter :
  2. Install poppler-utils in Ubuntusudo aptitude install poppler-utils. This will complete the installationUsing pdftohtmlpdftohtml Syntaxpdftohtml [options] [pdf file] [html file]

             For more help : $ pdftohtml -h

A summary of options are included below:

-h, -help – Show summary of options.

-f – first page to print

-l – last page to print

-q – don’t print any messages or errors

-v – print copyright and version info

-p – exchange .pdf links with .html

-c – generate complex output

-i – ignore images

-noframes – generate no frames. Not supported in complex output mode.

-stdout – use standard output

-zoom – zoom the pdf document (default 1.5)

-xml – output for XML post-processing

-enc – output text encoding name

-opw – owner password (for encrypted files)

-upw – user password (for encrypted files)

-hidden – force hidden text extraction

-dev – output device name for Ghostscript (png16m, jpeg etc)

-nomerge – do not merge paragraphs

-nodrm – override document DRM settings

Installation of Django

Type the following commands in terminal:

#tar xzvf Django-1.3.tar.gz
#cd Django-1.3
#sudo python install

You can verify that Python is installed by typing python from your shell; you should see something like:

Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)

[GCC 4.0.1 (Apple Inc. build 5465)] on darwin

Type “help”, “copyright”, “credits” or “license” for more information.


To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django:

>>> import django

>>> print django.get_version()