PDF

Contents

What is a PDF file?

PDF (Portable Document Format) is an open standard file format for document exchange. It is a fixed-layout format used for representing two-dimensional documents in a manner independent of the application software, hardware, and operating system.[1] This means that any recipient of a PDF document will have the exact same document displayed, which is a great advantage of the PDF document format. Furthermore, only a PDF viewer is needed to display any PDF document, and many PDF viewers are freely available, i.e. Acrobat Reader, Foxit Reader, KPDF, Xpdf. In the G-Bar, there are several PDF viewers available: Acrobat Reader, GhostView (gv), and Xpdf.

Create PDF files

If you want to create a PDF file, you have different options:

OpenOffice/StarOffice

If you create a document, a spreadsheet or a presentation in OpenOffice or in StarOffice you have the possibility of making it a PDF file. This is done by pressing the 'Export directly as PDF'-button at the second top bar. Next, you type the desired name of the PDF file and then 'Export'. Your OpenOffice or StarOffice document, spreadsheet or presentation has now been exported as a PDF file.

LaTeX

If you create a LaTeX document, you have the possibility of making it a PDF file. If you use the editor Texmaker, this is done in the following way: When you have saved your document, you press the 'PDFLaTeX'-button at the second top bar. In the bottom area, 'Messages/Log file', it should then say "Process started...Process exited normally". After this, you press the 'View PDF'-button (next to the 'PDFLaTeX'-button). Your LaTeX document is then viewed in the PDF viwer. As default, this is Xpdf. In Xpdf, you may right-click on the document and choose 'Save as...'. Type the desired file name and press 'Save'. Your LaTeX document has now been exported as a PDF file.

In Texmaker, if you wish to use another PDF viewer than the default viewer, this is done in the following way: Press 'Options' in the top bar and choose 'Configure TeXmaker'. At 'Pdf Viewer', you press the button to the right of the path of the current PDF viewer. This gives you the possibility of browsing for another viewer. You need to find the executable file of the viewer. These are normally placed in /bin, i.e. if you want to use Acrobat Reader, you go to /bin and double-click on 'acroread.disabled'. Press 'OK' in the 'Configure TeXmaker'-window. Your PDF viewer using TeXmaker is now Acrobat Reader.

Edit PDF files

If you want to edit PDF files, you have different options:

pdfmerge is a simple pdf merger, not many options.

 pdfmerge inputpdf1.pdf .. inputpdfN.pdf output.pdf


Pdf merging option2 joinPDF/splitPDF

splitPDF

splitPDF is a terminal based tool that enables you to split a PDF file into two or more PDF files.

If you wish to split a PDF file into two new PDF files, go to the directory where the original file is placed. In the terminal, you type:

splitPDF <sourcefile> <destinationfile1> <destinationfile2> <pagenumber>

<sourcefile> is the name of the original PDF file, and <destinationfile1></tt> and <destinationfile2> are the names of the new PDF files. <pagenumber> is the page number in the original PDF file that <destinationfile2> will have as its first page (the last page in <destinationsfile1> will be page number <pagenumber>-1 in the original PDF file).

With splitPDF you may also split a PDF file into single pages without specifying the name of the new PDF files, nor the number of pages. In the terminal, you type:

splitPDF <sourcefile>

which creates one new PDF file per page in the original PDF file in the same directory as the original file.

joinPDF

joinPDF is a terminal based tool that enables you to merge two or more PDF file into one single PDF file.

If you wish to merge three PDF files into one, go to the directory where the three PDF files are placed. In the terminal, you type:

joinPDF <destinationfile> <sourcefile1> <sourcefile2> <sourcefile3>

where <destinationfile> is the name of the new PDF file, and where <sourcefile1>, <sourcefile2> and <sourcefile3> are the names of the original PDF files. Obviously, the orginal PDF files will be placed in the new PDF file in the order that they are written in the above command.

GhostScript

Ghostscript can also be used to edit pdf files, e.g., merge them together. There are a wide variety of options, which can be seen in the manual-page. To merge pdf files into a single one:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=output.pdf 1.pdf 2.pdf ... 

pdfnup

pdfnup is a terminal based tool that enables you to compress the size of a PDF file by putting several pages from the original file on one page in the new file. That way you can economise with the number of pages you have to print. pdfnup offers a great pool of different options in regards to the number of pages from the original file to be put on one page in the new file, the placement of these pages, the orientation of the pages in the new file etc.

An example of use is the following:

pdfnup <original_file.pdf> --nup 1x2-outfile <new_file.pdf>

This will put two pages from <original_file.pdf> on each page in the new file <new_file.pdf>. Furthermore, these will be stacked vertically on the pages in the new file, due to --nup 1x2. If you want the pages to be side by side, you put --nup 2x1, if you want two pages side by side and three rows in total you put --nup 2x3 etc.

To see the complete list of options in the use of pdfnup, type

pdfnup --help

in a terminal on Linux.

Print PDF files

For printing PDF files, you have different options. If you open a PDF file in a PDF viewer (e.g. Acrobat Reader), you can print the document:

xpp and gtklp are applications for printing specified files on specified printers (see xpp and gtklp for more information).

Obviously, you can also print PDF files directly from xpp and gtklp.

References

  1. ^ http://en.wikipedia.org/wiki/PDF