Home

Ghostscript User Manual - Image Processing and Analysis Group

image

Contents

1. Chapter 3 Building Ghostscript from C Source ali atiw att3b1 bgi sxlcrt ega herc vgalib lvga256 mac mswindll os2dll os2pm pe sonyfb sunview s3vga svgal6 tseng vesa toga vga x11 x11alpha x11emyk x11mono appledmp iwhi iwlo iwlq ccr bj10e bj200 bjc600 bjc800 lbp8 lips3 cp50 la50 la70 o y ce cle ole 12 DEC LA70 with low resolution extensions DEC LA75 DEC LA75plus DEC LJ250 Companion color printer DEC LJ250 alternate driver DEC LNO3 Epson AP3250 Epson compatible dot matrix printer 9 or 24 pin Epson compatible 9 pin intermediate resolution Epson compatible 9 pin triple resolution Epson LQ 2550 and Fujitsu 3400 2400 1200 color printers Epson LP 8000 laser printer Epson Stylus Color Epson Stylus 800 HP DesignJet 650C HP DeskJet and DeskJet Plus HP DeskJet 500 HP DeskJet 500C 1 bit per pixel HP DeskJet 500C 24 bit per pixel also for DeskJet 540C HP DeskJet 500C same as cdjcolor HP DeskJet 500C not for 550C 560C alternate driver HP DeskJet 500C b w also for DeskJet 510 520 540C HP DeskJet 550C 560C HP LaserJet HP LaserJet Plus HP LaserJet Id IIp III with TIFF compression HP LaserJet III with delta row compression HP LaserJet ID with duplex function HP LaserJet 4 600 dpi HP LaserJet 4 with Floyd Steinberg dithering HP PaintJet XL HP PaintJet XL alternate driver HP PaintJet XL color printer HP PaintJet XL color printer alternate driver HP P
2. File Print In the subsequent menus you can select printer driver resolution if the printer supports multiple reso lutions and in the case of DSC compatible files the page range you want to print When Ghostscript has finished pro cessing the file you can select the printer interface for forward ing the data in a dialog box Printing on Windows 95 and NT For the newer systems of the Windows family you can use the methods described above for MS DOS and Windows 3 x Additionally you can select a printer queue using its UNC name gswin32 q dNOPAUSE sDEVICE ljet4 file ps sOutputFile spool lt printer name gt c quit This spools the printer data to the given printer queue Using the sOutputFile spool option instructs Ghostscript to present a dialog box in which you can select the desired printer queue or interface Again it s much easier to use GSview Fig 6 DER Setup Printing on Unix On Unix systems it s possible to integrate Ghostscript in the printing process seamlessly However some experience with Unix systems administration is required The variety of available Unix derivatives doesn t really simplify the task of describing the integration of a PostScript emulation for printers The following notes are not supposed to be a complete description but should help you get started Assuming other system components especially spooler and backend are already set up correctly an
3. Options General Preferences and the sub menu Helpers gt For the MIME type application postscript enter ai ps eps in the extensions field if the entry doesn t exist already Check Launch the Application for Action and enter the path of GSview Ghostview oder Mac GS Viewer as appropriate e g c gs gsview32 exe gt Click OK and Options Save Options Unix systems generally use the mailcap file for configuring MIME types Use the following entry for Ghostview see below for the safer option application postscript ghostview safer s The relation between MIME types and file extensions is con trolled by the mime types file If the following line doesn t al ready exist add it to the mime types file application postscript ai ps eps Ghostscript User Manual Like PostScript you can also configure Ghostscript and GSview as helper application for PDF files Proceed as above using the pdf suffix and a MIME type of application pdf Note that Ghostview doesn t yet directly support PDF PostScript files and security PostScript being a full blown programming language contains operators for modify ing and deleting files This opens a security gap when down loading unknown files In the worst case a file pretending to be a harmless PostScript image may delete files from your local hard disk possibly even with root permission Although there are no know
4. What is Ghostscript 2 Ghostscript can even help optimize the output of a PostScript capable printer if the computer s CPU is significantly faster than the printer s Ghostscript can in many cases speed up Post Script output PostScript printers with too little RAM some times cause trouble Ghostscript can remedy this by making use of your computer s main memory and a swap file or swap par tition Ghostscript has proven to be a robust and reliable Post Script RIP that is superior to many commercial PostScript clones PDF on every platform Beginning with version 3 33 Ghost script also contains an interpreter for the Portable Document For mat PDF the foundation of Adobe Acrobat Large parts of Ghostscript s PDF interpreter are written in PostScript It dis plays and prints PDF files and even converts them back to Post Script However Ghostscript only interprets layout related in formation and currently ignores hypertext links or annotations Starting with Ghostscript 4 0 the program is also capable of converting PostScript files to PDF i e it offers Distiller func tionality Though this feature called the pdfwrite device still has some shortcomings it is certainly an important milestone since Ghostscript is the first free Acrobat Distiller substitute Utilities and converters A complete PostScript interpreter together with suitable drivers and utilities makes it possible to carry out many of the operation
5. and PDF You can use the FEAT URE_DEVS variable in the makefile to control the interpreter s configuration The following table lists the most commonly used features levell PostScript Level 1 level2 PostScript Level 2 paf Portable Document Format PDF ttfont Support for native TrueType font files epsf Support for Encapsulated PostScript files EPS with binary header By default PostScript Level 2 and PDF support are configured for all 32 bit configurations except the older Macintosh 3 33 port The Windows configuration additionally contains the ttfont feature Another important configuration option relates to the set of included drivers Since it is not possible to load Ghostscript drivers dynamically at runtime you have to choose the driver set when building the program In doing so you trade function ality for memory efficiency If all available drivers were includ ed in Ghostscript the program would need far too much mem ory For this reason the standard configuration for each platform contains only the most important screen printer and Chapter 3 Building Ghostscript from C Source 11 file format drivers for the respective platform You can check the list of available Ghostscript drivers using the command line gs 2 If you want Ghostscript to use a driver for which C source is in cluded in the distribution but which is not compiled into the ex ecutable by default you have to build your own version by us
6. arguments file pdf quit ps GSview for Windows and OS 2 has already been adapted to processing PDF files GSview handles PDF files just as Post Script files Jumping to an arbitrary page in the file is also possible Extracting text from PDF files Using the ps2ascii ps or pstotext utilities you can extract text from PDF files see next sec tion for details 6 3 Printing and Extracting Text Printing text files The gslp ps utility program implements a lineprinter emulation i e printing simple text files with Post Script commands This includes some formating such as head Chapter 6 More Ghostscript Applications 24 ers and footers page numbers and tabs Ghostscript optionally creates PostScript code or renders the text on screen or printer Details on using the emulator and possible options may be found in the gslp ps file Example for printing a text file on a la serjet printer gs q SDEVICE laserjet r300 dNOPAUSE gslp ps file txt You may use several options following the file name gslp ps The p option creates a PostScript file instead of rendering the text on screen or printer gs q dNOPAUSE gslp ps p file ps file txt Extracting text from PostScript and PDF files The text extraction feature is a counterpart of the lineprinter emulation as it extracts the textual contents from a PostScript file There are at least two options for extracting text with Ghostscript the ps2ascii ps PostScript pro
7. Chapter 6 More Ghostscript Applications 22 and OS 2 display drivers as well as the Portable Graymap For mat PGM and Portable Pixmap Format PPM driver To make use of anti aliasing the bit depth must be at least 8 bits The fol lowing command line can be used to convert a PostScript file to PGM with anti aliasing gs q dBATCH sDEVICE pgm dTextAlphaBits 4 sOutputFile file pgm file ps Possible alpha values are 1 no anti aliasing 2 and 4 Anti aliasing for graphics can independently of text anti aliasing similarly be achieved using the dGraphicsAlphaBits 4 option Note you can easily create anti aliased output with GS view s menu option Media Display Settings Converting PostScript to PostScript raster graphics This conversion makes it possible to print PostScript Level 2 files on devices with PostScript Level 1 interpreters Ghost script s psmono and psgray drivers produce PostScript files con taining a 1 bit or 8 bit raster version of the file as a PostScript Level 1 bitmap Similar to the TIFF conversion you can select the resolution gs sDEVICE psmono r600 sOutputFile filel ps file2 ps By default the psmono driver uses a resolution of 300 dpi Converting PostScript to PostScript vector graphics The pswrite and epswrite drivers produce high level Post Script or EPS output Contrary to the above mentioned Post Script drivers this output isn t rasterized but may contain
8. DeviceGray and DeviceRGB for CIEBasedA and CIEBasedABC color spaces respectively useful on very slow systems where color accuracy is less important dNODISPLAY Suppresses normal initialization of the output device This is useful for debugging and also for PostScript converters that don t produce any screen or printer output e g ps2ai dNOFONTMAP Suppresses loading of the Fontmap file s dNOGC Disables the level 2 garbage collector useful for debugging Chapter 5 Ghostscript Reference Section 19 dNOPAUSE Disables the prompt and pause at the end of each page This is useful for producing printer output or driving Ghostscript from another program dANOPLATFONTS Disables platform fonts for X Windows or Microsoft Windows see section 2 5 Font Configuration dNOPROMPT Disables the prompt but not the pause at the end of each page This prevents text and graphics output from being mixed on PC displays dORIENT1 false Exchanges the meaning of the values 0 and 1 for indicating page orientation with setpageparams This is needed for the Post Script code of certain applications dQUIET Suppress informational messages This is necessary when redi recting device output to stdout dSAFER Disables the PostScript operators for writing or deleting disk files This is intended for using Ghostscript as viewer for a Web browser in a secure mode dSHORTERRORS Brackets several erro
9. Launch Ghostscript to test the font You can either use a suit esas T Cada able PostScript file or request the font manually in the con a Ebvo dine rng cxman nly ege iy Thy ty Fie 5 A re N ig 5 sole window Ee Ser aud brew aae dnb coe be ARo Teee S With Ghostview for X11 Eaten cha tae you can easily control Ghostscript for screen and 10 Smaller TheSerifBold Italic findfont Set Size mey not be entered in T sohmuzer win 7 Re Aspect som vinda The are goes for al aber cormans iste in be printer output The page ther controls window Alternatively you can install a fontmap file derived from an list allows quick access to other platform For example you can create the fontmap auto random pages of DSC compliant documents matically on Windows see section 2 5 Font Configuration and install it in the Ghostscript folder together with the font files It s important not to change the font file names so make sure that they correspond to the fontmap entries Naturally you have to observe the font manufacturer s license conditions if the installed fonts originate from another system URW contributed commercial quality PostScript Type 1 fonts for use with the Ghostscript package These include look alikes for the 35 PostScript core fonts found in most laser print ers The URW fonts are distributed under the Aladdin and the G
10. configuration Can t find library libXt so 6 Unix versions of Ghostscript generally are linked dynamically For this reason several libraries must be accessible at runtime Use the Idd command to find out which libraries are needed lo cate these on your hard disk and set the LD_LIBRARY_PATH environment variable appropriately Another solution is to link Ghostscript statically Unknown device xxx Ghostscript has been launched with an unknown device driver name If you want to use drivers which are not available in the standard configuration you have to recompile and link Ghost script with the necessary drivers gs Interpreter revision 501 does not match gs_init ps revision 403 Ghostscript found an initialization file that doesn t match the program version Make sure the GS_LIB environment variable or the I command line option don t point to an obsolete Ghost script version on your hard disk Ghostscript User Manual 6 More Ghostscript Applications 6 1 Many file format conversions and other special applications are possible with the help of Ghostscript drivers and auxiliary pro grams Some of these applications are not PostScript interpreter tasks at first sight The descriptions in the following sections provide a summary of the most important of these applications Usually you can find more detailed information in the appro priate documentation or source files txt ps c Graphics File For
11. font set is automatically installed If you only want to use the PostScript core font set the font configuration is already finished Static font configuration There are two choices for the font configuration If the installed font base rarely changes put one or more font directories in the environment variable GS_LIB A typical hard disk installation on MS DOS or Windows uses the following set GS_LIB C gs C gs fonts or on Unix set GS_LIB usr local share ghostscript fonts export GS_LIB For now the font configuration is already done Each directory in GS_LIB may contain the Fontmap file which defines the relation between font names and file names To add new fonts simply add a line similar to the following at the end of the Fontmap file Fontname filename The file name in parentheses must be found in one of the font directories In many cases you can save yourself the trouble of entering font and file names because there are prebuilt Fontmap files for several systems and font configurations If you use one of the following simply copy the appropriate file to the name Fontmap File name Origin of fonts name of operating system Fontmap atm Windows with standard ATM fonts Fontmap atb Adobe Type Basics font package Fontmap gs URW fonts standard fontmap Fontmap os2 OS 2 with integrated ATM Fontmap osf DEC OSF I with DPS Fontmap sol Solaris 2 3 and higher with DPS Fontmap ult Ultrix 4 3 and higher with DPS Fo
12. geo metrical objects Depending on the nature of the input file the output may increase or decrease in size pswrite output may be considered as purified PostScript in some sense Additional features for EPS files The shell script batch file ps2epsi or ps2epsi bat creates ASCII previews for EPSI files Usage notes can be found in ps2epsi txt On Windows and OS 2 many additional EPS functions are possible with GSview in cluding determining a correct bounding box and creating or de leting preview bitmaps More details can be found in chapter 3 of this book Ghostscript User Manual If you configured and compiled Ghostscript with the epsf fea ture the Interpreter is capable of reading EPS files which in clude binary screen preview sections in addition to the Post Script code Converting to the Adobe Illustrator format As of ver sion 5 01 a special Ghostscript driver for creating Adobe Illu strator format is not yet available Instead Ghostscript uses the sophisticated PostScript program ps2ai ps Although this con version is bound to some restrictions in many cases it yields graphics files which may be opened and edited with any Illus trator compatible program On Unix redirect Ghostscript s out put to a file On Windows and OS 2 it s easier to have Ghost script create the file directly To achieve this change the variable jout at the beginning of ps2ai ps to a value of true As sign the name of the AI file you
13. many users and programmers m on the Internet Ghostscript has become a high quality and ver satile PostScript interpreter Peter Deutsch also distributes a commercial version with customer specific enhancements and support Ghostscript s capabilities include Screen output Ghostscript displays PostScript and PDF m data on the screen This is useful to examine PostScript graphics or for saving a few trees if you want to browse some product documentation which is available in PostScript format only Ghostscript checks PostScript files before you transfer them e g to a service bureau Are all the necessary fonts there Are the graphics okay Do the files contain all pages Ghostscript also helps with PostScript trouble shooting A faulty page can be rendered on screen revealing which graphics element yields an error message Ghostscript provides the usual Ghostscript User Manual PostScript error messages A separate frontend to the interpret Thomas Merz 1996 97 er called GSview for Windows and OS 2 or Ghostview for the X Window System simplifies the handling of PostScript Notes on the page layout The design of the Ghostscript manual was files with a user friendly GUI interface with these frontends the chosen to meet several objectives A gt It uses fonts from the PostScript core font set in order to reduce file user can access random pages n the document Without them size This also avoids font embedding issues si
14. name of the connected printer Windows or uses the default queue OS 2 On Unix you can also redirect the output to another pro gram via pipe sOutputFile 1p The special name for the output file instructs Ghostscript to send the data to its stan dard output sPAPERSIZE lt papersize gt Selects a page size e g a4 The file gs_statd ps contains a list of supported page size names sPSFile lt filename gt Defines the output file name for PDF to PostScript conversion sSUBSTFONT lt fontname gt Selects the named font as substitute for all missing fonts This disables Ghostscript s normal font substitution mechanism 5 2 Environment Variables GS_DEVICE lt device gt Defines the initial output device driver GS_FONTPATH lt path gt Specifies a list of directories that should be scanned for fonts at startup see section 2 5 Font Configuration lt Chapter 5 Ghostscript Reference Section 20 GS_LIB lt path gt Search path for initialization and font files GS_OPTIONS lt options gt Defines a list of command line arguments to be processed be fore the ones specified on the command line All command line options are also allowed in this environment variable TEMP lt directory gt Directory name for temporary files On Windows and OS 2 this variable must point to an existing directory in order to have the printing feature work properly DOS4G quiet Suppresses the usual star
15. ordering word size and other system specific information Ghostscript can be compiled on MS DOS Windows OS 2 Amiga many Unix systems Macin tosh and VMS The C source is highly portable so compiling it on new systems shouldn t be much of a problem If you want to customize your particular version of Ghost script see section 3 3 for a description of options you may set before compiling the program Makefiles The compilation process is controlled by make files which you can adapt as necessary To improve legibility the makefiles are split in parts gs mak Ghostscript core source lib mak graphics library int mak interpreter devs mak device drivers jpeg mak JPEG library libpng mak PNG graphics file format library zlib mak compression routines used for the PNG format All other mak files are platform specific makefiles used to con figure the development system The compilation process for different platforms and the supported development systems are described in full detail in the file make txt The following de scription is not intended to replace this file but to give youa jump start Compiling on MS DOS Windows OS 2 First decompress the C source from the compressed archive files gs5xxsr1 zip gsoxxsr2 zip and gs5xxsr3 zip The files in the other archive files jpes 6a zip lpngxxx zip and zlibxxx zip contain additional librar ies needed by Ghostscript These are unpacked into three sub
16. the a4 in parentheses by any other known format A list of all formats known to Ghost script and their dimensions can be found in the gs_statd ps file Alternatively you can change the page size on the Ghostscript command line gs SPAPERSIZE legal file ps Printing with Ghostscript Printing on MS DOS The following call processes a Post Script file for output on a Laserjet 4 printer connected to the parallel interface gs386 q dNOPAUSE sDEVICE ljet4 file ps c quit The c quit option is used to exit Ghostscript after the PostScript file is completely rendered Due to the q option Ghostscript it self works quietly However the 386 MS DOS extender still presents its copyright banner You can suppress it with an envi ronment variable set DOS4G quiet If your printer is not connected to the parallel interface or you want to bring the printer data to another machine you can redi rect it to a file gs386 q dNOPAUSE sDEVICE ljet4 sOutputFile ljet prn file ps c quit Chapter 4 Ghostscript Primer 15 To print this file send it to the printer interface with the copy command copy b ljet prn lpt1 The b binary option is important because otherwise the copy command may not completely transfer the printer data Printing on Windows 3 x On Windows it is easiest to use GSview for printing with Ghostscript After installing this Ghostscript frontend correctly you can select a PostScript file using
17. EPSF or TEXT files e g the test file tiger ps in the Ghostscript folder Activate bal Ghostscript User Manual Ghostscript Next Page The program can be closed with Quit The sequence Edit Settings changes such internal settings as page size or the scaling factor of the window Device drivers and file output By default Ghostscript ren ders into a Macintosh window It can also create instructions for other devices or graphics file formats You can copy the bit mapped contents of a window to the clipboard or save it as a PICT file with File Save As In the Devices menu you can choose the output file Although the Ghostscript source dis tribution contains many dozens of drivers the Macintosh ver sion only contains the screen driver a few printer drivers and drivers for the file formats PCX PBM and TIFF This decision has been made in order to reduce storage requirements Since it is not possible to dynamically load drivers you have to recom pile Ghostscript if you want to use additional drivers Font configuration on the Mac Ghostscript uses Post Script fonts in ASCII format Since PostScript fonts on the Mac are usually stored in a compact resource format Ghostscript cannot use them directly this is planned for a future version However you can convert standard Mac PostScript fonts for use with Ghostscript with the unadobe utility Execute the fol lowing steps for ea
18. GFPL is found in the file named PUBLIC which is part of the Ghostscript distribution fileset Chapter 1 What is Ghostscript 3 2 Installing Ghostscript 2 1 Using GSview for Windows and OS 2 Requirements and versions The Ghostscript and GSview installation including fonts uses 5 5 MB hard disk space There are several flavors of Ghostscript for PC systems note that sup port for 16 bit MS DOS and WIndows versions has been dropped in Ghostscript 5 0 System File name Notes MS DOS gs386 exe plus Version with DOS extender very fast 80386 and higher dos4gw exe Windows 3 x with gswin32 exe plus 32 bit version with enhancements for Win32s gsdll32 dll Windows 95 and NT it consists of a DLL Windows 95 and NT gs16spl exe and a small EXE program OS 2 gsos2 exe plus Uses gspmdrv exe as display driver for the gsdll2 dll presentation manager Setup program for Ghostscript and GSview Under Win dows and OS 2 the user frontend GSview facilitates using Fig 1 REAS Ghostscript by supplying a handy interface to the interpreter With the GSview setup program you can install both Ghost script and GSview comfortably After uncompressing the zip file of GSview launch the program setup exe for Windows or os2setup exe for OS 2 The file readme txt lists the required ZIP files After asking for the version of Ghostscript you wish to use the setup program asks for the name of the directory to which the software is to be ins
19. Ghostscript User Manual Thomas Merz 1996 97 tm muc de This manual is adapted from appendix al PostScript Acrobat PDF B of the following book PostScript and Acrobat PDF Applications Troubleshooting and Cross Platform Publishing by Thomas Merz Springer Verlag Berlin Heidelberg New York 1997 ISBN 3 540 60854 0 420 pages plus CD ROM Book and manual are also available in German Thomas Merz Verlag M nchen ISBN 3 9804943 0 6 The Ghostscript manual may be freely copied and redistributed in printed or digital form if no payment is involved Commercial reproduction is prohibited However the author agrees to any redistribution along with the Ghostscript software provided the distributor complies with the applicable Ghostscript license terms The Ghostscript manual is available from http www muc de tm Ghostscript 5 What is Ghostscript Installing Ghostscript Building Ghostscript from C Source Ghostscript Primer Ghostscript Reference More Ghostscript Applications 1 What is Ghostscript L Peter Deutsch founder of Aladdin Enterprises Menlo Park California wrote the PostScript Level 2 and PDF interpreter Ghostscript in the C programming language The program runs on most operating systems including MS DOS Windows 3 x Windows 95 Windows NT OS 2 Macintosh Unix and VAX VMS and has been available free of charge ever since its intro duction in 1988 With the help of
20. Ghostscript User Manual directories of the Ghostscript directory The d option of pkun zip creates the directory gs5 xx pkunzip d gs5xxsrl zip pkunzip d gs5xxsr2 zip pkunzip d gs5xxsr3 zip cd gs5 xx mkdir jpeg 6a cd jpeg 6a pkunzip jpeg 6a zip Cd sa mkdir libpng cd libpng pkunzip lpngxxx zip CG 2x mkdir zlib cd zlib pkunzip zlibxxx zip odra The Ghostscript distribution contains makefiles for the Mi crosoft Borland Watcom and other C compilers see make txt For example to create the 32 bit Windows version of Ghost script using the Borland Compiler you first have to create the makefile echo include bcwin32 mak gt makefile Next you can change some settings in bcwin32 mak e g com piler and Ghostscript paths optimizations for 386 486 586 CPUs or FPU assembler accelerator modules or debugging op tions Finally launch make In an intermediate step you have to manually start the Windows program genarch to create a system specific include file Compiling on Unix You need the following archive files for compiling Ghostscript ghostscript 5 xx tar gz jpeg 6a tar gz lib png x xx tar gz and zlib 1 x x tar gz Note that the additional li braries may also be available by other names at Ghostscript dis tribution points Decompress the C source for Ghostscript and the JPEG PNG and ZLIB libraries from the compressed tar ar chives into a suitable directory The tar commands crea
21. NU license a Ghostscript accepts many flavors of font formats 2 4 Installing Ghostscript on Unix Using Ghostscript on Unix systems generally requires compil typed Cep ae ER PAA O Aia ing the C source first This process is covered in section 3 Typea ee al PostScript outline fonts ASCII pfa or bina Building Ghostscript from C Source a Type 2 Type 1 extension used in the Compressed Font Format CFF If you re working with the X Window System driving and OpenType E Ghostscript with the Ghostview frontend is a good idea Type 3 rarely used PostScript fonts outline or bitmap Multiple Master Type 1 extension with one or more design axes parameters 2 5 Font Co nfig uration CID character id Format used for large character sets e g Chinese and Japanese Type 42 TrueType font data wrapped in PostScript This section applies to all operating systems except the Macin TrueType Native TrueType font file t4f tosh Font configuration for the Mac differs from other systems and has been covered with the Mac installation already For many years the Ghostscript distribution contained only low quality public domain fonts In 1996 the German company Ghostscript User Manual Chapter 2 Installing Ghostscript 7 It is necessary for Ghostscript to have access to the font file in stalling the font in the operating system ATM or Display Post Script is not enough If you install Ghostscript with GSview the URW
22. aintJet XL 300 color printer also for DeskJet 1200C HP 2563B line printer IBM Proprinter 9 pin IBM Jetprinter inkjet color printer Modell 3852 Imagen ImPress C Itoh M8510 Microsoft Windows system printer driver DDB Microsoft Windows system printer driver DIB Mitsubishi CP50 color printer NEC P6 P6 P60 360 x 360 DPI Ghostscript User Manual la70t 1a75 la75plus 1j250 declj250 In03 ap3250 epson eps9mid eps9high epsonc 1p8000 stcolor st800 dnj650c deskjet djet500 cdeskjet cdjcolor cdj500 djet500c cdjmono cdj550 laserjet Ijetplus ljet2p ljet3 ljet3d ljet4 lj4dith Pj pjetxl pjxl paintjet pjxl300 1p2563 ibmpro jetp3852 imagen m8510 mswinprn mswinpr2 cp50 necp6 wo wo DWO wo DWO wo WOM wo DWOU DWOU DWOU DWOU wo DWOU DWOUM DWOU DWOU DWOU DWOU wou DWOU DWOU DOU DWO wo e e O wo OCE 9050 Okidata IBM compatible dot matrix printer Okidata MicroLine 182 OS 2 system printer driver only for OS 2 DLL Ricoh 4081 laser printer Sony Microsystems NWP533 laser printer StarJet 48 inkjet printer SPARCprinter Tektronix 4693d color printer 2 bits per RGB component Tektronix 4693d color printer 4 bits per RGB component Tektronix 4693d color printer 8 bits per RGB component Tektronix 4695 4696 inkjet plotter Unified printer driver for many printers e g NEC Pinwriter P2X ESC P Epson Stylus Color ESC P2 HP Deskjet 550C HP RTL See devices txt fo
23. ame in systemdict with the given definition equiva lent to name token def This option is mainly used for spe cial names see below Dname dname Defines name in systemdict with a value of true Ghostscript User Manual Sname string sname string Defines a name in systemdict with the given string definition equivalent to name string def a quiet Suppress normal startup messages f lt filename gt Execute the given file even if its name begins with a or f provides a way to terminate the token list for c g lt number1 gt x lt number2 gt Equivalent to dDEVICEWIDTH number1 and dDEVICE HEIGHT number2 see below r lt number gt r lt number1 gt x lt number2 gt Equivalent to dDEVICEXRESOLUTION number1 and dDE VICEYRESOLUTION number2 see below This is intended for devices that support different horizontal and vertical resolu tions especially dot matrix printers u lt name gt Undefines a name cancelling d or s I lt directories gt Add a list of directories to the search path for initalization and font files Multiple directories are separated with a semicolon MS DOS Windows OS 2 or colon Unix P Ghostscript first searches the current directory for library files This is the default P Ghostscript doesn t search the current directory for library files but uses the search path only Instructs Ghostscript to read standard in
24. ation consists of dividing each component of the input image into 8x8 blocks performing the two dimensional DCT on sach block quantizing each DCT coefficient uniformly subtracting the quantized DC coefficient fromthe comesponding termin the previous block and then entropy coding the quantized coefficients using variable length codes VLCs Decoding is performed by inverting each of the encoder overaticns in the reverse order The DCT Before performing the foward DCT input pixels are level shifted so that they range from 128 to 127 Blocks of x pixels are transformed with the two dimensional 8x8 DCT Flay 4 ClujCtv fixy cos te co ihe and blocks are inverse transformed by the decoder with the Inverse DCT fixy Clu C v Flu v cos inte cos Zi SK Ghostscript User Manual can adjust the screen size larger resolution values yield a larger screen representation Use a smaller resolution value if you want to see the entire page at a time without scrollbars With the Media menu you can adjust the page size media format Configure Ghostscript xi reinig A Ghostscript Ghostscript DLL path names in CAGSTOOLS gs5 01 gsdll32 dll GSview Ghostscript Include Path Caral CAGSTOOLS gs5 01 C GS TOOLSMonts c psfonts Defaults EEE Ghostscript Options dNOPLATFONTS Help Chapter 2 Installing Ghostscript 4 2 2 Additional features of GSview GSview offers many addi tiona
25. ch font you want to use gt Start unadobe and open the font file unadobe doesn t change the font data but instead converts the resource representa tion to a textual representation suitable for Ghostscript Save Chapter 2 Installing Ghostscript 6 the generated font file in the Ghostscript folder using the ft Word XV3L old file name or a new one Fae iroli Loies Section 3 The Comrat Window gt Edit the file Fontmap in the Ghostscript folder with a text edi is Section 3 The Contral Window tor e g SimpleText Append a line similar to the following at the end of the file TheSerifBold Italic TheSerBol i This line contains the PostScript name of the font and the name of the font file that you used in the first step The line 5884780 Color IEG 24 bit mode Using axeve color must be terminated with a semicolon If you re unsure about ys 2l l le s1l e E A crep Urcrop autocrop about xv the exact PostScript name of the font you can open the font 2 the cot n D e nls cl on ish ut os st ie file created by unadobe with a text editor and look for the en redler atm hng eam wna A nE pare heer maiae Se ee Mea dine try FontName bt lero aes crt ce ie elec acl fi P pring the keyboard equivalent where ghen into any open er window gt
26. ches these fil ters for printing on devices which are not supported directly To define Ghostscript as a filter change to the directory etc lp fd and create a file for the printer say ljet_ps fd Cancel Properties jjetplus Help js m8510 I PostScript Printer Input types postscript ps Queue I Printto File All Pages Output types simple Command usr local bin gs sDEVICE ljet4 q Distiller Assistant V3 0 A sOutputFile HP LaserJet 4MP AdobePS HP LaserJet 4P 4MP PostScript it REE Integrate this filter in the spool system Ghostscript User Manual Chapter 4 Ghostscript Primer 16 4 3 lpfilter f ljet_ps F etc lp fd ljet_ps fd To print a PostScript file simply declare the file type on the command line lp T postscript tiger ps For serial connections make sure the backend doesn t change the printer data by using the stty options opost cs8 parenb Ghostscript as Viewer for a WWW Browser World Wide Web browsers and many E mail programs classify files according to MIME types Multipurpose Internet Mail Exten sion PostScript files use a MIME type of application postscript MIME types and corresponding viewers are generally config ured in a configuration file or menu The details vary according to the particular program Let s take a look at the Windows ver sion of the well known Netscape WWW browser as an exam ple gt Launch Netscape Navigator gt Choose
27. d Type 42 fonts created for example by the Windows PostScript driver Native TrueType files Files in TTF format as installed under Windows contain raw TrueType data which a PostScript inter preter generally cannot process directly Ghostscript however contains some additional code for interpreting raw TrueType files This code is activated by the ttfont makefile option Since TrueType plays an important role for Windows users the Windows Ghostscript version is configured with the ttfont feature by default This means that the Windows TrueType font directory can be configured for use with Ghostscript just as any PostScript font directory However Ghostscript only recognizes TTF font files when searching font files via the GS_FONTPATH variable it s not possible to process TrueType files via the Chapter 2 Installing Ghostscript 2 run operator You can work around this with the following instruction file ttf r file loadttfont Platform fonts on Windows and X11 Ghostscript always needs access to all PostScript fonts used in a document It ras terizes all the characters itself instead of delegating this task to the operating system ATM or the X server like other pro grams do However to speed up processing Ghostscript sometimes uses system fonts This feature is called platform fonts and is used only for certain font sizes and horizontal or vertical text Even so the PostScript font name must e
28. d are able to transfer bi nary data to the printer unmodified you can manually use Ghostscript for printing gs q dNOPAUSE sDEVICE ljet4 sOutputFile 1p file ps c quit You can find hints on integrating Ghostscript in systems with a printcap database in the file unix lpr txt The accompanying shell script Iprsetup sh automatically creates some necessary di rectories and links as well as printcap entries Use a text editor to adapt the list of device drivers in this script that Ghostscript is supposed to use Obviously these drivers must be compiled into the Ghostscript executable You can also set up additional printcap filters with Iprsetup sh By default it creates an input filter consisting of a shell script with the actual Ghostscript call After executing Iprsetup sh follow the instructions in unix Ipr txt i e create some links as indicated in the file integrate the generated printcap insert file into the system printcap and adjust the new entries to your local setup serial interface pa rameters etc The usr local lib ghostscript filt directory con tains several links to the unix Ipr sh file In this file you have to add the I option if you didn t install Ghostscript in the stan GSview simplifies select __ ing ida drivers Device Resolution z dard directories Se ET jet4 600x600 On System V Release 4 and related systems you can define print filters for specific file types The spooler laun
29. dows Macintosh Unix beiliegend ISBN 3 9804943 0 6 Thomas Merz Verlag M nchen Fax 49 89 29 16 46 86 Chapter 6 More Ghostscript Applications 26
30. e GS gt epson selectdevice GS gt file ps run For printers with multiple resolutions you can also set the de sired print resolution using the r option gs sDEVICE epson r60x72 c quit Redirecting printer data On MS DOS Ghostscript sends printer data directly to the parallel port On Unix the printer data is sent to a temporary file You can also redirect it to your own print file gs sDEVICE laserjet sOutputFile laserjet prn file ps c quit If the output file name contains the variable d e g laser d prn Ghostscript produces one output file per page and replac es the d with the page number On Unix you can also redirect the data to a pipe using the syntax Ghostscript User Manual 4 2 gs sDEVICE laserjet sOutputFile lp file ps c quit Finally Ghostscript sends the printer data to its standard out put with the following command line the q option suppresses messages gs q sOutputFile file ps c quit lp On Windows and OS 2 the easiest way to redirect printer data is to use GSview This frontend presents a menu for choosing the printer interface Page size Ghostscript uses U S letter size by default To change this use a text editor to locate the following line in the initialization file gs_init ps a4 PAPERSIZE where pop pop PAPERSIZE exch def ifelse In this line remove the comment sign at the beginning to use A4 format You can also replace
31. e Ghostscript distribution README NEWS general information and development history of Ghostscript current txt notes on the current version new user txt overview of Ghostscript use txt information on using Ghostscript devices txt Details on a number of printer drivers make txt notes on compiling Ghostscript other txt additional documentation on special topics PUBLIC Aladdin Ghostscript Free Public License licensing conditions ell several Unix style manual pages c h asm source files mak def rc auxiliary files for building the program BCX sh bat cmd scripts and batch files used in the build process several special applications of Ghostscript gs_ ps initialization files for Ghostscript pdf_ ps initialization files for the PDF interpreter other ps auxiliary PostScript files and sample programs Fontmap Fontmap files for several systems Chapter 3 Building Ghostscript from C Source 9 3 2 Compiling the Standard Version Requirements To build Ghostscript you need approximate ly 16 MB disk space The source is written in ANSI C suited for most current C compilers However you can also use an old Kernighan amp Ritchie compiler The auxiliary program ansi2knr converts the source files to K amp R syntax before compilation An other auxiliary program called genarch automatically creates an include file which describes hardware and compiler architec ture This includes bit and byte
32. ets the device horizontal resp vertical device resolution in dpi dDISKFONTS Causes character outlines in fonts to be loaded from disk on de mand only This slows down text rendering but increases the number of fonts which may be loaded into RAM This tech nique is mainly intended for low memory systems dDITHERPPI lt lpi gt forces all devices to be considered high resolution and forces use of a halftone screen or screens with lpi lines per inch disre Ghostscript User Manual garding the actual device resolution Reasonable values for lpi are N 5 to N 20 where N is the resolution in dots per inch dFirstPage lt n gt Starts interpreting on the given page of a PDF document dGraphicsAlphaBits lt n gt Specifies the bit depth for graphics anti aliasing Possible values are 1 no anti aliasing 2 and 4 Note that only few drivers are capable of anti aliasing dFIXEDMEDIA Causes the media size to be fixed after initialization Pages are scaled or rotated if necessary dF IXEDRESOLUTION Causes the output resolution to be fixed dLastPage lt n gt Stops interpreting after the given page of a PDF document dLOCALFONTS This is a compatibility option for certain obsolete fonts This op tion makes Ghostscript load type 1 fonts always to local VM dNOBIND Disables the bind operator useful for debugging dNOCACHE Disables the font cache useful for debugging dNOCIE substitutes
33. font Contrary to PostScript files it s possible to access random pages of PDF files Therefore you can select a page range for PDF files when launching Ghostscript gs dFirstPage lt n gt dLastPage lt m gt file pdf This works for displaying and printing PDF files and for con verting them to PostScript see below Converting PDF files to PostScript Ghostscript is able to convert PDF files back to PostScript Level 2 In fact if the PDF file doesn t contain compressed raster graphics or color spaces the generated PostScript files use Level 1 operators only The following command line creates the corresponding PostScript file for a PDF file gs dNODISPLAY sPSFile file ps file pdf A little shell script batch file contained in the Ghostscript dis tribution makes this even easier pdf2ps file pdf file ps The following additional options are available for PDF to Post Script conversion dPSBinaryOK Allows the generated PostScript files to contain binary data dPSLevell Generates PostScript Level 1 output dPSNoProcsSet Does not include the PostScript prolog procset in the output Note that the prolog is necessary when sending the generated file to a PostScript printer Converting PostScript to PDF distilling Ghostscript is also able to distill PostScript files to PDF The following com mand line can be used to distill PostScript files to PDF gs q dNOPAUSE dBATCH sDEVICE pdfwrite sOutp
34. gram and the more sophisticated psto text package ps2ascii ps is included in the Ghostscript distribution De pending on the dSIMPLE option the utility creates simple or complex output Simple output consists of text only whereas complex output additionally contains information about font type and string positions The positions are given in tenth of a point More details may be found at the beginning of ps2ascii ps some usage samples in the batch file ps2ascii bat A typical com mand line gs dNODISPLAY dNOBIND dWRITESYSTEMDICT dSIMPLE ps2ascii ps file ps c quit gt file txt Note that there is good reason to call the utility ps2ascii If the PostScript file contains any special characters German um lauts for example they don t make their way into the output file but get substituted with two character sequences of ASCII symbols The pstotext package is available as a Ghostscript add on from the following URL http www research digital com SRC virtualpaper pstotext html The pstotext code is also included in the GSview distribution as a separate DLL Simply use GSview s Edit Text Extract feature to make use of it If you check Options Quick Text Ghostscript User Manual a different method will be used for text extraction which is less accurate but faster Note that unlike ps2ascii ps pstotext pre serves umlauts and other special characters 6 4 Font Tools Printing font tables T
35. he prfont ps utility prints character ta bles for any given PostScript font It first prints all characters contained in the encoding vector of the font then uncoded characters If the font isn t configured in Ghostscript enter the font file name on the Ghostscript command line Then type the font name and the procedure name at the Ghostscript prompt gs fontfile prfont ps GS gt FontName DoFont And now for a little commercial Chapter 6 More Ghostscript Applications 25 Ghostscript User Manual PostScript amp Acrobat PDF Applications Troubleshooting and Cross Platform Publishing Originally entitled the PostScript and Acrobat Bible in Ger man this handbook achieves the seemingly impossible it covers this tricky and technical field in an entertaining manner without ATE i getting bogged down in PostScript programming The author Pos t Sc ript e genuinely wants to assist in overcoming cross platform barriers using MS DOS Windows Macintosh or Unix and accordingly Ac robat PD F neither the book nor the tools are limited to one particular plat Applications Troubleshooting form or operating system The 9 chapters plus 3 appendixes run g and Cross Platform Publishing the entire gamut from the very basics right up to Ghostscript The whole book is creatively designed making use of comical illustrations In short essential reading for all technically minded users of PostScript and Acrobat PDF Example
36. hoose a driver for Mac tiffpack GS Viewer Ik to Ghostscript Fig 3 Mac GS Viewer f emvindos cQuadretto 1V Lavor 1 Tonny Ghost displays the tiger To BOISE 841 8 8 LLIGA ps false nauwindon CQuodretto 1V Lavort Tonay Ghosts oles Aig test page You can enter PostScript commands in the console window loon help to learn more about Ghostscript After one page has been rendered on screen the next page can be requested with and open files via File pensated for by several extensions in Mac GS Viewer and its user interface To install Mac GS Viewer you need the program Stuffit Ex pander Decompress the archive macgs vl 0 files sit hqx This places the contents of this archive in the Ghostscript folder Decompress one of the executable files macgs vl 0 ppc sit hqx macgs vl1 0 68k sit hqx macgs vl 0 classic sit hqx along with the Ghostscript fonts from the archive macgs v1 0 fonts sit hqx into the same folder The archive macgs v1 0 src sit hgx is only needed for compiling an individual version of Ghostscript Launching and testing Ghostscript Launch Ghostscript by double clicking on the Mac GS Viewer icon After initializa tion the console window Talk to Ghostscript will appear with the Ghostscript prompt GS gt Although you can type in PostScript commands in the console window it s much easier to use Mac style menu commands The sequence File Open lets you open
37. ing a modified makefile Many Ghostscript drivers have been contributed by users and later became part of the Ghostscript distribution If you want to write a new driver read the remarks on Ghostscript driver interaction in drivers txt In addition to the file format drivers listed in the table below previous Ghostscript versions contained one for the GIF graph ics file format In reaction to the licensing problems around the LZW compression technique used in GIF Peter Deutsch dropped support for this format from the Ghostscript distribu tion If you have to create GIF files you can integrate the GIF driver from an older release However it s easier to render to another graphics file format e g TIFF or PNG and convert it to GIF using a graphics converter The tables on the next pages list all display printer and file format drivers available for Ghostscript 5 01 Each line contains a description of the device or format and the short name of the driver The last column in the table tells you on which of the fol lowing platforms the particular driver is part of the standard configuration D MS DOS 386 with 32 bit extender WwW Windows 32 bit OS 2 u Unix M Mac GS Viewer Ghostscript version 3 33 The driver name is used in the makefile as well as for selecting a driver within Ghostscript The makefile variables DEVICE_DEVS1 to DEVICE_DEVS15 contain the names of the drivers to be included in the program If you don t
38. l Ghostscript functions which are described in several chapters of this book This includes dealing with EPS files ran domly accessing the pages of DSC Document Structuring Con ventions conforming PostScript files following hypertext links in PDF files extracting selected pages to print parts of a docu ment only copying the bitmapped page contents to the clip board or selecting printer drivers in a convenient manner GSview uses temporary files for printing and for extracting text These temporary files are normally created in the directory specified in the TEMP environment variable A warning will be given if the TEMP variable is not set The TEMP variable must therefore point to a writable directory on disk if GSview is run from CD ROM Installing Ghostscript without GSview If you don t use Windows don t need GSview or can t stand setup programs you can install Ghostscript manually All of the files contained in the archive gs5xxini zip plus one of the ex ecutables listed in the table in section 2 1 are necessary for using Ghostscript The executables for Windows and OS 2 are con tained in the compressed files gs5xxw32 zip and gs5xxos2 zip re spectively Note that you can also use ghostscript 5 xxpc tar gz You will need the tar and gzip utilities to unpack this archive To use the 32 bit version for Windows 3 x you need the win32s system extension in addition to the Ghostscript files Note many software packages use
39. mats Displaying and printing graphics file formats The utili ty programs viewcmyk ps viewgif ps viewjpeg ps view pbm ps and viewpcx ps all written in PostScript display or print raster graphic files in the CMYK GIF JPEG PBM or PCX file formats without converting them to PostScript Launch Ghostscript with the appropriate utility and load a graphics file using one of the procedures viewcmyk viewGIF viewJPEG viewpbm or viewpcx e g gs viewjpeg ps GS gt file jpg viewJPEG Converting PostScript to raster graphics formats Several file format drivers enable Ghostscript to convert Post Script files to TIFF PBM PCX BMP etc given the appropriate driver has been compiled into the Ghostscript executable The Ghostscript call contains the name of the driver and optionally the resolution For example to create a 600 dpi bitmapped TIFF version of a file use the following command gs q dNOPROMPT dBATCH sDEVICE tiffpack r600 sOutputFile page d tif file ps Ghostscripts replaces the d variable in the filename with the actual page number page1 tif page2 tif etc By default the TIFF drivers use a resolution of 204 x 196 dpi standard fax resolu tion Enhanced rendering with anti aliasing A technique cal led anti aliasing tries to improve text or graphics rendering by making use of gray levels for smoothing Anti aliasing is imple mented in a couple of Ghostscript drivers namely the Windows
40. n bits raw format monochrome bit Plain bits raw format RGB bitrgb Plain bits raw format CMYK bitemyk PBM Portable Bitmap ASCII format pbm PBM raw format pbmraw PGM Portable Graymap ASCII format pgm PGM raw format pgmraw PGM optimizing to PBM ASCII if possible pgnm PGM optimizing to PBM raw if possible pgnmraw PNG Portable Network Graphics monochrome pngmono PNG Portable Network Graphics 8 bits gray scale pnggray PNG Portable Network Graphics 4 bits color pngl6 PNG Portable Network Graphics 8 bits color png256 PNG Portable Network Graphics 24 bits color pngl6m PPM Portable Pixmap ASCII format RGB ppm PPM raw format RGB ppmraw PPM optimizing to PGM ASCII or PBM ASCII if possible pnm PPM optimizing to PGM raw or PBM raw if possible pnmraw SGI RGB pixmap format sgirgb TIFF b w CCITT RLE 1 dim fax group 3 without EOLs __ tiffcrle TIFF b w fax group 3 with EOLs tiffg3 TIFF b w fax group 3 2 D tiffg32d TIFF b w fax group 4 tiffg4 TIFF b w LZW compression tag 5 tifflzw TIFF b w PackBits compression tag 32773 tiffpack TIFF 12 bit RGB color no compression tiffl2nc TIFF 24 bit RGB color no compression tiff24nc DWOUM DWOUM DWOU DWOU DWOU uM uM UM uM wou wou wou wou wou uM uM Hi u DWOU DWOU DWOU DWOU DWOUM DWOUM DWOU DWOU PostScript PDF and PCL XL file format drivers in Ghostscript 5 01 Encapsulated PostScript EPS epswrite Portable Document Format PDF pdf
41. n cases of such trojan horses you should protect yourself against this kind of attack Ghostscript s dSAFER op tion disables critical file operators the interpreter refuses to open files other than read only GSview launches Ghostscript with this option by default Ghostview for Unix uses the option if launched with the safer option itself Chapter 4 Ghostscript Primer 17 5 Ghostscript Reference Section 5 1 Command Line Options On all platforms Ghostscript evaluates several command line options used to control the interpreter h help These options cause Ghostscript to print a brief help message and a list of available i e built in device drivers on screen lt filename gt Ghostscript reads the specified file and treats its contents the same as the command line This makes it easier to use com mand line options on Windows or to use command lines longer than 128 characters on MS DOS lt filename gt argi lt filename gt argl Ghostscript treats the file name as usual but stores the remain ing arguments in an array named ARGUMENTS in userdict This way PostScript programs can access options and command line arguments lt filename gt argl Same as and but expands arguments from arefile c tokens Interprets arguments up to the next as PostScript code and executes them Each argument must be exactly one token un Dname token dname token Defines a n
42. nce the original book i layout dew torie rom fe e eas family 8 Ghostscript displays the pages one after another from the be gt Pages can be printed on both letter and A4 format paper The double ginning to the end of the file page design also makes it easy to read the manual on screen gt A two page spread was slightly reduced and printed on one sheet of paper in order to economically make use of paper and screen estate Printer output Another important task ofa PostScript RIP is to render PostScript data for output on a graphics capable Production notes I created a PostScript file from the FrameMaker file printer The Ghostscript distribution contains a wealth of driv via the PostScript printer driver The resulting PostScript file was convert i ed to PDF using Acrobat Distiller 3 0 Bookmarks and article threads were ers for a wide range of printer models from the more popular automatically generated by FrameMaker Additionally I inserted several A pdfmark instructions in the document manually e g to populate the docu to the more esoteric A list of all drivers is found in section 3 3 ment info fields and to set the open mode of the PDF file Configuration Options and Drivers These drivers are an inte gral part of Ghostscript and are not related to Macintosh or This is version 1 3 of the manual It covers Ghostscript 5 01 and GSview 2 2 3 X Windows system drivers Ghostscript User Manual Chapter 1
43. ntmap vms VAX VMS with DECwindows Motif and DPS Ghostscript User Manual In order to let Ghostscript access the fonts in Display PostScript systems you have to include the appropriate path name in GS_LIB Dynamic font configuration For large or frequently chang ing font installations the second method is preferable Ghost script checks the GS_FONTPATH environment variable to de termine the available font files and scans these files to find out the names of the fonts they contain Similar to GS_LIB above this variable contains one or more directory names Since Ghostscript automatically recognizes fonts this method is much more flexible However since Ghostscript checks all font directories every time a new font is requested this method in creases startup time To avoid inconsistencies make sure there is no Fontmap file in one of the GS_LIB directories if you use GS_FONTPATH or launch Ghostscript with the dNOFONT MAP option TrueType fonts Starting with Version 4 0 Ghostscript con tains a rasterizer for TrueType fonts Note that Ghostscript sup ports two flavors of TrueType fonts Type 42 fonts These contain TrueType data wrapped in PostScript instructions and can be directly processed by the in terpreter Type 42 capability is integrated in all Ghostscript con figurations which include Level 2 support which is the case for all default makefiles Level 2 capable Ghostscript versions ac cept PostScript files with embedde
44. ps file2 ps The interpreter processes the files one after the other Then Ghostscript prompts for PostScript commands GS gt At this prompt you can type PostScript operators If it is clumsy or uncommon to pass file names on the command line e g on Windows you can open files with the run command at the prompt Try the tiger ps sample file included in the Ghostscript distribution Chapter 4 Ghostscript Primer 14 GS gt tiger ps run On the Mac it s even easier to use the File Open menu command Note concerning MS DOS path names Since the backslash escapes the next character in PostScript strings you have to use double backslashes in path names However a single Unix style slash also works as a separator in path names for ex ample GS gt c gs tiger ps run The following command exits the interpreter GS gt quit Alternatively you can append c quit or dBATCH to the com mand line Selecting a driver Usually Ghostscript uses the first driver in its internal list configured at build time This driver outputs to the screen in the standard configurations on all operating systems You can select another driver on the command line gs sDEVICE laserjet file ps c quit This instructs Ghostscript to produces output for the particular device or file format laserjet in the example above Using the following commands at the Ghostscript prompt you can change the driver at any tim
45. put from file or pipe instead of from the keyboard Ghostscript reads and processes data from standard input and exits Note that it s not possible to read PDF files from standard input Chapter 5 Ghostscript Reference Section 18 Special PostScript names used as switches The use txt file contains some more options for debugging Ghostscript A couple of names with special meanings is being interpreted by the PostScript code in Ghostscript s initialization files They work similar to command line options dBATCH Instead of displaying the interactive prompt after processing all command line files Ghostscript exits Equivalent to c quit dCOLORSCREEN On devices with at least 150 dpi resolution forces the use of sep arate halftone screens with different angles for the process col ors this produces the best quality output dCOLORSCREEN 0 Uses separate screens with the same frequency and angle for the process colors dCOLORSCREEN false Forces the use of a single binary screen If COLORSCREEN is not specified the default is to use separate screens with differ ent angles if the device has fewer than 5 bits per color dDELAYBIND Delay all bind operations until bindnow is called Used by the pstotext package dDEVICEWIDTH lt number gt dDEVICEHEIGHT lt number gt Sets width and height of the device respectively in pixels dDEVICEXRESOLUTION lt number gt dDEVICEYRESOLUTION lt number gt S
46. r details Xerox XES 2700 3700 4045 and others oce9050 okiibm oki182 os2prn r4081 nwp533 sj48 sparc t4693d2 t4693d4 t4693d8 tek4696 uniprint xes Fax and other raster file format drivers in Ghostscript 5 01 BMP monochrome BMP 4 bits EGA VGA BMP 8 bits BMP 24 bits CGM b w low level output only CGM 8 bits low level output only CGM 24 bits low level output only CIF file format for VLSI DigiBoard DigiFAX high resolution DigiBoard DigiFAX low resolution Fax group 3 with EOLs no header or EOD Fax group 3 2 D with EOLs no header or EOD Fax group 4 with EOLs no header or EOD ImageMagick MIFF format 24 bit color RLE compressed JPEG format with JFIF header RGB output JPEG format with JFIF header gray output MGR devices 1 bit monochrome MGR devices 2 bits gray scale MGR devices 4 bits gray scale MGR devices 8 bits gray scale MGR devices 4 bits color MGR devices 8 bits color PCX 4 bit CMYK PCX monochrome PCX 8 bits gray scale PCX 4 bits color bmpmono bmp16 bmp256 bmp16m cgmmono cgm8 cgm24 cif dfaxhigh dfaxlow faxg3 faxg32d faxg4 miff24 jpeg jpeggray mgrmono mgrgray2 mgrgray4 mgrgray8 mgr4 mgr8 pcxcmyk pexmono pexgray pex16 WO WO WO WO DWOUM DWOUM DWOUM Chapter 3 Building Ghostscript from C Source 13 PCX 8 bits color pex256 PCX 24 bits color pex24b PKM Portable Inkmap CMYK internally RGB output ASCII pkm PKM raw format pkmraw Plai
47. r messages with and as Adobe Interpreters do dTextAlphaBits lt n gt Specifies the bit depth for text anti aliasing Possible values are 1 no anti aliasing 2 and 4 Note that only few drivers are ca pable of anti aliasing dWRITESYSTEMDICT Systemdict remains writable This is necessary for some utility programs that must bypass normal PostScript access protection such as font2c and pcharstr sDEVICE lt device gt Select the initial output device driver Ghostscript User Manual sFONTMAP lt filenamel gt lt filename2 gt Defines one or more file names for the font file mapping table Several file names are separated by a semicolon under Win dows and OS 2 and a colon under Unix sFONTPATH lt dirnamel gt lt dirname2 gt Defines one or more directory names to be searched for font definitions Several path names are separated by a semicolon ander Windows and OS 2 and a colon under Unix sOutputFile lt filename gt Selects an output file name or pipe If the file name contains the characters d Ghostscript replaces the d with the actual page number and creates one file for each page e g page od prn yields pagel prn page2 prn and so on On OS 2 Windows 95 and Windows NT you can use printer queue names sOutputFile spool printername sends the output to the named printer queue If the printer name is missing Ghostscript prompts for the
48. re ghostscript 5 xx To complete the installation you have to install fonts for Ghostscript as described in section 2 5 Font Configuration Compiling and installing Ghostview Now you should in stall and compile the Ghostview source This is accomplished with the commands gunzip c ghostview 1 5 tar gz tar xvf cd ghostview 1 5 xmkmf make make install If your system doesn t have the xmkmf program you have to adapt the Ghostview makefile manually this shouldn t be too hard if you have ever worked with makefiles Ghostscript User Manual Compiling on the Macintosh In addition to the source code in MS DOS or Unix format you need the archive macgs v1 0 src sit hqx to compile Ghostscript for the Mac This ar chive contains some additional Macintosh specific files The source files end up in several folders You ll find an overview of the build process in the Mac GS Viewer Manual part of the Ghostscript files and some hints for compiling with the MPW or CodeWarrior compilers in the file worksheet Compiling on other systems The file readme contains some remarks on Ghostscript ports to other systems including VMS Amiga Atari ST Acorn Archimedes and NEXTSTEP 3 3 Configuration Options and Drivers You can adjust the Ghostscript makefile to build a version that suits your needs with several extensions and an individual as sortment of drivers The most important options are PostScript Level 1 PostScript Level 2
49. ript xResolution 72 Ghostscript yResolution 72 If you want Ghostscript to use the same resource settings every time it s best to put the resources into a file and load it with the xrdb program Configuration Error Messages Ghostscript issues the usual PostScript error messages see Chapter 2 of this book Additionally there are some messages relating to Ghostscript installation or configuration errors in stead of PostScript errors undefinedfilename in Fontmap Ghostscript can t find the Fontmap file and the GS_FONTPATH environment variable isn t set Install a Fontmap file or set GS_FONTPATH to point to an appropriate font directory Can t find or open initialization file gs_init ps Ghostscript can t find its main initialization file Use the I op tion or the GS_LIB enviroment variable to point Ghostscript to the directory containing the gs_ ps files Can t find or can t open font file xxx The Fontmap file contains a font file entry for a nonexistent file or a file that Ghostscript can t open Under Unix check the file permissions Chapter 5 Ghostscript Reference Section 21 Substituting font Courier for xxx Ghostscript can t find a requested font and substitutes for it with another font Processing continues Unable to load default font xxx Giving up Ghostscript can t find the default font file and hence isn t able to do text output at all Therefore processing stops Check the font
50. s e How to port EPS files or fonts from Mac to Windows to Unix e Pros and cons of different PostScript drivers for Windows e How to install PostScript fonts in the X Window System e How to interpret and fix PostScript error messages e How to edit or create PostScript fonts e How to make EPS files editable again e What s the Control D business with PostScript files e How to make use of Level 2 without a Level 2 savvy driver e How to create hypertext features in PDF files automatically e How to use PDF files without Acrobat software e Linking PDF files to the World Wide Web e Performance optimization and prepress issues Contents Basics Between Monitor and Printer Encapsulated PostScript EPS PostScript Fonts PostScript Level 2 Gray Levels and Color Display PostScript Adobe Acrobat and PDF Miscellaneous Software on the CD ROM Ghostscript Manual Character Sets PostScript amp Acrobat PDF Applications Troubleshooting and Cross Platform Publishing By Thomas Merz Including CD ROM for MS DOS Windows Macintosh Unix ISBN 3 540 60854 0 Springer Verlag Heidelberg Berlin New York Springer Verlag New York Inc 175 Fifth Avenue New York NY 10010 U S A Email orders springer de German Edition Die PostScript und Acrobat Bibel Was Sie schon immer ber PostScript und Acrobat PDF wissen wollten Von Thomas Merz 444 Seiten zweifarbig 137 Abbildungen Hardcover DM 89 CD ROM fiir MS DOS Win
51. s covered in this book These include displaying graphics files in the formats GIF JPEG or PBM extracting textual data from PostScript or PDF files ras terizing PostScript to raster graphics formats such as TIFF PBM PNG converting EPS graphics to the editable Illustrator format and many other useful features License conditions for the end user Although Ghost script is available free of charge it is subject to certain license conditions These are always contained in the Ghostscript pro gram package Until 1994 Ghostscript was subject to the GNU Public License GPL Under the terms of this license the origi nator retains the copyright for his work The use and further distribution of the program however are not restricted signifi cantly Starting with version 3 0 in 1994 Peter Deutsch replaced the GPL with the more restrictive Aladdin Ghostscript Free Ghostscript User Manual Public License AGFPL Under the terms of the AGFPL no payment is required for private and commercial use of the pro gram The sale of Ghostscript is explicitly prohibited however Exempted from these conditions are BBSs or servers for which users pay access fees independent of the downloaded software and CD ROMs whose contents may be reproduced and distrib uted without any payment involved Anyone interested in com mercially licensing Ghostscript should contact Aladdin Enter prises or one of its distribution partners The complete text of the A
52. s is covered in section 2 5 Font Configuration If you want Ghostscript to use the same command line options every time you can use the environment variable GS_OPTIONS Ghostscript evaluates this variable before checking the real command line options Especially with Windows 3 x this is much more convenient than the rather clumsy call by way of the program manager and File Run 2 3 Installing Ghostscript on the Macintosh Requirements and versions Currently there are two Mac ports of Ghostscript available The first is called Mac GS Viewer and is based on Ghostscript 3 33 A Mac version of GS 4 03 is available as part of the CMacTeX package from http www math tamu edu tkiffe cmactex html The following description applies to Mac GS Viewer It s avail able in three versions one for Macs with Motorola CPU 68020 and higher a native version for PowerPCs and a version for Mac Classics with 68000 CPU min 3 MB available memory The installation needs approximately 6 MB disk space includ ing fonts Contrary to Windows and OS 2 there is no equiva lent of GSview for the Mac Fortunately this deficiency is com Chapter 2 Installing Ghostscript File Edit Ghostscript Devices File Edit Ghostscript WUU yvmac cdj550 stcolor pcxmono pcxgray pcxl6 pcx256 tiger ps pcex24b pbm pbmraw pgm pgmraw ppt Fig 4 ppmraw In the Devices menu you tifflzw can c
53. supply a driver name at startup Ghostscript uses the first driver in its list which is a display driver on all platforms Ghostscript User Manual Display drivers in Ghostscript 5 01 Advanced Logic chipset SuperVGA ATI Wonder SuperVGA 256 colors ATEST 3b1 Unixpc monochrome display Borland Graphics Interface CRT sixels e g VT240 compatible terminals EGA 640x350 16 colors Hercules Graphics Display Linux PC with VGALIB Linux PC with VGALIB 256 colors Macintosh window QuickDraw Microsoft Windows DLL OS 2 DLL bitmap OS 2 Presentation Manager Private Eye display Sony Microsystems monochrome display SunView window system SuperVGA with S3 Chip 86C911 SuperVGA 800x600 16 colors SuperVGA with Tseng Labs ET3000 4000 Chip 256 colors SuperVGA with VESA driver Trident SuperVGA 256 colors VGA 640x480 16 colors X Window System X11 release 4 and higher X Window System as alpha device X Window System as CMYK device 1 bit per color X Window System as b w device Printer drivers in Ghostscript 5 01 Apple Dot Matrix printer also for Imagewriter Apple Imagewriter high resolution Apple Imagewriter low resolution Apple Imagewriter LQ 320 x 216 dpi CalComp raster format Canon BubbleJet BJ10e Canon BubbleJet BJ200 Canon Color BubbleJet BJC 600 and BJC 4000 Canon Color Bubblefet BJC 800 Canon LBP 8II laser printer Canon LIPS III laser printer with CaPSL Mitsubishi CP50 color printer DEC LA50 DEC LA70
54. talled and decompresses the ZIP archives Then it creates a program group Windows 3 x or a start menu entry Windows 95 NT 4 0 When GSview is first run it asks whether you want to create a file association between GSview and files with the extension ps eps and pdf This means that double clicking a file of the respective type launches GSview automatically You may al ways want to have the ps and eps associations created how ever create the pdf association only if you don t use Acrobat Reader If you moved the Ghostscript files to another directory you have to choose Options Configure Ghostscript after launching GSview to enter the path name of the Ghostscript DLL the include path and possibly some Ghostscript options see figure 2 GSview simplifies Ghost _File_ Edit Options View Orientation Media Help script usage under File tit6 ps Page 96 96 of 121 Windows and OS 2 It also offers additional possibilities e g dealing With File Open you can open PostScript and PDF files GS view then passes these files on to Ghostscript for rendering Using the menu sequence Media Display Settings you D Input Ploture Output Potue with EPS files Figure 1 Baseline Process Encoder and Decoder A functional block diagram of the Baseline encoding and decoding processes is containedin Figure 1 Encoder oper
55. te the gsd xx directory gunzip c ghostscript 5 xx tar gz tar xvf cd gs5 xx gunzip c jpeg 6a tar gz tar xvf gunzip c libpng x xx tar gz tar xvf gunzip c zlib 1 x x tar gz tar xvf Chapter 3 Building Ghostscript from C Source 10 mv libpng x x x libpng mv zlib x xx zlib The mv commands are necessary because the tar archives in clude directory names containing the version numbers The Ghostscript distribution contains makefiles for several op erating systems and compilers ANSI C Kernighan amp Ritchie and GNU C Choose the appropriate makefile from mak and create a symbolic link with the following command assuming you use the GNU compiler ln s unix gcc mak makefile Use unixansi mak or unix cc mak respectively for an ANSI or K amp R compiler On some systems you have to adapt the search path for X11 specific include files and additional libraries These are controlled by the XINCLUDE und LDFLAGS variables in the makefile which you can change before launching make By changing the prefix variable in the makefile you can adapt the install directory Now compile and install Ghostscript with the command make install Consult the make txt file if you have trouble with the build pro cess The install process needs root permission on most systems After compiling Ghostscript the install command copies the ex ecutable program to usr local bin and the auxiliary files to usr local sha
56. tup message of the DOS extender for the 386 MS DOS version 5 3 X Window System Resources Ghostscript evaluates several X resources under the program name ghostscript and the class name Ghostscript You can use X resources to define user preferences or to activate bug workarounds for several X servers In the use txt file you can find more information on resources The table below lists all re sources together with their default values Name Class Default value background Background white foreground Foreground black borderColor BorderColor black borderWidth BorderWidth 1 geometry Geometry NULL xResolution Resolution calc from screen size yResolution Resolution calc from screen size useExternalFonts UseExternalFonts true useScalableFonts UseScalableFonts true logExternalFonts LogExternalFonts false externalFontTolerance ExternalFontTolerance 10 0 palette Palette Color maxGrayRamp MaxGrayRamp 128 maxRGBRamp MaxRGBRamp 5 Ghostscript User Manual 5 4 Name Class Default value maxDynamicColors MaxDynamicColors 256 useBackingPixmap UseBackingPixmap true useXPutImage UseXPutImage true useXSetTile UseXSetTile true regularFonts RegularFonts see use txt symbolFonts SymbolFonts see use txt dingbatFonts DingbatFonts see use txt As an example the resources below select a resolution of 72 dpi independent of actual screen size and resolution and disable platform fonts Ghostscript useExternalFonts false Ghostsc
57. utFile file pdf file ps Again a shell script batch file simplifies the process ps2pdf file ps file pdf Ghostscript User Manual There are no further options available for PS to PDF conversion Ghostscript recognizes the pdfmark and setdistillerparams opera tors However the distiller parameters are ignored with the ex ception of ASCII85 encoding Text in any other font than the 14 Acrobat base fonts or in fonts with non standard encodings is converted to bitmaps Encrypted PDF files PDF files may optionally contain en crypted data PDF encryption uses a combination of the MD5 and RC4 algorithms Although code for these algorithms is publicly available current U S export regulations make it im possible to include the code necessary for reading encrypted PDF files in the Ghostscript distribution You may however re trieve a simple add on file from the following URL http www ozemail com au geoffk pdfencrypt Of course this file doesn t contain a code cracker you still need the password to open encrypted PDF files PDF files in GSview and Ghostview Note that because of the idiosyncrasies of the PDF format Ghostscript isn t able to read PDF files from its standard input Due to this fact display ing PDF files with Ghostview has its limitations You can use the following command line for Ghostview on Unix to browse PDF files one page after the other It s not possible to jump to arbitrary page numbers ghostview
58. want to create to the joutput variable Now launch Ghostscript with the converter and the PostScript file to be converted to AI format gs dNODISPLAY ps2ai ps file ps For EPS files that are missing the showpage operator at the end you have to type this operator at the Ghostscript prompt before quitting in order to completely render the page For the conver sion to be successful it is necessary for Ghostscript to have ac cess to all fonts used in the PostScript file Note that the conver sion isn t perfect there may be problems concerning color ramps and grouped objects in the converted AI files Unfortunately ps2ai ps doesn t work on the Mac 6 2 PDF Files Displaying and printing PDF files You can list PDF files on Ghostscript s command line or in GSview s open dialog box just like you can PostScript files because Ghostscript recognizes PDF files automatically In order to be able to process PDF files Ghostscript must be configured with the PDF interpreter By default this is true on all 32 bit systems except the Macintosh Ghostscript interprets the printable contents of PDF files only and ignores hypertext elements such as links annotations and bookmarks and thumbnails Although there is no font substitu tion with Multiple Master fonts Ghostscript replaces a missing Chapter 6 More Ghostscript Applications 23 font with a similar one and adjusts the metrics of the substitut ed font to those of the missing
59. win32s so it may already be installed on your system The MS DOS version of Ghostscript uses the environment variable GS_LIB to locate the initialization files if they cannot be found in the current directory or the standard directory c gs It s best to include the following statements in your autoexec bat file assuming you installed Ghostscript in d progs gs set GS_LIB d progs gs set PATH other path entries d progs gs Alternatively the command line option I can be used to tell Ghostscript where to find its files gs Id progs gs Ghostscript User Manual Launching and testing Ghostscript On MS DOS you start Ghostscript by typing the program name gs386 In Win dows it s easier to double click on Ghostscript s icon in the file manager or Explorer or to create an icon in the program man ager start menu The file tiger ps part of the Ghostscript distri bution is perfectly suited to test your installation Start Ghost script and type in the following command at Ghostscript s prompt GS gt tiger ps run Ghostscript should now display the test file on screen Having finished the page Ghostscript asks you to gt gt showpage press lt return gt to continue lt lt If the file contains more than one page Ghostscript renders the next page after the return key is pressed Caution The installation is not yet complete To complete the installation font access for Ghostscript needs to be config ured Thi
60. write PostScript Level 1 monochrome bitmap psmono PostScript Level 1 8 bit gray psgray Vector PostScript not rasterized pswrite HP PCL XL mono pxlmono HP PCL XL color pxlcolor Ghostscript User Manual wu DWOU DWOU DWOU wu wu wu 4 Ghostscript Primer 4 1 This section is meant to give you a jump start into directly using Ghostscript If you use GSview or Ghostview to drive Ghost script you only have to configure the appropriate Ghostscript call the rest is handled by the frontend Launching Ghostscript In the following examples gs always represents the name of the Ghostscript executable file Depending on your platform the actual name may vary File search path First you have to make sure that Ghost script finds its initialization and font files When searching for files without an absolute file name Ghostscript uses the follow ing search order gt The current directory gt The directories listed at the I command line option e g on MS DOS Windows or OS 2 gs Id gstools gs5 xx d gstools gs5 xx fonts or on Unix gs I usr local lib gs usr local psfonts gt The directories listed in the GS_LIB environment variable gt Predefined directories selected at build time using the GS_LIB_DEFAULT makefile variable C gs on MS DOS Windows or OS 2 usr local share ghostscript 5 xx on Unix Watch the tiger Ghostscript accepts the names of the Post Script files to display or print gs filel
61. xactly match the system font name For small font sizes platform fonts generally improve screen font representation In some situations however they make it worse e g if PostScript and system font metrics don t match which results in ugly formatting Another problem affects fonts with unusual character sets encodings In both cases you can turn off platform fonts by launching Ghostscript with the dNOPLATFONTS option There is also a special X Window re source to achieve this Ghostscript useExternalFonts false Ghostscript User Manual 3 Building Ghostscript from C Source 3 1 Since the C source code of Ghostscript is readily available you can build an executable version of the interpreter if you have a C compiler for your system and some experience in compiling C programs This way you can link in additional drivers that are contained in the Ghostscript distribution but that due to memory restrictions are not compiled into the standard ver sions More adventurous programmers also have the chance to implement their own extensions to Ghostscript The following sections will give an overview of the compilation process and the configuration options A Little Tour to Ghostscript Files The Ghostscript source directory contains several hundred files The compilation may even double this number so you may well get lost in this multitude of files The following table lists the most important file types contained in th

Download Pdf Manuals

image

Related Search

Related Contents

Qware AC Power adapter  MetroMax 4TM Shelving System MetroMax 4TM Système d`étagères  MCR-B043 - Villatech  DIRECTIVES GENERALES (à consulter avant toutes  218 Manual - Lake Shore Cryotronics, Inc.  strdh130 service manual  Untitled - BMW Motorrad  NOVA SCOTIA HEALTH AUTHORITY  Harbor Freight Tools 91009 User's Manual  CROWM v2.6 User Manual  

Copyright © All rights reserved.
Failed to retrieve file