|


| |
PDF-FAQ
Frequently Asked Questions about Adobe
Portable Document Format
Maintained by Francis Wright
(but not seriously since 2004);
last updated 23 March 2010
Comments and additional questions and/or answers are welcome
[ Generic
| UNIX | Windows | Links
| Glossary ]
This section covers generic questions and answers; where an answer depends on
the platform it includes a link to the same question in a later
platform-specific section.
- Q: Where can I find more general guidance, especially about local
aspects of putting course information on the Web?
A: See Peter Cameron's document Putting course
information on the Web, and links therein.
- Q: How can I use
pdf(la)tex or dvipdfm
to generate PDF from a (LA)TEX document that includes
graphics in EPS format?
A: You can't do this directly, because current versions of pdf(la)tex
and dvipdfm accept graphics in EPDF, PNG and JPEG formats only.
Possible solutions:
- Convert your EPS graphics to EPDF. This requires Ghostscript and
can be done either explicitly or automatically: for
pdflatex
see below; for dvipdfm there is a configuration option
explained in the dvipdfm manual (texmf/doc/dvipdfm/dvipdfm.pdf,
section 14).
- Use
(la)tex, then dvips, then Ghostscript to
generate respectively DVI, then PS, then PDF.
- Q: How can I convert EPS graphics to EPDF for inclusion in PDF
files?
A: A conversion program called epstopdf
written in either Perl or C is available that uses Ghostscript to convert
EPS to EPDF. One or other version should be included as part of a TEX
installation but it also requires Ghostscript. The command "epstopdf
--help" gives brief help and examples. For example, the
command "epstopdf Chap0806.eps" writes the file Chap0806.pdf
to the current directory. A number of EPS files can be converted at
once using a shell for loop. Alternatively, (pdf)latex
can perform the conversion automatically by using epstopdf.sty
(available from CTAN), but it still requires the conversion program epstopdf
to be correctly set up. [Windows]
- Q: How can I convert a DVI file to PS that can be converted to PDF
that scales well and so renders well on screen?
A: It is necessary to avoid bitmapped (i.e. MetaFont) fonts,
which Acrobat Reader is well known to render very badly on screen (see Example1.pdf). This is not a problem if
using standard Adobe fonts (Times, etc., see Example3.pdf),
but if using standard TEX fonts (Computer Modern, etc.) then it
is necessary to ensure that PostScript versions of the fonts are installed
and are used by dvips. The latter requires a suitable
configuration file; the invocation "dvips -Ppdf"
should ensure this (see Example2.pdf).
More precisely, it causes dvips to use BlueSky/AMS/Y&Y Type
1 fonts and an alternative rule drawing algorithm. [FJW claims that
this works well using Windows; other users claim that it does not work at
all on other platforms!] See also the UK TEX FAQ: Quality of
PDF from PostScript.
- Q: When I use fonts other than Computer Modern, such as Times or
Palatino, the DVI output looks fine but when I generate PS using
dvips,
ligatures such as "fi"and "fl" are replaced by
"£" and other strange symbols, e.g. "filter" is
replaced by "£lter". How can I avoid this?
A: This happens with non-CM fonts if you use the dvips
-G option, which is currently implied by the -Ppdf
option (see Example4.pdf). The
solution is either to use the dvips -G option
together with the -Ppdf option (see Example5.pdf), not to use the -Ppdf
option at all (see Example3.pdf), or to
edit the dvips configuration file config.pdf to
remove the G option.
[The reason (based on comments from Y&Y,
Inc. Support) is that the dvips -G option
remaps character codes 0 31 to 161 170,
173 195, which is a work around for a problem that
some old versions of Adobe Acrobat Reader had with CM fonts. For
example, "fi", which is character code 2 in "8r"
encoding, is remapped to character code 163, which is "£" in
"8r" encoding. See e.g. texmf/doc/fonts/txfonts/txfontsdoc.pdf,
section 7.5, for further details. The dvips documentation
seems to be out of date; run dvips with no arguments for a list
of options.] See also the UK TEX
FAQ: Weird
characters in dvips output.
- Q: Are there any simple examples of how to generate PDF from LATEX
source via PS using Computer Modern or Times fonts?
A: There is a set of five examples in the directory dvips; see the Read_Me file for
details. Each example provides a LATEX source
file, the resulting PDF file and a batch file that runs latex,
then dvips with various options, and finally ps2pdf.
- Q: Why do I get the wrong paper size when using PDFLATEX?
A: See http://physics.wm.edu/~norman/latexhints/pdf_papersize.html.
- Q: How can I manipulate PDF files?
A1: By using Sid Steward's free
pdf toolkit, which provides a
command-line program pdftk that can,
among other functions, merge, split, decrypt, encrypt, set access
permissions for, and repair PDF files. (For background, see
PDF Hacks by Sid
Steward, 296 pages, O'Reilly, August 2004, ISBN: 0596006551.) There is
also a nice GUI
for pdftk (and other PDF support tools) by Dirk Paehl.
See also the Multivalent
Document Tools.
A2: By installing PDFsam (PDF Split and
Merge), a nice Open Source Java application.
This section covers questions and/or answers that are specific to the UNIX
operating system and its close relatives: Linux, etc.
- Q: How can I merge PDF files?
A: [by Steve Schwartz] Run Ghostscript like this. Put
all your PDF files in a single directory, make it the current directory and
execute the command:
gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf *.pdf
(or if you want to specify the files, or merge them in something other than
alphabetic order, replace *.pdf by a list of files).
- Q: How can I split a PDF?
A: [by KP <kplee@enitco.com>]
Similarly, you can split a
PDF file by specifying the first page (m) and the last page (n) that you
want in the output file:
gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dFirstPage=m -dLastPage=n
-sOutputFile=out.pdf in.pdf
This section covers questions and/or answers that are specific to the
Microsoft Windows operating system. Much of the software described here
has been ported from UNIX. This section assumes that you are using the
current versions of the native Windows ports, in particular MiKTeX and Aladdin
Ghostscript. For other ports, in particular Cygwin ports, the UNIX section
of this FAQ may be more appropriate.
- Q: Where can I get TEX, Ghostscript, etc.
A: Some useful links are available here.
- Q: How can I use Ghostscript to convert PS to PDF?
A: There are two main user interfaces:
- The GSview GUI
- Open the PS file in GSview, select Convert... from the File menu,
select
pdfwrite as the Device and other options to
taste. This works well, and may be convenient for occasional
conversions, but it is overkill.
- The ps2pdf command
- Ghostscript includes
ps2pdf.bat for Windows, although the
installation does not automatically make the command available. It
is necessary to include the Ghostscript lib and bin
directories in the Windows execution path. You can do this
explicitly, e.g. by editing the file c:\autoexec.bat.
Or you can use another "indirect " command file that sets the
execution path and then runs the Ghostscript ps2pdf
command. The indirect command file can be put anywhere in the
default execution path or in the current directory. Two example
indirect command files are ps2pdf.bat and ps2pdfa4.bat. (If you download them, add the .bat
extension by hand when you save them.) These are set up for a
typical default installation of Aladdin Ghostscript 7.00; the second
forces A4 paper size in the PDF file.
- Note that, with the default installation procedure, the root of the
Ghostscript directory depends on the version of Ghostscript. The
indirect approach has the advantages of not increasing the length of the
global execution path and allowing the root of the Ghostscript directory
to be set once only in the indirect command file.
- Q: How can I convert EPS graphics to EPDF for inclusion in PDF
files?
A: MiKTeX provides the program epstopdf.exe, but it
also requires Ghostscript to be installed separately. It seems not to
be very robust but it does seem to work! To convert several EPS files
use a for loop; for example, the following MS-DOS command will
convert all the EPS files in the current directory:
FOR %f IN (*.eps) DO epstopdf %f
- Q: How can users print my PDF files in "n-up"
format, e.g. 2 or 4 logical pages per physical page?
A: There are at least two ways:
- By configuring the Acrobat printer driver
- In the Print dialogue, click on the Properties button, click the
Advanced tab and scroll down to Document Options. If there is a
Page Layout option then select the desired layout. Otherwise, you
need to install a better printer driver. Adobe provides suitable printer
drivers for free download. You need to remember to
select a suitable printer driver in order to be able to print "n-up".
[This may only work with a PostScript printer.]
- By providing PDF files in "n-up" format
- If you produce the PDF from PS then you can run the program
psnup
to convert the PS file to "n-up" format before
converting it to PDF. MiKTeX includes psnup and it is
configured by the default installation procedure to run from a command
prompt. Execute "psnup --help" for very
brief help or read the online manual texmf\doc\psutils\psnup.1.dvi.
[There are other useful PS manipulation programs in the psutils
folder.]
- Q: How can I generate (optionally hyperlinked) PDF from Microsoft Office
97 or 2000 applications?
A: Install and use the Open Source tool
GhostWord, which is an
interface to the Ghostscript package that makes it easy to create
hyperlinked PDF
documents from Microsoft Word, Excel or PowerPoint documents. GhostWord
installs itself in Word, Excel and PowerPoint, and you convert the documents
by simply clicking a toolbar button.
- Q: How can I generate PDF from any application that can print
output?
A1: The hard way is first generate a PS file and then convert it to PDF; see the
answers to the following two questions.
A2: The easy way is to install and use the free tool
PDFCreator,
which is an interface to the Ghostscript package that makes it easy to create
PDF documents (but without hyperlinks) from any application that
supports standard Windows printer drivers. (PDFCreator can also
produce other formats such as PS and EPS, merge PDF files, etc.)
- Q: How can I generate a PS or EPS file from any application that
can print output?
A: You need to have a suitable PS printer driver installed (although
there is no need for a physical PS printer); if you do not already have
one installed then see below. Then, in the application from which you
want to produce the output, select Print or Print Setup from the File menu
and then in the Print dialogue box select a PostScript printer and if
necessary check the option to Print to File. [You may need to change
the filename extension from .prn to .ps or .eps
once the file has been created.]
- Q: How can I install a PS or EPS printer driver?
A: Windows automatically provides a selection of PS printer
drivers (although I suspect that many of them are identical). Select
Start > Settings > Printers, open the Add Printer wizard, select File
as the port, and then select a PostScript printer; almost any printer with
"laser" in its name should suffice but a simple generic one is
probably safest. The HP LaserJet 4/4M PS printer driver seems to work
well. This will allow you to print to a PS file, but perhaps not
EPS. However, Adobe provides suitable
printer
drivers for free download. These have advantages over some
of the default Windows drivers, such as EPS output and support for n-up
printing: to use these facilities open the Properties dialogue from the
Print dialogue and select the appropriate PostScript options. The
Adobe "Generic PostScript Printer" driver is appropriate for producing files to be converted to PDF,
although the separately available Acrobat Distiller driver is probably best.
- Q: How can I merge PDF files?
A1: The hard way [by Steve Schwartz] is
to run Ghostscript like this. Put
all your PDF files in a single folder, open a Command Prompt window on that
folder and execute the command:
gswin32c -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf
in1.pdf in2.pdf ... If
the Ghostscript bin folder is not in your path, which is
probably the case, then give the full pathname for gswin32c,
e.g. e:\Ghostscript\gs8.00\bin\gswin32c.
A UNIX-style shell, such as Cygwin bash, provides better
control over the list of files to include. For example, to merge the
files in the default sort order into the file F.pdf, execute a command such as:
$ /e/Ghostscript/gs8.00/bin/gswin32c -sDEVICE=pdfwrite -dNOPAUSE -dQUIET
-dBATCH -sOutputFile=F.pdf *.pdf
or to merge a set
of files named F_1.pdf up to F_99.pdf in numerical
order into the file F.pdf, execute a command such as:
$ /e/Ghostscript/gs8.00/bin/gswin32c -sDEVICE=pdfwrite -dNOPAUSE -dQUIET
-dBATCH -sOutputFile=F.pdf F_?.pdf F_??.pdf
A2: The easy way
is to install and use the free tool
PDFCreator;
see above.
- Q: How can I split a PDF file?
A: [by KP <kplee@enitco.com>] Similarly, you can split a
PDF file by specifying the first page (m) and the last page (n) that you
want in the output file:gswin32c -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dFirstPage=m -dLastPage=n
-sOutputFile=out.pdf in.pdf
Commercial software
- pdfFactory
is FinePrint Software's standard tool for creating PDF files [on Microsoft
Windows only].
| Abbreviation |
Full Name |
Description |
| PS |
PostScript |
Adobe page description language that includes programming
facilities. |
| PDF |
Portable Document Format |
Adobe page description language based on PS that excludes
programming facilities but includes navigation, compression, etc. |
| EPS |
Encapsulated PostScript |
A version of PS intended for subdocuments (usually graphics)
to be included within other documents. |
| EPDF |
Encapsulated PDF |
A version of PDF intended for subdocuments (usually
graphics) to be included within other documents. |
| DVI |
DeVice Independent |
The standard TEX output format. |
| CTAN |
Comprehensive TEX Archive Network |
A place to get TEX -related files. The UK
CTAN site is www.tex.ac.uk (at
Cambridge). |
| PNG |
Portable Network Graphics |
A lossless
compressed bitmap graphics encoding particularly suitable for
diagrams; a patent-free replacement for GIF. |
| JPEG |
Joint Photographic Experts Group |
A compressed
but not lossless bitmap graphics encoding particularly suitable for
photographs. |
|