summaryrefslogtreecommitdiff
path: root/gs/ps2pdf.txt
blob: 56ab4723d7377e34bb099ac7bdbba62cd90d2f6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
   Copyright (C) 1996, 1997, 1998 Aladdin Enterprises.  All rights reserved.
  
  This file is part of Aladdin Ghostscript.
  
  Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  or distributor accepts any responsibility for the consequences of using it,
  or for whether it serves any particular purpose or works at all, unless he
  or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  License (the "License") for full details.
  
  Every copy of Aladdin Ghostscript must include a copy of the License,
  normally in a plain ASCII text file named PUBLIC.  The License grants you
  the right to copy, modify and redistribute Aladdin Ghostscript, but only
  under certain conditions described in the License.  Among other things, the
  License requires that the copyright notice and this notice be preserved on
  all copies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


This file, ps2pdf.txt, contains some information about Ghostscript's
PostScript to PDF converter.

For an overview of Ghostscript and a list of the documentation files, see
README.  

About ps2pdf
============

ps2pdf is a work-alike for the functionality (but not the GUI) of Adobe's
Acrobat Distiller(TM) product: it converts PostScript files to PDF files.

ps2pdf is implemented as a very small shell script (batch file) that invokes
Ghostscript selecting a special "output device" called pdfwrite.  In order
to use ps2pdf, you must have included the pdfwrite device in the DEVICE_DEVS
list at the time Ghostscript was built.  Currently, this device is included
in the makefiles for all platforms.

The usage for ps2pdf is:
	ps2pdf input.ps output.pdf
or, on Unix systems and some versions of Windows NT and OS/2 only,
	ps2pdf input.ps
which is equivalent to
	ps2pdf input.ps input.pdf

The ps2pdf script assumes that the Ghostscript executable is named gs.  On
MS-DOS and MS Windows, you will need to edit the script (ps2pdf.bat) if the
MS-DOS executable is named gs386: look for the line that says
	set PS2PDFGS=gs
and change it to
	set PS2PDFGS=gs386
Note that to run ps2pdf on MS Windows, you need the MS-DOS executable: the
Windows Program Manager's 'run' command doesn't allow you to run .bat files.
Alternatively, you can run the "console mode" Windows executable by changing
the above line to
	set PS2PDFGS=gswin32c

Limitations
===========

The most serious limitation of ps2pdf is that text in any font other than
the 14 Adobe base fonts (Courier, Times, and Helvetica families, Symbol, and
Zapf Dingbats) is converted to bitmaps.  ps2pdf also may convert strings to
bitmaps if the string is in one of the 14 base fonts but contains a
character that uses a non-standard encoding.

ps2pdf implements setdistillerparams, and recognizes all of the parameters
documented in Adobe Technical Note #5151 except for the ImageDict
parameters, but only a subset have an effect:

General parameters:
	Effective:
		ASCII85EncodePages, CompatibilityLevel, CompressPages,
		CoreDistVersion, LZWEncodePages (see below),
		UseFlateCompression
	Ignored:
		AutoRotatePages, ImageMemory, PreserveHalftoneInfo,
		PreserveOPIComments, PreserveOverprintSettings,
		TransferFunctionInfo, UCRandBGInfo
General image parameters:
	Effective:
		AutoFilterxxxImages (see below),
		xxxImageDepth, xxxImageDownsampleType, xxxImageFilter,
		xxxImageResolution, DownsamplexxxImages, EncodexxxImages,
		MonoImageDict
	Ignored:
		AntiAliasxxxImages, xxxACSImageDict,
		ColorImageDict, GrayImageDict
Color image parameters:
	Effective:
		ConvertCMYKImagesToRGB
	Ignored:
		ColorConversionStrategy, ConvertImagesToIndexed

Because of Unisys' threats regarding the Welch patent, ps2pdf cannot
actually use LZW compression: instead, it treats all requests for LZW
compression as calling for Flate compression if UseFlateCompression is true
and CompatibilityLevel >= 1.2, and ignores them otherwise.

AutoFilterxxxImages doesn't examine the image to decide between JPEG and
LZW/Flate compression: it always uses LZW/Flate compression.

Known problems
==============

In some cases, PDF files created using ps2pdf work with Adobe Acrobat on
Unix but fail using the Windows version of Acrobat.  One error that has been
observed using versions of Acrobat reader for Windows is: "There was an
error processing a page. A rasterizer error occurred."  This error has been
observed using both Acrobat version 2.1 and the Alpha 2 release of Adobe
Amber.  (Adobe may have fixed this problem by now.)

ps2pdf does not yet process the new PDF 1.2 (Acrobat 3.x) BP, EP, SP, and
OBJ and related pdfmarks.  If the application uses these pdfmark commands
(and few applications do), some material may be lost from the output file.

Benefits of using ps2pdf
========================

Despite the limitations of ps2pdf, the class of "suitable" documents is a
large one.  Many users report that the combination of ps2pdf with Acrobat is
superior to using a generic PostScript viewer (psview or ghostview),
particularly for documents with many pages where the navigational support in
PDF files reduces the overhead involved in navigating conventional
PostScript documents.

For certain documents, ps2pdf is much faster than Adobe Distiller, and may
be suitable for run-time conversions.  [Note from George White: I haven't
seen a head to head comparison, but distiller seems slower when running on
what should be a faster system (e.g., distiller on a PPC Mac vs a 25 mhz
'040 NeXT running ps2pdf), so I think this is fair -- also, one of Mark
Doyle's postings indicated that distiller was not fast enough for use as a
run-time server.  In contrast, I find that I can use ps2pdf as a
post-processor during routine document creation.]

Acknowledgements
================

Thanks to George N. White III of the Ocean Sciences Division of the Bedford
Institute of Oceanography in Dartmouth, Nova Scotia <aa056@chebucto.ns.ca>,
for extensive testing of early versions of ps2pdf, and for contributing most
of this writeup.