1

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: http://en.wikipedia.org/wiki/Imposition

Prerequisites:

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

Procedure:

  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.
documentclass{article}
\usepackage[pdftex]{color,graphicx,epsfig}
\usepackage[final]{pdfpages} % for including pdf file
\begin{document}
\includepdf[pages={{},{},-,{},{}}]{complete path to your pdf file} % two empty pages at the start and end of the pdf
\end{document}

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:

\documentclass[12pt,twoside]{article}
\pdfpagewidth 283mm
\pdfpageheight 460mm
\usepackage[pdftex]{color,graphicx,epsfig}
\usepackage[paperwidth=283mm,paperheight=460mm,left=0cm,top=0cm,bottom=0cm,right=0cm]{geometry}
\usepackage[final]{pdfpages} %for including pdf files 
\begin{document}
\includepdf[pages=-, signature=32,landscape]{demo.pdf} % dash means all pages, signature is the number of pages in each package landscape=90° angle
\end{document}
  • 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

\documentclass[12pt,twoside]{article}
\pdfpagewidth 7.25in
\pdfpageheight 15in
\usepackage[pdftex]{color,graphicx,epsfig} 
\usepackage[paperwidth=15in,paperheight=20in,left=0in,top=0in,bottom=0in,right=0in]{geometry} 
\usepackage[final]{pdfpages} % to include pdf
\begin{document}
\includepdf[pages=-,signature=16,landscape]{imp.pdf} % dash means all pages, signature is the number of pages in each package landscape=90° angle
\end{document}
4

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:

0

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

2

Convert pdf file to html file

Two methods for converting the pdf  file into html file

  1. Use online converter :http://www.convertpdftohtml.net/
  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

0

Installation of Django

Type the following commands in terminal:

#wget http://media.djangoproject.com/releases/1.3/Django-1.3.1.tar.gz
#tar xzvf Django-1.3.tar.gz
#cd Django-1.3
#sudo python setup.py 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()

1.3


1

How to install LAMP

Type the following commands in terminal:

$sudo apt-get install apache2

Then type y

$sudo apt-get install php5 libapache2-mod-php5

Type y

$sudo apt-get install mysql-server mysql-server

Type y

After this fill the password as username ‘root’

then press Tab

then press space to select ok

$sudo apt-get install phpmyadmin

press y

Firstly press Space to select apache2

then press Tab and then Space to select ok

Press Tab and Space to select ok

Press Tab and Space  to select yes

Fill password here. Then press Tab and Space to select ok

then press Tab

then press Space to select ok

Retype the same password to confirm

$sudo apt-get install libapache2-mod-auth-mysql php5-mysql

$sudo /etc/init.d/apache2 restart

output:

Open with browser:

http//:localhost

it shows :

Then open in browser:

http//:localhost/phpmyadmin

login with username and password