1A2PING(1)                         Peter Szabo                        A2PING(1)
2
3
4

NAME

6  a2ping.pl  --  convert  between  PS,  EPS  and PDF and other page description
7  formats
8

SYNOPSIS

10  Z<> B<a2ping.pl> [B<-->]B<help>
11   B<a2ping.pl> [B<-->]B<doc>
12   B<a2ping.pl> [I<options>] <I<inputfile>> [[I<outformat>:] I<outputfile>]
13

DESCRIPTION

15  B<a2ping> is a UNIX command line utility written in Perl that  converts  many
16  raster  image  and  vector  graphics  formats  to  EPS  or PDF and other page
17  description formats. Accepted input file formats are: PS  (PostScript),  EPS,
18  PDF,  PNG,  JPEG,  TIFF,  PNM,  BMP, GIF, LBM, XPM, PCX, TGA. Accepted output
19  formats are: EPS, PCL5, PDF, PDF1, PBM, PGM, PPM,  PS,  markedEPS,  markedPS,
20  PNG,  XWD, BMP, TIFF, JPEG, GIF, XPM.  B<a2ping> delegates the low-level work
21  to Ghostscript (GS), B<pdftops> and B<sam2p>. B<a2ping> fixes  many  glitches
22  during  the EPS to EPS conversion, so its output is often more compatible and
23  better embeddable than its input.   Without  the  C<--below>  option,  it  is
24  guarenteed  to  start at the 0,0 coordinate. C<--below>, C<--hires> and C<-v>
25  are recommended options.  The page size is set exactly corresponding  to  the
26  BoundingBox.   This  means that when Ghostscript renders it, the result needs
27  no cropping, and the PDF MediaBox is correct.  If the  bounding  box  is  not
28  right,  of  course, you have problems. If you feed crap in, you get crap. But
29  you can supply the B<--bboxfrom=compute-gs> option to make GS  recompute  the
30  bounding box.  The name of the input file doesn't matter -- B<a2ping> detects
31  the file format based on the first few bytes of the file.  The  name  of  the
32  output  file  matters  if I<outformat> is missing from the command line: then
33  the extension of the output file determines the FileFormat (I<outformat>).
34

EXTERNAL PROGRAMS

36  The internal file format of B<a2ping.pl> is PS/EPS. Everything read is  first
37  converted to PS or EPS, then processed by B<a2ping.pl>, then converted to the
38  output format.  To analyse the bounding box and other properties  of  non-EPS
39  PS  files  (and EPS files with option B<--bboxfrom> other than B<=guess>), GS
40  is used. Converting PS to EPS involves this analysis.  To write PDF files, GS
41  is  used.   To  read  PDF files, B<pdftops> from the B<xpdf> package is used.
42  Sampled input formats are PNG, JPEG, TIFF, PNM, BMP, GIF, LBM, XPM,  PCX  and
43  TGA.  To  read  sampled input formats, B<sam2p> is used. B<sam2p> is a raster
44  image converter written in C++ by the author of B<a2ping.pl>.   Extra  output
45  formats  are  PNG,  XWD,  BMP, TIFF, JPEG, GIF and XPM. To write extra output
46  formats, B<sam2p> and GS are used.  PNM output formats are PGM, PGM and  PPM.
47  To write PNM output formats, GS is used.
48

OPTIONS

50   General Options
51  -h, --help
52    Show a summary of the usage
53  --doc
54    Show the man page
55  -v, --(no)verbose
56    Show progress and debug messages (default: no)
57
58   Options for the Bounding box
59  --(no)hires
60      Use HiResBoundingBox in the input file, if present (default: yes)
61  --(no)exact
62      Use ExactBoundingBox in the input file, if present (default: no)
63  --(no)keepoldmediabox
64      keep only old, [0 0]-based MediaBox in PDF (default: no)
65  --bboxfrom=adsc|compute-gs|guess|pagesize
66      Method for determining the BoundingBox  (default: guess)
67  --(no)below
68      Allow page content below and left of the origin (default: no)
69
70   Options for graphics and fonts
71  --(no)compress
72      use compression                   (default: best)
73  --(no)antialias
74      render  shades  at  outlines.   Possible  values:  (=I<scale3yes>  =I<no>
75      =I<yes>)  (default: scale3no)
76  --(no)lossy
77      allow lossy image filters (EPS->PDF) (default: yes)
78  --papersize=unchanged|force-unknown|600bpx5cm
79      (default: default) (bp)
80  --threshold=
81      min color for 1 in 8->1 bit conv  (default: 128)
82
83   Options for debugging and changing internals
84  --(no)tmpunlink
85      Unlink temporary files (default: yes).  Use B<--notmpunklink> if you want
86      to inspect intermediate files.
87  --gs-cmd=path
88      path to Ghostscript program (default: gs or gswin32c)
89  --gs-ccmd=path
90      path to Ghostscript for BoundingBox calculation (default: gs or gswin32c)
91  --gsextra=GS_ARGS
92      Pass extra arguments to gs
93  --extra=
94      Pass extra arguments to external program (i.e pdftops)
95

TIPS AND TRICKS

97  · If  your  EPS  contains  a  wrong  bounding  box, you can fix it by running
98    "a2ping.pl -v --bboxfrom=compute-gs thefile.eps --"
99
100  · You can specify - as inputfile to  get  stdin  and  as  outputfile  to  get
101    stdout.  This  works  even  for PDF files (which must be seekable), because
102    a2ping copies them to a temporary file automatically.
103
104  · If inputfile and outputfile are the same, a2ping copies the inputfile to  a
105    temporary  location first. However, this usage is recommended only if there
106    is a backup of the file to be restored in case a2ping doesn't  produce  the
107    desired result.
108
109  · If you specify -- as outputfile, it will be the same as inputfile.
110
111  · a2ping respects --Duplex for FileFormat PCL5, even though GS doesn't.
112
113  · If  you  have  an  incompatible PS that GS can read but your printer cannot
114    print, just run "a2ping.pl foo.ps PDF: - | a2ping.pl - PS: foo.ps"
115
116  · If you have a PS coming from Win32 (often with extension  ".prn"),  run  it
117    through a2ping. It will remove the resolution changes and the progress text
118    printed to the terminal (which confuses gv(1) and makes some filters in the
119    print queue emit incorrect output).
120
121  · a2ping  does  antialiasing (--antialias=scale3no) of glyphs and curves when
122    emitting a sampled image (FileFormats such as PGM and PPM).  This  improves
123    readability  of  the glyphs. =yes instructs GS to do internal antialiasing,
124    but it usually doesn't  improve  much.  =scale3no  turns  off  GS  internal
125    antialiasing, but makes it render everything 3x3 as big, and then scales it
126    back  down.  =scale3no  turns  on  both  3x3  scaling   and   GS   internal
127    antialiasing, which results in thicker lines and worse quality in general.
128
129  · When creating a PBM file, antialiasing usually doesn't improve the quality,
130    so it is switched off by default. But if you  set  --antialias=scale3no  or
131    --antialias=scale3yes,  GS  will  render  a  PGM  file,  and  the  value of
132    --threshold determines the minimum intensity for white in the final PBM.
133
134  · If you need a bigger sampled output file, specify  a  larger  --Resolution.
135    The  default is --Resolution=72. If your sampled output file is going to be
136    really big, you should  specify  --AntiAlias=yes  instead  of  the  default
137    --AntiAlias=scale3no to speed up conversion.
138
139  · To  make  sure  fonts  are  included  in a PDF file generated from eps, use
140    --gsextra='-dEmbedAllFonts=true -dPDFSETTINGS=/printer'.
141

MISC

143  · Doesn't depend on the filename or extension of the input file.
144
145  · Conversion from EPS to PDF: fixes glitches etc., calls gs -sDEVICE=pdfwrite
146
147  · Conversion from EPS to EPS: fixes  various  glitches,  moves  (llx,lly)  to
148    (0,0), removes binary junk from the beginning of the EPS etc.
149
150  · Conversion from PDF to PDF: keeps the file intact
151
152  · Conversion from PDF to EPS: calls pdftops -eps (of the xpdf package)
153
154  · Conversion from PS to EPS: keeps 1st page only, removes setpagedevice etc.
155

AUTHORS

157  The  author  of  B<a2ping>  is Péter Szabó <F<pts@fazekas.hu>>.  B<a2ping> is
158  inspired by and historically based on the B<epstopdf> Perl script modified by
159  Thomas  Esser,  Sept.  1998,  but  his  modifications  have been removed from
160  B<a2ping>, and also B<a2ping>  and  B<epstopdf>  do  not  share  common  code
161  anymore.   B<epstopdf>  is  written by Sebastian Rahtz, for Elsevier Science.
162  B<epstopdf> contained extra tricks  from  Hans  Hagen's  texutil.   B<a2ping>
163  contains  contributions  from several people, see the file F<HISTORY.txt> for
164  details. Thank you all for contributing!
165
166
167
168a2ping                            2018-03-08                         A2PING(1)
Impressum