Use.htm 141 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <title>How to use Ghostscript</title>
  6. <!-- $Id: Use.htm,v 1.136 2005/10/20 19:46:23 ray Exp $ -->
  7. <!-- Originally: use.txt -->
  8. <link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
  9. </head>
  10. <body>
  11. <!-- [1.0 begin visible header] ============================================ -->
  12. <!-- [1.1 begin headline] ================================================== -->
  13. <h1>How to use Ghostscript</h1>
  14. <!-- [1.1 end headline] ==================================================== -->
  15. <!-- [1.2 begin table of contents] ========================================= -->
  16. <h2>Table of contents</h2>
  17. <blockquote><ul>
  18. <li><a href="#Invoking">Invoking Ghostscript</a>
  19. <ul>
  20. <li><a href="#Help_command">Help at the command line: <b><tt>gs -h</tt></b></a>
  21. </ul>
  22. <li><a href="#Output_device">Selecting an output device</a>
  23. <ul>
  24. <li><a href="#Output_resolution">Output resolution</a>
  25. <li><a href="#File_output">Output to files</a>
  26. <ul>
  27. <li><a href="#One_page_per_file">One page per file</a>
  28. </ul>
  29. <li><a href="#Paper_size">Choosing paper size</a>
  30. <li><a href="#Change_default_size">Changing the installed default paper size</a>
  31. </ul>
  32. <li><a href="#Pipes">Interacting with pipes</a>
  33. <li><a href="#PDF">Using Ghostscript with PDF files</a>
  34. <ul>
  35. <li><a href="#PDF_switches">Switches for PDF files</a>
  36. <li><a href="#PDF_problems">Problems interpreting a PDF file</a>
  37. <li><a href="#PDF_stdin">PDF files from standard input</a>
  38. </ul>
  39. <li><a href="#EPS">Using Ghostscript with EPS files</a>
  40. <li><a href="#SPOT">Using Ghostscript with overprinting and spot colors</a>
  41. <li><a href="#Finding_files">How Ghostscript finds files</a>
  42. <ul>
  43. <li><a href="#PS_resources">Finding PostScript Level 2 resources</a>
  44. <li><a href="#Font_lookup">Font lookup</a>
  45. <li><a href="#CIDFonts">CID fonts</a>
  46. <li><a href="#CIDFontSubstitution">CID font substitution</a>
  47. <li><a href="#Temp_files">Temporary files</a>
  48. </ul>
  49. <li><a href="#Platforms">Notes on specific platforms</a>
  50. <ul>
  51. <li><a href="#Unix">Unix</a>
  52. <li><a href="#VMS">VMS</a>
  53. <ul>
  54. <li><a href="#VMS_X_Windows">Using X Windows on VMS</a>
  55. </ul>
  56. <li><a href="#MS_Windows">MS Windows</a>
  57. <li><a href="#X_Windows">X Windows</a>
  58. <ul>
  59. <li><a href="#X_resources">X resources</a>
  60. <li><a href="#X_server_bugs">Working around bugs in X servers</a>
  61. <li><a href="#X_fonts">X fonts</a>
  62. <li><a href="#GS_fonts_as_X_fonts">Using Ghostscript fonts on X displays</a>
  63. <li><a href="#X_device_parameters">X device parameters</a>
  64. </ul>
  65. <li><a href="#SCO_Unix">SCO Unix</a>
  66. </ul>
  67. <li><a href="#Options">Command line options</a>
  68. <ul>
  69. <li><a href="#General_switches">General switches</a>
  70. <ul>
  71. <li><a href="#Input_control">Input control</a>
  72. <li><a href="#File_searching">File searching</a>
  73. <li><a href="#Parameters">Setting parameters</a>
  74. <li><a href="#Quiet">Suppress messages</a>
  75. </ul>
  76. <li><a href="#Parameter_switches">Parameter switches (<b><tt>-d</tt></b> and <b><tt>-s</tt></b>)</a>
  77. <ul>
  78. <li><a href="#Rendering_parameters">Rendering parameters</a>
  79. <li><a href="#Page_parameters">Page parameters</a>
  80. <li><a href="#Font_related_parameters">Font-related parameters</a>
  81. <li><a href="#Resource_related_parameters">Resource-related parameters</a>
  82. <li><a href="#Interaction_related_parameters">Interaction-related parameters</a>
  83. <li><a href="#Output_selection_parameters">Device and output selection parameters</a>
  84. <li><a href="#EPS_parameters">EPS parameters</a>
  85. <li><a href="#Other_parameters">Other parameters</a>
  86. </ul>
  87. </ul>
  88. <li><a href="#Improving_performance">Improving performance</a>
  89. <li><a href="#Environment_variables">Summary of environment variables</a>
  90. <li><a href="#Debugging">Debugging</a>
  91. <ul>
  92. <li><a href="#Debug_switches">Debug Switches</a>
  93. <li><a href="#Visual_trace">Visual Trace</a>
  94. </ul>
  95. <li><a href="#Known_paper_sizes">Appendix: Paper sizes known to Ghostscript</a>
  96. <li><a href="#X_font_mappings">Appendix: X default font mappings</a>
  97. <ul>
  98. <li><a href="#Standard_X_server_fonts">Standard X servers</a>
  99. <ul>
  100. <li><a href="#X_regular_fonts">Regular fonts</a>
  101. <li><a href="#X_symbol_fonts">Symbol fonts</a>
  102. <li><a href="#X_dingbat_fonts">Dingbat fonts</a>
  103. </ul>
  104. <li><a href="#OpenWindows_fonts">Sun OpenWindows</a>
  105. </ul>
  106. <li><a href="#FAPI_run">Appendix: Running Ghostscript with 3d party font renderers</a>
  107. </ul></blockquote>
  108. <!-- [1.2 end table of contents] =========================================== -->
  109. <!-- [1.3 begin hint] ====================================================== -->
  110. <p>For other information, see the <a href="Readme.htm">Ghostscript
  111. overview</a> and, if necessary, how to
  112. <a href="Install.htm">install Ghostscript</a>.
  113. <!-- [1.3 end hint] ======================================================== -->
  114. <hr>
  115. <!-- [1.0 end visible header] ============================================== -->
  116. <!-- [2.0 begin contents] ================================================== -->
  117. <h2><a name="Invoking"></a>Invoking Ghostscript</h2>
  118. <p>This document describes how to use the command line Ghostscript client.
  119. Ghostscript is also used as a general engine inside other applications (for viewing files for example).
  120. Please refer to the documentation for those applications for using Ghostscript in other contexts.
  121. <p><a name="Command_line"></a> The command line to invoke Ghostscript is
  122. essentially the same on all systems, although the name of the executable
  123. program itself may differ among systems. For instance, to invoke
  124. Ghostscript on unix-like systems type:
  125. <blockquote>
  126. <pre><b><tt>gs</tt></b> [options] {filename 1} ... [options] {filename <em>N</em>} ...
  127. </pre></blockquote>
  128. <p>Here are some basic examples. The details of how these work are described below.
  129. <p>To view a file:
  130. <blockquote><pre>gs -dSAFER -dBATCH document.pdf</pre></blockquote>
  131. You'll be prompted to press <em>return</em> between pages.
  132. <p>To convert a figure to an image file:
  133. <blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 \
  134. -sOutputFile=tiger.png tiger.eps</pre></blockquote>
  135. <p>To render the same image at 300 dpi:
  136. <blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 \
  137. -sOutputFile=tiger_300.png tiger.eps
  138. </pre></blockquote>
  139. <p>To render a figure in grayscale:
  140. <blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pnggray -sOutputFile=figure.png figure.pdf
  141. </pre></blockquote>
  142. <p>To rasterize a whole document:
  143. <blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pgmraw -r150 \
  144. -dTextAlphaBits=4 -sOutputFile='paper-%00d.pgm' paper.ps</pre></blockquote>
  145. <p>There are also a number of utility scripts for common
  146. to convert a PostScript document to PDF:
  147. <blockquote><pre>ps2pdf file.ps</pre></blockquote>
  148. The output is saved as file.pdf.
  149. <p>There are other utility scripts besides <tt>ps2pdf</tt>, including <tt>pdf2ps</tt>, <tt>ps2epsi</tt>, <tt>pdf2dsc</tt>, <tt>ps2ascii</tt>,
  150. <tt>ps2ps</tt> and <tt>ps2ps2</tt>. These just call Ghostscript with the appropriate
  151. (if complicated) set of options. You can use the 'ps2' set with eps files.
  152. <p>
  153. Ghostscript is capable of interpreting PostScript, encapsulated PostScript
  154. (EPS), DOS EPS (EPSF), and Adobe Portable Document Format (PDF). The interpreter reads and executes the files in sequence, using the method described under "<a href="#File_searching">File searching</a>" to find them.
  155. <p>The interpreter runs in interactive mode by default. After processing the files given on the command line (if any) it reads further lines of PostScript language commands from the primary input stream, normally the keyboard, interpreting each line separately. To quit the interpreter, type "<b><tt>quit</tt></b>". The <tt>-dBATCH -dNOPAUSE</tt> options in the examples above disable the interactive prompting. The interpreter also quits gracefully if it encounters end-of-file or control-C.
  156. <p>
  157. The interpreter recognizes many options. An option may appear anywhere in the command line, and applies to all files named after it on the line. Many of them include "<b><tt>=</tt></b>"
  158. followed by a parameter. The most important are described in detail here. Please see the reference
  159. sections on <a href="#Options">options</a> and <a href="Devices.htm">devices</a> for a more complete listing.
  160. <h3><a name="Help_command"></a>Help at the command line: <b><tt>gs -h</tt></b></h3>
  161. <p>
  162. You can get a brief help message by invoking Ghostscript with the
  163. <b><tt>-h</tt></b> or <b><tt>-?</tt></b> switch, like this:
  164. <blockquote><pre>
  165. gs -h
  166. gs -?
  167. </pre></blockquote>
  168. <p>
  169. The message shows for that version of the Ghostscript executable:
  170. <ul>
  171. <li>the version and release information
  172. <li>the general format of the command line
  173. <li>a few of the most useful options
  174. <li>the formats it can interpret
  175. <li>the available output devices
  176. <li>the search path
  177. <li>the bug report address
  178. </ul>
  179. <p>
  180. On other systems the executable may have a different name:
  181. <blockquote><table cellpadding=0 cellspacing=0>
  182. <tr bgcolor="#CCCC00">
  183. <th align=left>System
  184. <th>&nbsp;&nbsp;
  185. <th align=left>invocation name
  186. <tr> <td>Unix
  187. <td>&nbsp;<td><b><tt>gs</tt></b>
  188. <tr> <td>VMS
  189. <td>&nbsp;<td><b><tt>gs</tt></b>
  190. <tr> <td>MS Windows 95 and later
  191. <td>&nbsp;<td><b><tt>gswin32c</tt></b>
  192. <tr> <td>MS Windows 3.1/Win32s
  193. <td>&nbsp;<td><b><tt>gswin32</tt></b>
  194. <tr> <td>OS/2
  195. <td>&nbsp;<td><b><tt>gsos2</tt></b>
  196. </table></blockquote>
  197. <h2><a name="Output_device"></a>Selecting an output device</h2>
  198. <p>
  199. Ghostscript has a notion of 'output devices' which handle saving or displaying the results in a particular format. Ghostscript comes with a diverse variety of such devices supporting vector and raster file output, screen display, driving various printers and communicating with other applications.
  200. <p>
  201. The command line option '<tt>-sDEVICE=</tt><em>device</em>' selects which output device Ghostscript should use. If this option isn't given the default device (usually a display device) is used. Ghostscript's built-in help message (<tt>gs&nbsp;-h</tt>) lists
  202. the available output devices. For complete description of the devices distributed with Ghostscript and their options, please see the <a href="Devices.htm">devices section</a> of the documentation.
  203. <p><a name="Device_output"></a>
  204. Note that this switch must precede the name of the first input file, and
  205. only its first use has any effect. For example, for printer output in a
  206. configuration that includes an Epson printer driver, instead of just
  207. <tt>'gs&nbsp;myfile.ps'</tt> you might use
  208. <blockquote>
  209. <b><tt>gs -sDEVICE=epson myfile.ps</tt></b>
  210. </blockquote>
  211. <p><a name="GS_DEVICE"></a>
  212. The output device can also be set through the <tt>GS_DEVICE</tt> environment variable.
  213. <p>
  214. Once you invoke Ghostscript
  215. you can also find out what devices are available by typing
  216. '<tt>devicenames&nbsp;==</tt>' at the interactive prompt.
  217. You can set the output device and process a file from the interactive prompt as well:
  218. <blockquote><pre>
  219. (epson) selectdevice
  220. (myfile.ps) run
  221. </pre></blockquote>
  222. All output then goes to the Epson printer instead of the display until you
  223. do something to change devices. You can switch devices at any time by
  224. using the <tt>selectdevice</tt> procedure, for
  225. instance like one of these:
  226. <blockquote><pre>
  227. (x11alpha) selectdevice
  228. (epson) selectdevice
  229. </pre></blockquote>
  230. <h3><a name="Output_resolution"></a>Output resolution</h3>
  231. <p>
  232. Some printers can print at several different resolutions, letting you
  233. balance resolution against printing speed. To select the resolution on
  234. such a printer, use the <b><tt>-r</tt></b> switch:
  235. <blockquote>
  236. <b><tt>gs -sDEVICE=</tt></b><em>printer</em><b><tt> -r</tt></b><em>XRES</em><b><tt>x</tt></b><em>YRES</em>
  237. </blockquote>
  238. where <em>XRES</em> and <em>YRES</em> are the requested number of dots (or pixels) per inch. Where the two resolutions are same, as is the common case, you can simply use <tt>-r</tt><em>res</em>.
  239. <p>
  240. The <tt>-r</tt> option is also useful for controlling the density of pixels when rasterizing to an image file. It is used this way in the examples at the beginning of this document.
  241. <h3><a name="File_output"></a>Output to files</h3>
  242. <p>
  243. Ghostscript also allows you to control where it sends its output. With a display device this isn't necessary as the device handles presenting the output on screen internally. Some specialized printer drivers operate this way as well, but most devices are general and need to be directed to a particular file or printer.
  244. <p>
  245. To send the output to a file, use the <tt>-sOutputFile=</tt> switch.
  246. For instance, to direct all output into the file <tt>ABC.xyz</tt>, use
  247. <blockquote><b><tt>
  248. gs -sOutputFile=ABC.xyz
  249. </tt></b></blockquote>
  250. <p>
  251. When printing on MS Windows systems, output normally goes directly to the printer, <tt>PRN</tt>. On Unix and VMS systems it normally goes to a temporary file which is sent to the printer in a separate step. When using Ghostscript as a file rasterizer (converting PostScript or PDF to a raster image format) you will of course want to specify an appropriately named file for the output.
  252. <p>
  253. Ghostscript also accepts the special filename '<tt>-</tt>' which indicates the output should be written to standard output (the command shell).
  254. <p>
  255. Be aware that filenames beginning with the character <tt>%</tt> have a special meaning in PostScript. If you need to specify a file name that actually
  256. begins with <tt>%</tt>, you must prepend the <tt>%os%</tt> filedevice explicitly. For example to output to a file named <tt>%abc</tt>, you need to specify
  257. <blockquote>
  258. <b><tt>gs -sOutputFile=%os%%abc</tt></b>
  259. </blockquote>
  260. Please see <a href="Language.htm">Ghostscript and the PostScript Language</a> and the PostScript Language Reference Manual for more details on <tt>%</tt> and filedevices.
  261. <p>
  262. Note that on MS Windows systems, the <b><tt>%</tt></b> character also has a special meaning for the command processor (shell), so you will have to double it:
  263. <blockquote>
  264. <b><tt>gs -sOutputFile=%%os%%%%abc</tt></b> (on MS Windows)
  265. </blockquote>
  266. <h4><a name="One_page_per_file"></a>One page per file</h4>
  267. <p>
  268. Specifying a single output file works fine for printing and rasterizing
  269. figures, but sometimes you want images of each page of a multi-page
  270. document. You can tell Ghostscript to put each page of output in a
  271. series of similarly named files. To do this place a template
  272. '<tt>%d</tt>' in the filename which Ghostscript will replace with the
  273. page number.
  274. <p>
  275. You can also control the number of digits used in the file name:
  276. <blockquote><dl>
  277. <dt><b><tt>-sOutputFile=ABC-%d.png</tt></b>
  278. <dd>produces '<tt>ABC-1.png</tt>', ... , '<tt>ABC-10.png</tt>', ...<p>
  279. <dt><b><tt>-sOutputFile=ABC-%03d.pgm</tt></b>
  280. <dd>produces '<tt>ABC-001.pgm</tt>', ... , '<tt>ABC-010.pgm</tt>', ...<p>
  281. <dt><b><tt>-sOutputFile=ABC_p%04d.tiff</tt></b>
  282. <dd>produces '<tt>ABC_p0001.tiff</tt>', ... , '<tt>ABC_p0510.tiff</tt>', ... , '<tt>ABC_p5238.tiff</tt>'<p>
  283. </dl></blockquote>
  284. Generally <tt>%03d</tt> is the best option for normal documents.
  285. <p>
  286. Note however that this features is not supported by all devices; in particular
  287. it does not work with document-oriented output devices like <tt>pdfwrite</tt> and
  288. <tt>pswrite</tt>. See the <tt>-dFirstPage</tt> and <tt>-dLastPage</tt> switches
  289. <a href="#PDF_switches">below</a> for a way to extract single pdf pages.
  290. <p>
  291. As noted above, on MS Windows systems, you will have to double the
  292. <tt>%</tt> character, e.g.,
  293. <blockquote><tt><b>
  294. gs -sOutputFile=ABC%%03d.xyz
  295. </b></tt></blockquote>
  296. <h3><a name="Paper_size"></a>Choosing paper size</h3>
  297. <p>
  298. Ghostscript is distributed configured to use U.S. letter paper as its
  299. default page size. There are two ways to select other paper sizes from the
  300. command line:
  301. <ul>
  302. <li>
  303. If the desired paper size is listed in the section on <a
  304. href="#Known_paper_sizes">paper sizes known to Ghostscript</a> below, you
  305. can select it as the default paper size for a single invocation of
  306. Ghostscript by using the <b><tt>-sPAPERSIZE=</tt></b> switch, for instance
  307. <blockquote><b><tt>
  308. -sPAPERSIZE=a4<br>
  309. -sPAPERSIZE=legal
  310. </tt></b></blockquote>
  311. <li>
  312. Otherwise you can set the page size using the
  313. pair of switches
  314. <blockquote>
  315. <b><tt>-dDEVICEWIDTHPOINTS=</tt></b><em>w</em>
  316. <b><tt>-dDEVICEHEIGHTPOINTS=</tt></b><em>h</em>
  317. </blockquote>
  318. Where <em>w</em> be the desired paper width and <em>h</em> be the
  319. desired paper height in <em>points</em> (units of 1/72 of an inch).
  320. </ul>
  321. <p>
  322. Individual documents can (and often do) specify a paper size, which takes
  323. precedence over the default size. To force a specific paper size and
  324. ignore the paper size specified in the document, select a paper size as
  325. just described, and also include the
  326. <a href="#FIXEDMEDIA"><b><tt>-dFIXEDMEDIA</tt></b> switch</a> on the
  327. command line.
  328. <p>
  329. The default set of paper sizes will be included in the <b><tt>currentpagedevice</tt></b>
  330. in the <b><tt>InputAttributes</tt></b> dictionary with each paper size as
  331. one of the entries. The last entry in the dictionary (which has numeric keys)
  332. is a non-standard (Ghostscript extension) type of PageSize where the array
  333. has four elements rather than the standard two elements. This four element
  334. array represents a page size range where the first two elements are the lower
  335. bound of the range and the second two are the upper bound. By default these
  336. are [0, 0] for the lower bound and [16#fffff, 16#fffff] for the upper bound.
  337. <br>
  338. The range type of PageSize is intended to allow flexible page size sepcification
  339. for non-printer file formats such as JPEG, PNG, TIFF, EPS, ...
  340. <br>
  341. For actual printers, either the entire <b><tt>InputAttributes</tt></b> dictionary
  342. should be replaced or the range type entry should not be included. To simplify
  343. using the default page sizes in the <b><tt>InputAttributes</tt></b> dictionary,
  344. the command line option <b><tt>-dNORANGEPAGESIZE</tt></b> can be used. Using
  345. this option will result in automatic rotation of the document page if the requested
  346. page size matches one of the default page sizes.
  347. <h3><a name="Change_default_size"></a>Changing the installed default paper size</h3>
  348. <p>
  349. You can change the installed default paper size on an installed version of Ghostscript, by editing the initialization file <b><tt>gs_init.ps</tt></b>.
  350. This file is usually in the <tt>lib</tt> directory somewhere in the search path. See the section on <a href="#Finding_files">finding files</a> for details.
  351. <p>
  352. Find the line
  353. <blockquote><pre>
  354. % /DEFAULTPAPERSIZE (a4) def
  355. </pre></blockquote>
  356. <p>
  357. Then to make A4 the default paper size, uncomment the line to change
  358. this to
  359. <blockquote><pre>
  360. /DEFAULTPAPERSIZE (a4) def
  361. </pre></blockquote>
  362. <p>
  363. For <tt>a4</tt> you can substitute any
  364. <a href="#Known_paper_sizes">paper size Ghostscript knows</a>.
  365. <p>
  366. This supecedes the previous method of uncommenting the line
  367. <b><tt>% (a4) ...</tt></b>.
  368. <p>
  369. Sometimes the initialization files are compiled into Ghostscript and cannot be changed.
  370. <h2><a name="Pipes"></a>Interacting with pipes</h2>
  371. <p>
  372. As noted above, input files are normally specified on the command
  373. line. However, one can also "pipe" input into Ghostscript from another
  374. program by using the special file name '<b><tt>-</tt></b>' which is interpreted as standard input. Examples:
  375. <blockquote>
  376. {<em>some program producing ps</em>} <b><tt>| gs</tt></b> [options] <b><tt>-</tt></b>
  377. <br>
  378. <tt>zcat paper.ps.gz</tt> <b><tt>| gs</tt></b> <b><tt>-</tt></b>
  379. </blockquote>
  380. <p>
  381. <em>Ghostscript cannot read PDF files from standard input or a pipe because the PDF language inherently requires random access to the file. Thus '<tt>-</tt>' only works with PostScript documents.</em>
  382. <p>
  383. When Ghostscript finishes reading from the pipe, it quits rather than
  384. going into interactive mode. Because of this, options and files after the '<tt>-</tt>' in the command line will be ignored.
  385. <p>
  386. On Unix and MS Windows systems you can send output to a pipe in the same way. For example, to pipe the output to <tt>lpr</tt>, use the command
  387. <blockquote><tt>
  388. <b>gs -q -sOutputFile=- |</b> lpr
  389. </tt></blockquote>
  390. <p>
  391. In this case you must also use the <a href="#Quiet"><b><tt>-q</tt></b>
  392. switch</a> to prevent Ghostscript from writing messages to standard output
  393. which become mixed with the intended output stream.
  394. <p>
  395. Similar results can be obtained with the <tt>%stdout</tt> and <tt>%pipe%</tt> filedevices. The example above would become
  396. <blockquote><tt>
  397. <b>gs -sOutputFile=%stdout -q |</b> lpr
  398. </tt></blockquote>
  399. or
  400. <blockquote><tt>
  401. <b>gs -sOutputFile=%pipe%</b>lpr
  402. </tt></blockquote>
  403. (again, doubling the <b><tt>%</tt></b> character on MS Windows systems.)
  404. <p>
  405. In the last case, <tt>-q</tt> isn't necessary since Ghostscript handles the pipe itself and messages sent to stdout will be printed as normal.
  406. <h2><a name="PDF"></a>Using Ghostscript with PDF files</h2>
  407. <p>
  408. Ghostscript is normally built to interpret both PostScript and PDF files, examining each file to determine automatically whether its contents are PDF or PostScript. All the normal switches and procedures for interpreting PostScript files also apply to PDF files, with a few exceptions. In addition, the
  409. <tt>pdf2ps</tt> utility uses Ghostscript to convert PDF to (Level 2) PostScript.
  410. <h3><a name="PDF_switches"></a>Switches for PDF files</h3>
  411. <p>Here are some command line options specific to PDF
  412. <dl>
  413. <dt><b><tt>-dFirstPage=</tt></b><em>pagenumber</em>
  414. <dd>Begins interpreting on the designated page of the document.
  415. </dl>
  416. <dl>
  417. <dt><b><tt>-dLastPage=</tt></b><em>pagenumber</em>
  418. <dd>Stops interpreting after the designated page of the document.
  419. </dl>
  420. <dl>
  421. <dt><b><tt>-dPDFFitPage</tt></b>
  422. <dd>Rather than selecting a PageSize given by the PDF MediaBox or
  423. CropBox (see -dUseCropBox), the PDF file will be scaled to fit
  424. the current device page size (usually the default page size).
  425. <p>
  426. This is useful to avoid clipping information on a PDF document when
  427. sending to a printer that may have unprintable areas at the edge of
  428. the media larger than allowed for in the document.
  429. <p>
  430. This is also useful for creating fixed size images of PDF files
  431. that may have a variety of page sizes, for example thumbnail images.
  432. </dl>
  433. <dl>
  434. <dt><b><tt>-dPrinted</tt></b>
  435. <dt><b><tt>-dPrinted=false</tt></b>
  436. <dd>Determines whether the file should be displayed or printed using the
  437. "screen" or "printer" options for annotations and images. With
  438. <b><tt>-dPrinted</tt></b>, the output will use the file's "print"
  439. options; with <b><tt>-dPrinted=false</tt></b>, the output will use the
  440. file's "screen" options. If neither of these is specified, the output will
  441. use the screen options for any output device that doesn't have an
  442. <b><tt>OutputFile</tt></b> parameter, and the printer options for
  443. devices that do have this parameter.
  444. </dl>
  445. <dl>
  446. <dt><b><tt>-dUseCropBox</tt></b>
  447. <dd>Sets the page size to the CropBox rather than the MediaBox.
  448. Some files have a CropBox that is smaller than the MediaBox and
  449. may include white space, registration or cutting marks outside
  450. the CropBox. Using this option will set the page size
  451. appropriately for a viewer.
  452. </dl>
  453. <dl>
  454. <dt><b><tt>-sPDFPassword=</tt></b><em>password</em>
  455. <dd>Sets the user or owner password to be used in decoding encrypted
  456. PDF files.
  457. </dl>
  458. <h3><a name="PDF_problems"></a>Problems interpreting a PDF file</h3>
  459. <p>
  460. Occasionally you may try to read or print a 'PDF' file that
  461. Ghostscript doesn't recognize as PDF, even though the same file
  462. <b><em>can</em></b> be opened and interpreted by an Adobe Acrobat viewer.
  463. In many cases, this is because of incorrectly generated PDF. Acrobat
  464. tends to be very forgiving of invalid PDF files. Ghostscript tends to
  465. expect files to conform to the standard. For example, even though
  466. valid PDF files must begin with <b><tt>%PDF</tt></b>, Acrobat will
  467. scan the first 1000 bytes or so for this string, and ignore any preceding
  468. garbage.
  469. <p>
  470. In the past, Ghostscript's policy has been to simply fail with an
  471. error message when confronted with these files. This policy has, no
  472. doubt, encouraged PDF generators to be more careful. However, we now
  473. recognize that this behavior is not very friendly for people who just
  474. want to use Ghostscript to view or print PDF files. Our new policy is
  475. to try to render broken PDF's, and also to print a warning, so that
  476. Ghostscript is still useful as a sanity-check for invalid files.
  477. <h3><a name="PDF_stdin"></a>PDF files from standard input</h3>
  478. <p>
  479. The PDF language, unlike the PostScript language, inherently requires
  480. random access to the file.
  481. If you provide PDF to standard input using the
  482. special filename <a href="#Pipes">'<tt>-</tt>'</a>,
  483. Ghostscript will copy it to a temporary file before interpreting the PDF.
  484. <h2><a name="EPS"></a>Using Ghostscript with EPS files</h2>
  485. <p>
  486. Encapsulated PostScript (EPS) files are intended to be incorporated
  487. in other PostScript documents and may not display or print on their
  488. own. An EPS file must conform to the Document Structuring Conventions,
  489. must include a <b><tt>%%BoundingBox</tt></b> line to indicate the
  490. rectangle in which it will draw, must not use PostScript commands
  491. which will interfere with the document importing the EPS,
  492. and can have either zero pages or one page.
  493. Ghostscript has support for handling EPS files, but requires
  494. that the <b><tt>%%BoundingBox</tt></b> be in the header,
  495. not the trailer.
  496. To customize EPS handling, see <a href="#EPS_parameters">EPS parameters</a>.
  497. <p>
  498. For the official description of the EPS file format, please
  499. refer to the Adobe documentation in their tech note #5002. It
  500. is available from:
  501. <a href="http://partners.adobe.com/public/developer/ps/index_specs.html"
  502. class="offsite">
  503. http://partners.adobe.com/public/developer/ps/index_specs.html</a>
  504. <h2><a name="SPOT"></a>Using Ghostscript with overprinting and spot colors</h2>
  505. <p>
  506. In general with PostScript and PDF interpreters, the handling of
  507. <b>overprinting</b> and <b>spot colors</b> depends upon the
  508. process color model of the <a href="#Output_device">output device</a>. Devices
  509. that produce gray or RGB output have an <b>additive</b> process color model.
  510. Devices which produce CMYK output have a <b>subtractive</b> process color model.
  511. Devices may, or may not, have support for spot colors.
  512. <blockquote><i>
  513. Note: The differences in appearance of files with overprinting and spot colors
  514. caused by the differences in the color model of the output device are part of the
  515. PostScript and PDF specifications. They are not due to a limitation in the
  516. implementation of Ghostscript or its output devices.
  517. </i></blockquote>
  518. <p>
  519. With devices which use a subtractive process color model, both PostScript
  520. and PDF allow the drawing of objects using colorants (inks) for one or more planes
  521. without affecting the data for the remaining colorants. Thus the inks for one
  522. object may <b><tt>overprint</tt></b> the inks for another object. In some cases
  523. this produces a transparency like effect. (The effects of overprinting should
  524. not be confused with the PDF 1.4 blending operations which are supported for
  525. all output devices.) Overprinting is not allowed for devices with an additive
  526. process color model. With files that use overprinting, the appearance of the
  527. resulting image can differ between devices which produce RGB output versus devices
  528. which produce CMYK output. Ghostscript automatically overprints (if needed)
  529. when the output device uses a subtractive process color model. For example,
  530. if the file is using overprinting, differences can be seen in the appearance
  531. of the output from the <a href="Devices.htm#TIFF">tiff24nc and tiff32nc devices</a>
  532. which use an RGB and a CMYK process color models.
  533. <p>
  534. Most of the Ghostscript <a href="Devices.htm">output devices</a> do not have
  535. file formats which support spot colors. Instead spot colors are converted using
  536. the tint transform function contained within the color space definition.. However
  537. there are several devices which have support for spot colors. The PSD format
  538. (Adobe Photoshop) produced by the <a href="Devices.htm#PSD">psdcmyk device</a>
  539. contains both the raster data plus an equivalent CMYK color for each spot color.
  540. This allows Photoshop to simulate the appearance of the spot colors. The <a href="Devices.htm#display_device">display
  541. device (MS Windows, OS/2, gtk+)</a> can be used with different color models:
  542. Gray, RGB, CMYK only, or CMYK plus spot colors (separation). The display device,
  543. when using its CMYK plus spot color (separation) mode, also uses an equivalent
  544. CMYK color to simulate the appearance of the spot color. The
  545. <a href="Devices.htm#TIFF">tiffsep
  546. device</a> creates output files for each separation (CMYK and any spot colors
  547. present). It also creates a composite CMYK file using an equivalent CMYK color
  548. to simulate the appearance of spot colors. The
  549. <a href="Devices.htm#XCF">xcfcmyk device</a>
  550. creates output files with spot colors placed in separate alpha channels. (The
  551. XCF file format does not currently directly support spot colors.)
  552. <p>
  553. Overprinting with spot colors is not allowed if the tint transform function
  554. is being used to convert spot colors. Thus if spot colors are used with overprinting,
  555. then the appearance of the result can differ between output devices. One result
  556. would be obtained with a CMYK only device and another would be obtained with
  557. a CMYK plus spot color device. In a worst case situation where a file has overprinting
  558. with both process (CMYK) and spot colors, it is possible to get three different
  559. appearances for the same input file using the
  560. <a href="Devices.htm#TIFF">tiff24nc</a> (RGB),
  561. <a href="Devices.htm#TIFF">tiff32nc</a> (CMYK), and
  562. <a href="Devices.htm#TIFF">tiffsep</a> (CMYK plus spot colors) devices.
  563. <blockquote><i>
  564. In Adobe Acrobat, viewing of the effects of overprinting is enabled by the
  565. 'Overprint Preview' item in the 'Advanced' menu. This feature is not available
  566. in the free Acrobat Reader. The free Acrobat Reader also uses the tint transform
  567. functions to convert spot colors to the appropriate alternate color space.
  568. </i></blockquote>
  569. <hr>
  570. <h2><a name="Finding_files"></a>How Ghostscript finds files</h2>
  571. <p>
  572. When looking for initialization files (<b><tt>gs_*.ps</tt></b>,
  573. <b><tt>pdf_*.ps</tt></b>), font files, the <b><tt>Fontmap</tt></b> file,
  574. files named on the command line, and resource files, Ghostscript first tests whether the
  575. file name specifies an absolute path.
  576. <blockquote><table cellpadding=0 cellspacing=0>
  577. <tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Testing a file name for an absolute path</font><hr>
  578. <tr> <th align=left>System
  579. <td>&nbsp;&nbsp;
  580. <th align=left>Does the name ...
  581. <tr> <td colspan=3><hr>
  582. <tr> <td valign=top>Unix
  583. <td>&nbsp;
  584. <td>Begin with <b><tt><u>/</u></tt></b> ?
  585. <tr> <td valign=top>MS Windows
  586. <td>&nbsp;
  587. <td>Have <b><tt><u>:</u></tt></b> as its second character, or
  588. begin with <b><tt><u>/</u></tt></b>, <b><tt><u>\</u></tt></b>,
  589. or <b><tt><u>//servername/share/</u></tt></b> ?
  590. <tr> <td valign=top>VMS
  591. <td>&nbsp;
  592. <td>Contain a node, device, or root specification?
  593. </table></blockquote>
  594. <p>If the test succeeds, Ghostscript tries to open the file
  595. using the name given. Otherwise it tries directories in this order:
  596. <ol>
  597. <li>The current directory (unless disabled by the
  598. <a href="#P-_switch"><b><tt>-P-</tt></b> switch</a>);
  599. <li>The directories specified by <a href="#I_switch"><b><tt>-I</tt></b>
  600. switches</a> in the command line, if any;
  601. <li>The directories specified by the <b><tt>GS_LIB</tt></b>
  602. environment variable, if any;
  603. <li>The directories specified by the
  604. <b><tt>GS_LIB_DEFAULT</tt></b> macro (if any) in the makefile
  605. when this executable was built.
  606. </ol>
  607. <p>
  608. <b><tt>GS_LIB_DEFAULT</tt></b>,
  609. <b><tt>GS_LIB</tt></b>, and the
  610. <b><tt>-I</tt></b> parameter may specify either a single
  611. directory or a list of directories separated by a character appropriate for
  612. the operating system ("<b><tt>:</tt></b>" on Unix systems,
  613. "<b><tt>,</tt></b>" on VMS systems, and
  614. "<b><tt>;</tt></b>" on MS Windows systems). We think that trying
  615. the current directory first is a very bad idea -- it opens serious security
  616. loopholes and can lead to very confusing errors if one has more than one
  617. version of Ghostscript in one's environment -- but when we attempted to
  618. change it, users insisted that we change it back. You can disable looking
  619. in the current directory first by using the
  620. <a href="#P_switch"><b><tt>-P-</tt></b> switch</a>.
  621. <p>
  622. Note that Ghostscript does not use this file searching algorithm for the
  623. <b><tt>run</tt></b> or <b><tt>file</tt></b>
  624. operators: for these operators, it simply opens the file with the name
  625. given. To run a file using the searching algorithm, use
  626. <b><tt>runlibfile</tt></b> instead of
  627. <b><tt>run</tt></b>.
  628. <h3><a name="PS_resources"></a>Finding PostScript Level 2 resources</h3>
  629. <p>
  630. Adobe specifies that resources are installed in a single directory.
  631. Ghostscript instead maintains a list of resource directories,
  632. and uses an extended method for finding resource files.
  633. <p>
  634. The search for a resource file depends on whether
  635. the value of the system parameter <b><tt>GenericResourceDir</tt></b>
  636. specifies an absolute path. The user may set it as explained in
  637. <a href="#Resource_related_parameters">Resource-related parameters</a>.
  638. <p>
  639. If the user doesn't set the system parameter <b><tt>GenericResourceDir</tt></b>,
  640. Ghostscript creates a default value for it with
  641. attaching the string <b><tt>../Resource</tt></b>
  642. to directory paths explained in
  643. <a href="#Finding_files">How Ghostscript finds files</a>,
  644. except the current directory.
  645. The first successful combination is used.
  646. <p>
  647. If the value of the system parameter <b><tt>GenericResourceDir</tt></b>
  648. is an absolute path (the default),
  649. Ghostscript assumes a single resource directory.
  650. It concatenates :
  651. <ol>
  652. <li>The value of the system parameter <b><tt>GenericResourceDir</tt></b>;
  653. <li>The name of the resource category (for instance, <b><tt>CMap</tt></b>);
  654. <li>The name of the resource instance (for instance, <b><tt>Identity-H</tt></b>).
  655. </ol>
  656. <p>If the value of the system parameter <b><tt>GenericResourceDir</tt></b>
  657. is not an absolute path,
  658. Ghostscript assumes multiple resource directories.
  659. In this case it concatenates :
  660. <ol>
  661. <li>A directory listed in the section
  662. <a href="#Finding_files">How Ghostscript finds files</a>,
  663. except the current directory;
  664. <li>The value of the system parameter <b><tt>GenericResourceDir</tt></b>;
  665. <li>The name of the resource category (for instance, <b><tt>CMap</tt></b>);
  666. <li>The name of the resource instance (for instance, <b><tt>Identity-H</tt></b>)
  667. </ol>
  668. Due to possible variety of the part 1, the first successful combination is used.
  669. For example, if the value of the system parameter <b><tt>GenericResourceDir</tt></b>
  670. is the string <b><tt>../Resource/</tt></b>
  671. (or its equivalent in the file path syntax of the underlying platform),
  672. Ghostscript searches for <b><tt>../Resource/CMap/Identity-H</tt></b>
  673. from all directories listed in
  674. <a href="#Finding_files">How Ghostscript finds files</a>.
  675. So in this example, if the user on a Windows platform specifies
  676. the command line option <b><tt>-I.;../gs/lib;c:/gs8.50/lib</tt></b>,
  677. Ghostscript searches for <b><tt>../gs/Resource/CMap/Identity-H</tt></b> and
  678. then for <tt><b>c:/gs8.50/Resource/CMap/Identity-H</b></tt>.
  679. <p>
  680. To get a proper platform dependent syntax Ghostscript inserts
  681. the value of the system parameter
  682. <b><tt>GenericResourcePathSep</tt></b> (initially
  683. "<b><tt>/</tt></b>" on Unix and Windows, "<b><tt>:</tt></b>" on MacOS,
  684. "<b><tt>.</tt></b>" or "<b><tt>]</tt></b>" on OpenVMS).
  685. The string <b><tt>../Resource</tt></b> is replaced with a
  686. platform dependent equivalent.
  687. <p>
  688. In the case of multiple resource directories,
  689. the default <b><tt>ResourceFileName</tt></b> procedure retrieves either a path
  690. to the first avaliable resource, or if the resource is not available it
  691. returns a path starting with <b><tt>GenericResourceDir</tt></b>.
  692. Consequently Postscript installers of Postscript resources
  693. will overwrite an existing resource or add a new one to the first resource directory.
  694. <p>
  695. To look up fonts, after exhausting the search method described in <a href="#Font_lookup">the
  696. next section</a>, it concatenates together
  697. <ol>
  698. <li>the value of the system parameter
  699. <b><tt>FontResourceDir</tt></b> (initially
  700. <b><tt>/Resource/Font/</tt></b>)
  701. <li>the name of the resource font (for instance, <b><tt>Times-Roman</tt></b>)
  702. </ol>
  703. <p>
  704. Note that even although the system parameters are named "somethingDir", they
  705. are not just plain directory names: they have "<b><tt>/</tt></b>" on the
  706. end, so that they can be concatenated with the category name or font name.
  707. <h3><a name="Font_lookup"></a>Font lookup</h3>
  708. <p>
  709. Ghostscript has a slightly different way to find the file containing a font
  710. with a given name. This rule uses not only the search path defined by
  711. <b><tt>-I</tt></b>, <b><tt>GS_LIB</tt></b>, and
  712. <b><tt>GS_LIB_DEFAULT</tt></b> <a href="#Finding_files">as described
  713. above</a>, but also the directory that is the value of the
  714. <b><tt>FontResourceDir</tt></b> system parameter, and an additional list of
  715. directories that is the value of the <b><tt>GS_FONTPATH</tt></b> environment
  716. variable (or the value provided with the <b><tt>-sFONTPATH=</tt></b> switch,
  717. if present).
  718. <p>
  719. At startup time, Ghostscript reads in the <b><tt>Fontmap</tt></b> files in
  720. every directory on the search path (or in the list provided with the
  721. <b><tt>-sFONTMAP=</tt></b> switch, if present): these files are catalogs of
  722. fonts and the files that contain them. (See <a href="Fonts.htm#Fontmap">the
  723. documentation of fonts</a> for details.) Then, when Ghostscript needs to
  724. find a font that isn't already loaded into memory, it goes through a series
  725. of steps.
  726. <ul>
  727. <li>
  728. First, it looks up the font name in the combined Fontmaps. If there is an
  729. entry for the desired font name, and the file named in the entry can be
  730. found in some directory on the general search path (defined by
  731. <b><tt>-I</tt></b>, <b><tt>GS_LIB</tt></b>, and
  732. <b><tt>GS_LIB_DEFAULT</tt></b>), and the file is loaded successfully, and
  733. loading it defines a font of the desired name, that is the end of the
  734. process.
  735. <li>
  736. If this process fails at any step, Ghostscript looks for a file whose name
  737. is the concatenation of the value of the <b><tt>FontResourceDir</tt></b>
  738. system parameter and the font name, with no extension. If such a file
  739. exists, can be loaded, and defines a font of the desired name, that again is
  740. the end. The value of <b><tt>FontResourceDir</tt></b> is normally the
  741. string <b><tt>/Resource/Font/</tt></b>, but it can be changed with the
  742. <b><tt>setsystemparams</tt></b> operator: see the PostScript Language
  743. Reference Manual for details.
  744. <li>
  745. If that fails, Ghostscript then looks for a file on the general search path
  746. whose name is the desired font name, with no extension. If such a file
  747. exists, can be loaded, and defines a font of the desired name, that again is
  748. the end.
  749. <li>
  750. If that too fails, Ghostscript looks at the <b><tt>GS_FONTPATH</tt></b>
  751. environment variable (or the value provided with the
  752. <b><tt>-sFONTPATH=</tt></b> switch, if present), which is also a list of
  753. directories. It goes to the first directory on the list, looking for all
  754. files that appear to contain PostScript fonts; it then adds all those files
  755. and fonts to the combined Fontmaps, and starts over.
  756. <li>
  757. If scanning the first FONTPATH directory doesn't produce a file that
  758. provides the desired font, it adds the next directory on the FONTPATH list,
  759. and so on until either the font is defined successfully or the list is
  760. exhausted.
  761. <li>
  762. Finally, if all else fails, it will try to find a substitute for the font
  763. from among the standard 35 fonts.
  764. </ul>
  765. <p>
  766. <a href="#CIDFonts">CID fonts</a> (e.g. Chinese, Japanese and Korean)
  767. are found using a different method.
  768. <blockquote><table cellpadding=0 cellspacing=0>
  769. <tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Differences between search path and font path</font><hr>
  770. <tr> <th>Search path
  771. <td>&nbsp;&nbsp;&nbsp;
  772. <th>Font path
  773. <tr> <td colspan=3><hr>
  774. <tr> <td><b><tt>-I</tt></b> switch
  775. <td>&nbsp;
  776. <td><b><tt>-sFONTPATH=</tt></b> switch
  777. <tr> <td>&nbsp;
  778. <tr> <td><b><tt>GS_LIB</tt></b> and <b><tt>GS_LIB_DEFAULT</tt></b>
  779. environment variables
  780. <td>&nbsp;
  781. <td><b><tt>GS_FONTPATH</tt></b> environment variable
  782. <tr> <td>&nbsp;
  783. <tr> <td valign=top>Consulted first
  784. <td>&nbsp;
  785. <td valign=top>Consulted only if search path and
  786. <b><tt>FontResourceDir</tt></b> don't provide the file.
  787. <tr> <td>&nbsp;
  788. <tr> <td valign=top>Font-name-to-file-name mapping given in Fontmap
  789. files; aliases are possible, and there need not be any relation
  790. between the font name in the Fontmap and the
  791. <b><tt>FontName</tt></b> in the file.
  792. <td>&nbsp; <td valign=top>Font-name-to-file-name mapping is
  793. implicit -- the <b><tt>FontName</tt></b> in the file is
  794. used. Aliases are not possible.
  795. <tr> <td>&nbsp;
  796. <tr> <td valign=top>Only fonts and files named in Fontmap are used.
  797. <td>&nbsp;
  798. <td valign=top>Every Type 1 font file in each directory is
  799. available; if TrueType fonts are supported (the
  800. <b><tt>ttfont.dev</tt></b> feature was included when the
  801. executable was built), they are also available.
  802. </table></blockquote>
  803. <p>
  804. If you are using one of the following types of computer, you may wish to
  805. set the environment variable <b><tt>GS_FONTPATH</tt></b> to
  806. the value indicated so that Ghostscript will automatically acquire all the
  807. installed Type 1 (and, if supported, TrueType) fonts (but see below for
  808. notes on systems marked with "*"):
  809. <blockquote><table cellpadding=0 cellspacing=0>
  810. <tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Suggested <b><tt>GS_FONTPATH</tt></b> for different systems</font><hr>
  811. <tr> <td>&nbsp;
  812. <td>&nbsp;&nbsp;
  813. <th align=left>System type
  814. <td>&nbsp;&nbsp;
  815. <th valign=bottom align=left><b><tt>GS_FONTPATH</tt></b>
  816. <tr> <td colspan=5><hr>
  817. <tr> <td>&nbsp;
  818. <td>&nbsp;
  819. <td valign=top>Digital Unix
  820. <td>&nbsp;
  821. <td><b><tt>/usr/lib/X11/fonts/Type1Adobe</tt></b>
  822. <tr> <td>&nbsp;
  823. <td>&nbsp;
  824. <td valign=top>Ultrix
  825. <td>&nbsp;
  826. <td><b><tt>/usr/lib/DPS/outline/decwin</tt></b>
  827. <tr> <td>&nbsp;
  828. <td>&nbsp;
  829. <td valign=top>HP-UX 9
  830. <td>&nbsp;
  831. <td><b><tt>/usr/lib/X11/fonts/type1.st/typefaces</tt></b>
  832. <tr> <td>&nbsp;
  833. <td>&nbsp;
  834. <td valign=top>IBM AIX
  835. <td>&nbsp;
  836. <td><b><tt>/usr/lpp/DPS/fonts/outlines
  837. <br>/usr/lpp/X11/lib/X11/fonts/Type1
  838. <br>/usr/lpp/X11/lib/X11/fonts/Type1/DPS</tt></b>
  839. <tr> <td>&nbsp;
  840. <td>&nbsp;
  841. <td valign=top>NeXT
  842. <td>&nbsp;
  843. <td><b><tt>/NextLibrary/Fonts/outline</tt></b>
  844. <tr> <td>*
  845. <td>&nbsp;
  846. <td valign=top>SGI IRIX
  847. <td>&nbsp;
  848. <td><b><tt>/usr/lib/DPS/outline/base
  849. <br>/usr/lib/X11/fonts/Type1</tt></b>
  850. <tr> <td>&nbsp;
  851. <td>&nbsp;
  852. <td valign=top>SunOS 4.x<br>(NeWSprint only)
  853. <td>&nbsp;
  854. <td valign=top><b><tt>newsprint_2.5/SUNWsteNP/reloc/$BASEDIR/NeWSprint/<br>&nbsp;&nbsp;&nbsp;&nbsp;small_openwin/lib/fonts</tt></b>
  855. <tr> <td>**
  856. <td>&nbsp;
  857. <td valign=top>SunOS 4.x
  858. <td>&nbsp;
  859. <td><b><tt>/usr/openwin/lib/X11/fonts/Type1/outline</tt></b>
  860. <tr> <td>**
  861. <td>&nbsp;
  862. <td valign=top>Solaris 2.x
  863. <td>&nbsp;
  864. <td><b><tt>/usr/openwin/lib/X11/fonts/Type1/outline</tt></b>
  865. <tr> <td>&nbsp;
  866. <td>&nbsp;
  867. <td valign=top>VMS
  868. <td>&nbsp;
  869. <td><b><tt>SYS$COMMON:[SYSFONT.XDPS.OUTLINE]</tt></b>
  870. </table>
  871. <hr align=left width="25%">
  872. <p>
  873. <b>*</b> On SGI IRIX systems, you must use <b><tt>Fontmap.SGI</tt></b> in
  874. place of <b><tt>Fontmap</tt></b> or <b><tt>Fontmap.GS</tt></b>, because
  875. otherwise the entries in <b><tt>Fontmap</tt></b> will take precedence over
  876. the fonts in the FONTPATH directories.
  877. <p>
  878. <b>**</b> On Solaris systems simply setting <b><tt>GS_FONTPATH</tt></b> or
  879. using <b><tt>-sFONTPATH=</tt></b> may not work, because for some reason some
  880. versions of Ghostscript can't seem to find any of the Type1 fonts in
  881. <b><tt>/usr/openwin/lib/X11/fonts/Type1/outline</tt></b>. (It says: "15
  882. files, 15 scanned, 0 new fonts". We think this problem has been fixed in
  883. Ghostscript version 6.0, but we aren't sure because we've never been able to
  884. reproduce it.) See <b><tt>Fontmap.Sol</tt></b> instead. Also, on Solaris
  885. 2.x it's probably not worth your while to add Sun's fonts to your font path
  886. and Fontmap. The fonts Sun distributes on Solaris 2.x in the directories
  887. <blockquote><b><tt>
  888. /usr/openwin/lib/X11/fonts/Type1<br>
  889. /usr/openwin/lib/X11/fonts/Type1/outline
  890. </tt></b></blockquote>
  891. <p>
  892. are already represented among the ones distributed as part of Ghostscript;
  893. and on some test files, Sun's fonts have been shown to cause incorrect
  894. displays with Ghostscript.
  895. </blockquote>
  896. <p>
  897. These paths may not be exactly right for your installation; if the indicated
  898. directory doesn't contain files whose names are familiar font names like
  899. Courier and Helvetica, you may wish to ask your system administrator where
  900. to find these fonts.
  901. <p>
  902. Adobe Acrobat comes with a set of fourteen Type 1 fonts, on Unix typically
  903. in a directory called ...<b><tt>/Acrobat3/Fonts</tt></b>. There is no
  904. particular reason to use these instead of the corresponding fonts in the
  905. Ghostscript distribution (which are of just as good quality), except to save
  906. about a megabyte of disk space, but the installation documentation explains
  907. how to do it <a href="Install.htm#Use_Acrobat_fonts_Unix">on Unix</a>.
  908. <h3><a name="CIDFonts"></a>CID fonts</h3>
  909. <p>
  910. CID fonts are PostScript resources containing a
  911. large number of glyphs (e.g. glyphs for Far East languages,
  912. Chinese, Japanese and Korean).
  913. Please refer to the PostScript Language Reference,
  914. third edition, for details.
  915. <p>
  916. CID font resources are a different kind of PostScript resource from fonts.
  917. In particular, they cannot be used as regular fonts.
  918. CID font resources must first be combined with a CMap resource, which
  919. defines specific codes for glyphs, before it can be used as a font. This
  920. allows the reuse of a collection of glyphs with different encodings.
  921. <p>
  922. The simplest method to request a font composed of a CID font resource
  923. and a CMap resource in a PostScript document is
  924. <blockquote><b><tt>
  925. /CIDFont-CMap findfont
  926. </tt></b></blockquote>
  927. where <b><tt>CIDFont</tt></b> is a name of any
  928. CID font resource, and <b><tt>CMap</tt></b> is a name of a CMap resource
  929. designed for the same character collection. The interpreter will compose
  930. the font automatically from the specified CID font and CMap resources.
  931. Another method is possible using the <b><tt>composefont</tt></b> operator.
  932. <p>
  933. CID fonts must be placed in the <b><tt>/Resource/CIDFont/</tt></b> directory.
  934. They are not found using <a href="#Font_lookup">Font lookup</a>
  935. on the search path or font path.
  936. <h3><a name="CIDFontSubstitution"></a>CID font substitution</h3>
  937. <p>
  938. <p>
  939. Substitution of CID font resources is controlled by the Ghostscript
  940. configuration file <b><tt>lib/cidfmap</tt></b>,
  941. which defines a CID font resource map.
  942. The file forms a table of records, each of which should use one of two formats,
  943. explained below. Users may modify <b><tt>lib/cidfmap</tt></b> to configure
  944. Ghostscript for a specific need.
  945. <p> To substitute a CID font resource with another CID font resource, add a record like this :
  946. <blockquote><b><tt>
  947. /Substituted /Original ;
  948. </tt></b></blockquote>
  949. where <b><tt>Substituted</tt></b> is a name of CID font resource being used
  950. by a document, and <b><tt>Original</tt></b> is a name of an available
  951. CID font resource. Please pay attention that both them must be
  952. designed for same character collection. In other words, you
  953. cannot substitute a Japanese CID font resource with a Korean CID font resource,
  954. etc. CMap resource names must not appear in
  955. <b><tt>lib/cidfmap</tt></b>. The trailing semicolon and the space before it
  956. are both required.
  957. <p>
  958. To substitute (emulate) a CID font resource with a TrueType font file, add a record like this :
  959. <blockquote><b><tt>
  960. /Substituted &lt;&lt; keys&amp;values &gt;&gt; ;
  961. </tt></b></blockquote>
  962. Where <b><tt>keys&amp;values</tt></b> are explained in the table below.
  963. <table cellpadding=0 cellspacing=10>
  964. <tr valign="top"> <th>Key
  965. <th>Type
  966. <th>Description
  967. <tr valign="top"> <td><b><tt>/Path</tt></b>
  968. <td>string
  969. <td>A path to a TrueType font file. This must be an absolute path.
  970. If using <b><tt><a href="#Safer">-dSAFER</a></tt></b>, the directory
  971. containing the font file must be on one of the permitted paths.
  972. <tr valign="top"> <td><b><tt>/FileType</tt></b>
  973. <td>name
  974. <td>Must be <b><tt>/TrueType</tt></b>.
  975. <tr valign="top"> <td><b><tt>/SubfontID</tt></b>
  976. <td>integer
  977. <td>(optional) Index of the font in font collection, such as TTC.
  978. This is ignored if <b><tt>Path</tt></b> doesn't specify a collection.
  979. The first font in a collection is 0.
  980. Default value is 0.
  981. <tr valign="top"> <td><b><tt>/CSI</tt></b>
  982. <td>array of 2 elements
  983. <td>(required) Information for building <b><tt>CIDSystemInfo</tt></b>.
  984. The first element is a string, which specifies <b><tt>Ordering</tt></b>.
  985. The second element is a number, which specifies <b><tt>Supplement</tt></b>.
  986. </table>
  987. <p>
  988. Currently only CIDFontType 2 can be emulated with a TrueType font.
  989. The TrueType font must contain enough characters to cover an
  990. Adobe character collection, which is specified in <b><tt>Ordering</tt></b> and used in documents.
  991. <p>
  992. Examples :
  993. <blockquote><b><tt>
  994. /Ryumin-Medium /ShinGo-Bold ;<br>
  995. /MS-Mincho &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/msmincho.ttc) /SubfontID 0 /CSI [(Japan1) 3] &gt;&gt; ;<br>
  996. /Ryumin-Light /MS-Mincho ;<br>
  997. <br>
  998. /Batang &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/batang.ttc) /SubfontID 0 /CSI [(Korea1) 3] &gt;&gt; ;<br>
  999. /Gulim &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 0 /CSI [(Korea1) 3] &gt;&gt; ;<br>
  1000. /Dotum &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 2 /CSI [(Korea1) 3] &gt;&gt; ;<br>
  1001. /HYSMyeongJo-Medium /Batang ;<br>
  1002. /HYRGoThic-Medium /Gulim ;<br>
  1003. /HYGoThic-Medium /Dotum ;<br>
  1004. <br>
  1005. /SimSun &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/simsun.ttc) /SubfontID 0 /CSI [(GB1) 2] &gt;&gt; ;<br>
  1006. /SimHei &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/simhei.ttf) /SubfontID 0 /CSI [(GB1) 2] &gt;&gt; ;<br>
  1007. /STSong-Light /SimSun ;<br>
  1008. /STHeiti-Regular /SimHei ;<br>
  1009. </tt></b></blockquote>
  1010. <p>
  1011. Note that the font file path uses Postscript syntax for strings.
  1012. Due to that backslashes must be represented as a double backslash each.
  1013. <p>
  1014. Note that loading truetype fonts directly from
  1015. <b>><tt>/Resources/CIDFont</tt></b> is no longer supported.
  1016. There is no reliable way to generate a character ordering for truetype
  1017. fonts. The 7.0x versions of Ghostscript supported this by assuming a Japanese
  1018. character ordering. This is replaced in the 8.0x and later releases with the more
  1019. general <b><tt>cidfmap</tt></b> mechanism.
  1020. <p>
  1021. The PDF specification requires CID font files to be embedded,
  1022. however some documents omit them. As a workaround
  1023. the PDF interpreter applies an additional substitution method when
  1024. a requested CID font resource is not embedded and it is not available.
  1025. It takes values of the keys <b><tt>Registry</tt></b> and <b><tt>Ordering</tt></b>
  1026. from the <b><tt>CIDFontSystem</tt></b> dictionary,
  1027. and concatenates them with a dash inserted.
  1028. For example, if a PDF CID font resource specifies
  1029. <blockquote><b><tt>
  1030. /CIDSystemInfo &lt;&lt; /Registry (Adobe) /Ordering (CNS1) /Supplement 1 &gt;&gt;
  1031. </tt></b></blockquote>
  1032. the generated subsitituite name is <b><tt>Adobe-CNS1</tt></b>.
  1033. The latter may look some confusing for a font name,
  1034. but we keep it for compatibility with older Ghostscript versions,
  1035. which do so due to a historical reason.
  1036. Add a proper record to <b><tt>lib/cidfmap</tt></b> to provide it.
  1037. <p>
  1038. Please note that when a PDF font resource specifies
  1039. <blockquote><b><tt>
  1040. /Registry (Adobe) /Ordering (Identity)
  1041. </tt></b></blockquote>
  1042. there is no way to determine the language properly.
  1043. If the CID font file is not embedded, the <b><tt>Adobe-Identity</tt></b>
  1044. record depends on the document and a correct record isn't possible when
  1045. a document refers to multiple Far East languages.
  1046. In the latter case add individual records for specific CID font names used in the document.
  1047. <p>
  1048. Consequently, if you want to handle any PDF document with
  1049. non-embedded CID fonts (which isn't a correct PDF),
  1050. you need to create a suitable <b><tt>lib/cidfmap</tt></b> by hand,
  1051. possibly a specific one for each document.
  1052. <h3><a name="Temp_files"></a>Temporary files</h3>
  1053. <blockquote><table cellpadding=0 cellspacing=0>
  1054. <tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Where Ghostscript puts temporary files</font><hr>
  1055. <tr valign=bottom>
  1056. <th align=left>Platform
  1057. <td>&nbsp;&nbsp;&nbsp;
  1058. <th align=left>Filename
  1059. <td>&nbsp;&nbsp;&nbsp;
  1060. <th align=left>Location
  1061. <tr> <td colspan=5><hr>
  1062. <tr valign=top> <td>MS Windows and OpenVMS
  1063. <td>&nbsp;
  1064. <td><b><tt>_temp_</tt></b>XX.XXX
  1065. <td>&nbsp;
  1066. <td>Current directory
  1067. <tr valign=top> <td>OS/2
  1068. <td>&nbsp;
  1069. <td><b><tt>gs</tt></b>XXXXXX
  1070. <td>&nbsp;
  1071. <td>Current directory
  1072. <tr valign=top> <td>Unix
  1073. <td>&nbsp;
  1074. <td><b><tt>gs_</tt></b>XXXXX
  1075. <td>&nbsp;
  1076. <td><b><tt>/tmp</tt></b>
  1077. </table></blockquote>
  1078. <p>
  1079. You can change in which directory Ghostscript creates temporary files by
  1080. setting the <b><tt>TMPDIR</tt></b> or <b><tt>TEMP</tt></b> environment
  1081. variable to the name of the directory you want used. Ghostscript currently
  1082. doesn't do a very good job of deleting temporary files if it exits because
  1083. of an error; you may have to delete them manually from time to time.
  1084. <hr>
  1085. <h2><a name="Platforms"></a>Notes on specific platforms</h2>
  1086. <h3><a name="Unix"></a>Unix</h3>
  1087. <p>
  1088. The Ghostscript distribution includes some Unix shell scripts to use with
  1089. Ghostscript in different environments. These are all user-contributed
  1090. code, so if you have questions, please contact the user identified in the
  1091. file, not Aladdin Enterprises or artofcode LLC.
  1092. <dl>
  1093. <dt><b><tt>pv.sh</tt></b>
  1094. <dd>Preview a specified page of a <b><tt>dvi</tt></b> file in an X window
  1095. </dl>
  1096. <dl>
  1097. <dt><b><tt>sysvlp.sh</tt></b>
  1098. <dd>System V 3.2 lp interface for parallel printer
  1099. </dl>
  1100. <dl>
  1101. <dt><b><tt>pj-gs.sh</tt></b>
  1102. <dd>Printing on an H-P PaintJet under HP-UX
  1103. </dl>
  1104. <dl>
  1105. <dt><b><tt>unix-lpr.sh</tt></b>
  1106. <dd>Queue filter for <b><tt>lpr</tt></b> under Unix;
  1107. <a href="Unix-lpr.htm">its documentation</a> is intended for system
  1108. administrators
  1109. </dl>
  1110. <dl>
  1111. <dt><b><tt>lprsetup.sh</tt></b>
  1112. <dd>Setup for <b><tt>unix-lpr.sh</tt></b>
  1113. </dl>
  1114. <hr>
  1115. <h3><a name="VMS"></a>VMS</h3>
  1116. <ul>
  1117. <li>To be able to specify switches and file names when invoking the
  1118. interpreter, define <b><tt>gs</tt></b> as a foreign command:
  1119. <blockquote>
  1120. <b><tt>$ gs == "$</tt></b><em>disk</em><b><tt>:[</tt></b><em>directory</em><b><tt>]gs.exe</tt></b>"
  1121. </blockquote>
  1122. <p>
  1123. where the "<em>disk</em>" and "<em>directory</em>" specify where
  1124. the Ghostscript executable is located. For instance,
  1125. <blockquote><b><tt>
  1126. $ gs == "$dua1:[ghostscript]gs.exe"
  1127. </tt></b></blockquote>
  1128. <li>On VMS systems, the last character of each "directory" name indicates
  1129. what sort of entity the "directory" refers to. If the "directory" name
  1130. ends with a colon "<b><tt>:</tt></b>", it is taken to refer to a logical
  1131. device, for instance
  1132. <blockquote><b><tt>
  1133. $ define ghostscript_device dua1:[ghostscript_510]<br>
  1134. $ define gs_lib ghostscript_device:
  1135. </tt></b></blockquote>
  1136. <p>
  1137. If the "directory" name ends with a closing square bracket
  1138. "<b><tt>]</tt></b>", it is taken to refer to a real directory, for instance
  1139. <blockquote><b><tt>
  1140. $ define gs_lib dua1:[ghostscript]
  1141. </tt></b></blockquote>
  1142. <li>Defining the logical <b><tt>GS_LIB</tt></b>
  1143. <blockquote>
  1144. <b><tt>$ define gs_lib</tt></b> <em>disk</em><b><tt>:[</tt></b><em>directory</em><b><tt>]</tt></b>
  1145. </blockquote>
  1146. <p>
  1147. allows Ghostscript to find its initialization files in the Ghostscript
  1148. directory even if that's not where the executable resides.<br>&nbsp;
  1149. <li>Although VMS DCL itself converts unquoted parameters to upper case, C
  1150. programs such as Ghostscript receive their parameters through the C runtime
  1151. library, which forces all unquoted command-line parameters to lower case.
  1152. That is, with the command
  1153. <blockquote><b><tt>
  1154. $ gs -Isys$login:
  1155. </tt></b></blockquote>
  1156. <p>
  1157. Ghostscript sees the switch as <b><tt>-isys$login</tt></b>,
  1158. which doesn't work. To preserve the case of switches, quote them like
  1159. this:
  1160. <blockquote><b><tt>
  1161. $ gs "-Isys$login:"
  1162. </tt></b></blockquote>
  1163. <li>If you write printer output to a file with
  1164. <b><tt>-sOutputFile=</tt></b> and then want to print the file later, use
  1165. "<b><tt>PRINT/PASSALL</tt></b>".
  1166. </ul>
  1167. <ul>
  1168. <li>PDF files (or PostScript files that use the
  1169. <b><tt>setfileposition</tt></b> operator) must be "stream LF" type files to
  1170. work properly on VMS systems. (<b><em>Note:</em></b> This definitely matters
  1171. if Ghostscript was compiled with DEC C; we are not sure of the situation if
  1172. you use <b><tt>gcc</tt></b>.) Because of this, if you transfer files by
  1173. FTP, you probably need to do one of these two things after the transfer:
  1174. <ol>
  1175. <li>If the FTP transfer was in text (ASCII) mode:
  1176. <blockquote>
  1177. <b><tt>$ convert/fdl=streamlf.fdl</tt></b> input-file output-file
  1178. </blockquote>
  1179. <p>
  1180. where the contents of the file <b><tt>STREAMLF.FDL</tt></b> are
  1181. <blockquote>
  1182. <pre>FILE
  1183. ORGANIZATION sequential
  1184. RECORD
  1185. BLOCK_SPAN yes
  1186. CARRIAGE_CONTROL carriage_return
  1187. FORMAT stream_lf
  1188. </pre></blockquote>
  1189. <li>If the FTP transfer was in binary mode:
  1190. <blockquote><b><tt>
  1191. $ set file/attribute=(rfm:stmlf)
  1192. </tt></b></blockquote>
  1193. </ol>
  1194. </ul>
  1195. <h4><a name="VMS_X_Windows"></a>Using X Windows on VMS</h4>
  1196. <p>
  1197. If you are using on an X Windows display, you can set it up with the node
  1198. name and network transport, for instance
  1199. <blockquote><b><tt>
  1200. $ set display/create/node="doof.city.com"/transport=tcpip
  1201. </tt></b></blockquote>
  1202. <p>
  1203. and then run Ghostscript by typing <b><tt>gs</tt></b> at the command line.
  1204. <hr>
  1205. <h3><a name="MS_Windows"></a>MS Windows</h3>
  1206. <p>
  1207. The name of the Ghostscript command line executable on MS Windows is
  1208. <tt>gswin32c</tt> so use this instead of the plain '<tt>gs</tt>' in
  1209. the quickstart examples.
  1210. <p>
  1211. You must add <em>gs\</em><tt>bin</tt> and
  1212. <em>gs\</em><tt>lib</tt> to the <b><tt>PATH</tt></b>, where
  1213. <em>gs</em> is the top-level Ghostscript directory.
  1214. <p>
  1215. When passing options to ghostcript through a batch file wrapper such as
  1216. <tt>ps2pdf.bat</tt> you need to substitute '#' for '=' as the separator
  1217. between options and their arguments. For example:
  1218. <blockquote><pre>
  1219. ps2pdf -sPAPERSIZE#a4 file.ps file.pdf
  1220. </pre></blockquote>
  1221. Ghostscript treats '#' the same internally, and the '=' is mangled by
  1222. the command shell.
  1223. <p>
  1224. There is also an older version for windows called just <tt>gswin32</tt>
  1225. that provides its own window for the interactive postscript prompt. Except
  1226. on Windows 3.1, gswin32c is the better option since it uses the
  1227. native command prompt window.
  1228. <hr>
  1229. <h3><a name="MS-DOS"></a>MS-DOS</h3>
  1230. <p>
  1231. <strong>Note:</strong> Ghostscript is no longer supported on MS-DOS.
  1232. <p>
  1233. Invoking Ghostscript from the command prompt in Windows is supported by
  1234. the Windows executable described above.
  1235. <hr>
  1236. <h3><a name="X_Windows"></a>X Windows</h3>
  1237. <p>
  1238. Ghostscript looks for the following resources under the program name
  1239. <b><tt>ghostscript</tt></b> and class name
  1240. <b><tt>Ghostscript</tt></b>; the ones marked "**" are
  1241. calculated from display metrics:
  1242. <blockquote><table cellpadding=0 cellspacing=0>
  1243. <tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">X Windows resources</font><hr>
  1244. <tr> <th align=left>Name
  1245. <td>&nbsp;&nbsp;
  1246. <th align=left>Class
  1247. <td>&nbsp;&nbsp;
  1248. <th align=left>Default
  1249. <tr> <td colspan=5><hr>
  1250. <tr> <td><b><tt>background</tt></b>
  1251. <td>&nbsp;
  1252. <td><b><tt>Background</tt></b>
  1253. <td>&nbsp;
  1254. <td><b><tt>white</tt></b>
  1255. <tr> <td><b><tt>foreground</tt></b>
  1256. <td>&nbsp;
  1257. <td><b><tt>Foreground</tt></b>
  1258. <td>&nbsp;
  1259. <td><b><tt>black</tt></b>
  1260. <tr> <td><b><tt>borderColor</tt></b>
  1261. <td>&nbsp;
  1262. <td><b><tt>BorderColor</tt></b>
  1263. <td>&nbsp;
  1264. <td><b><tt>black</tt></b>
  1265. <tr> <td><b><tt>borderWidth</tt></b>
  1266. <td>&nbsp;
  1267. <td><b><tt>BorderWidth</tt></b>
  1268. <td>&nbsp;
  1269. <td><b><tt>1</tt></b>
  1270. <tr> <td><b><tt>geometry</tt></b>
  1271. <td>&nbsp;
  1272. <td><b><tt>Geometry</tt></b>
  1273. <td>&nbsp;
  1274. <td><b><tt>NULL</tt></b>
  1275. <tr> <td><b><tt>xResolution</tt></b>
  1276. <td>&nbsp;
  1277. <td><b><tt>Resolution</tt></b>
  1278. <td>&nbsp;
  1279. <td>**
  1280. <tr> <td><b><tt>yResolution</tt></b>
  1281. <td>&nbsp;
  1282. <td><b><tt>Resolution</tt></b>
  1283. <td>&nbsp;
  1284. <td>**
  1285. <tr> <td><b><tt>useExternalFonts</tt></b>
  1286. <td>&nbsp;
  1287. <td><b><tt>UseExternalFonts</tt></b>
  1288. <td>&nbsp;
  1289. <td><b><tt>true</tt></b>
  1290. <tr> <td><b><tt>useScalableFonts</tt></b>
  1291. <td>&nbsp;
  1292. <td><b><tt>UseScalableFonts</tt></b>
  1293. <td>&nbsp;
  1294. <td><b><tt>true</tt></b>
  1295. <tr> <td><b><tt>logExternalFonts</tt></b>
  1296. <td>&nbsp;
  1297. <td><b><tt>LogExternalFonts</tt></b>
  1298. <td>&nbsp;
  1299. <td><b><tt>false</tt></b>
  1300. <tr> <td><b><tt>externalFontTolerance</tt></b>
  1301. <td>&nbsp;
  1302. <td><b><tt>ExternalFontTolerance</tt></b>
  1303. <td>&nbsp;
  1304. <td><b><tt>10.0</tt></b>
  1305. <tr> <td><b><tt>palette</tt></b>
  1306. <td>&nbsp;
  1307. <td><b><tt>Palette</tt></b>
  1308. <td>&nbsp;
  1309. <td><b><tt>Color</tt></b>
  1310. <tr> <td><b><tt>maxGrayRamp</tt></b>
  1311. <td>&nbsp;
  1312. <td><b><tt>MaxGrayRamp</tt></b>
  1313. <td>&nbsp;
  1314. <td><b><tt>128</tt></b>
  1315. <tr> <td><b><tt>maxRGBRamp</tt></b>
  1316. <td>&nbsp;
  1317. <td><b><tt>MaxRGBRamp</tt></b>
  1318. <td>&nbsp;
  1319. <td><b><tt>5</tt></b>
  1320. <tr> <td><b><tt>maxDynamicColors</tt></b>
  1321. <td>&nbsp;
  1322. <td><b><tt>MaxDynamicColors</tt></b>
  1323. <td>&nbsp;
  1324. <td><b><tt>256</tt></b>
  1325. <tr> <td><b><tt>useBackingPixmap</tt></b>
  1326. <td>&nbsp;
  1327. <td><b><tt>UseBackingPixmap</tt></b>
  1328. <td>&nbsp;
  1329. <td><b><tt>true</tt></b>
  1330. <tr> <td><b><tt>useXPutImage</tt></b>
  1331. <td>&nbsp;
  1332. <td><b><tt>UseXPutImage</tt></b>
  1333. <td>&nbsp;
  1334. <td><b><tt>true</tt></b>
  1335. <tr> <td><b><tt>useXSetTile</tt></b>
  1336. <td>&nbsp;
  1337. <td><b><tt>UseXSetTile</tt></b>
  1338. <td>&nbsp;
  1339. <td><b><tt>true</tt></b>
  1340. <tr> <td><b><tt>regularFonts</tt></b>
  1341. <td>&nbsp;
  1342. <td><b><tt>RegularFonts</tt></b>
  1343. <td>&nbsp;
  1344. <td>See "<a href="#X_fonts">X fonts</a>"
  1345. <tr> <td><b><tt>symbolFonts</tt></b>
  1346. <td>&nbsp;
  1347. <td><b><tt>SymbolFonts</tt></b>
  1348. <td>&nbsp;
  1349. <td>See "<a href="#X_fonts">X fonts</a>"
  1350. <tr> <td><b><tt>dingbatFonts</tt></b>
  1351. <td>&nbsp;
  1352. <td><b><tt>DingbatFonts</tt></b>
  1353. <td>&nbsp;
  1354. <td>See "<a href="#X_fonts">X fonts</a>"
  1355. </table></blockquote>
  1356. <h4><a name="X_resources"></a>X resources</h4>
  1357. <ul>
  1358. <li>
  1359. To set X resources, put them in a file (such as
  1360. <b><tt>~/.Xdefaults</tt></b> on Unix) in a form like this:
  1361. <blockquote><table cellpadding=0 cellspacing=0>
  1362. <tr><td><b><tt>Ghostscript*geometry:</tt></b><td><b><tt>&nbsp;&nbsp;</tt></b><td><b><tt>595x842-0+0</tt></b>
  1363. <tr><td><b><tt>Ghostscript*xResolution:</tt></b><td><b><tt>&nbsp;</tt></b><td><b><tt>72</tt></b>
  1364. <tr><td><b><tt>Ghostscript*yResolution:</tt></b><td><b><tt>&nbsp;</tt></b><td><b><tt>72</tt></b>
  1365. </table></blockquote>
  1366. <p>
  1367. Then merge these resources into the X server's resource database:
  1368. <blockquote><b><tt>
  1369. xrdb -merge ~/.Xdefaults
  1370. </tt></b></blockquote>
  1371. <li>
  1372. Ghostscript doesn't look at the default system background and foreground
  1373. colors; if you want to change the background or foreground color, you must
  1374. set them explicitly for Ghostscript. This is a deliberate choice, so that
  1375. PostScript documents will display correctly by default -- with white as
  1376. white and black as black -- even if text windows use other colors.
  1377. <li>
  1378. The <b><tt>geometry</tt></b> resource affects only window placement.
  1379. <li>
  1380. Resolution is expressed in pixels per inch (1 inch = 25.4mm).
  1381. <li>
  1382. The font tolerance gives the largest acceptable difference in height of the
  1383. screen font, expressed as a percentage of the height of the desired font.
  1384. <li>
  1385. The <b><tt>palette</tt></b> resource can be used to restrict Ghostscript to
  1386. using a grayscale or monochrome palette.
  1387. <li>
  1388. <b><tt>maxRGBRamp</tt></b> and
  1389. <b><tt>maxGrayRamp</tt></b> control the maximum number of
  1390. colors that ghostscript allocates ahead of time for the dither cube (ramp).
  1391. Ghostscript never preallocates more than half the cells in a colormap.
  1392. <b><tt>maxDynamicColors</tt></b> controls the maximum
  1393. number of colors that Ghostscript will allocate dynamically in the
  1394. colormap.
  1395. </ul>
  1396. <h4><a name="X_server_bugs"></a>Working around bugs in X servers</h4>
  1397. <p>
  1398. The "<b><tt>use</tt></b>..." resources exist primarily to work around bugs
  1399. in X servers.
  1400. <ul>
  1401. <li> Old versions of DEC's X server (DECwindows) have bugs that
  1402. require setting <b><tt>useXPutImage</tt></b> or
  1403. <b><tt>useXSetTile</tt></b> to
  1404. <b><tt>false</tt></b>.
  1405. <li> Some servers do not implement backing pixmaps properly, or do not
  1406. have enough memory for them. If you get strange behavior or "out
  1407. of memory" messages, try setting
  1408. <b><tt>useBackingPixmap</tt></b> to
  1409. <b><tt>false</tt></b>.
  1410. <li> Some servers do not implement tiling properly. This appears
  1411. as broad bands of color where dither patterns should appear. If
  1412. this happens, try setting
  1413. <b><tt>useXSetTile</tt></b> to
  1414. <b><tt>false</tt></b>.
  1415. <li> Some servers do not implement bitmap or pixmap displaying properly.
  1416. This may appear as white or black rectangles where characters
  1417. should appear; or characters may appear in "inverse video" (for
  1418. instance, white on a black rectangle rather than black on white).
  1419. If this happens, try setting
  1420. <b><tt>useXPutImage</tt></b> to
  1421. <b><tt>false</tt></b>.
  1422. </ul>
  1423. <h4><a name="X_fonts"></a>X fonts</h4>
  1424. <p>
  1425. To use native X11 fonts, Ghostscript must map PostScript font names to the
  1426. XLFD font names. The resources <b><tt>regularFonts</tt></b>
  1427. (fonts available in standard or ISO-Latin-1 encoding),
  1428. <b><tt>symbolFonts</tt></b> (using Symbol encoding), and
  1429. <b><tt>dingbatFonts</tt></b> (using Dingbat encoding) give
  1430. the name mapping for different encodings. The XLFD font name in the
  1431. mapping must contain 7 dashes; the X driver adds the additional size and
  1432. encoding fields to bring the total number of dashes in the font name to 14.
  1433. See the appendix "<a href="#X_font_mappings">X default font mappings</a>"
  1434. for the full list of default mappings.
  1435. <p>
  1436. Users who switch regularly between different X servers may wish to use the
  1437. "*" wild card in place of the foundry name
  1438. (<b><tt>itc</tt></b>,
  1439. <b><tt>monotype</tt></b>,
  1440. <b><tt>linotype</tt></b>,
  1441. <b><tt>b&amp;h</tt></b>, or
  1442. <b><tt>adobe</tt></b>); users who do not switch X servers
  1443. should leave the explicit foundry in the name, since it speeds up access to
  1444. fonts.
  1445. <p>
  1446. Ghostscript takes advantage of the "HP XLFD Enhancements," if available, to
  1447. use native X11 fonts for fonts that are anamorphically scaled, rotated, or
  1448. mirrored. If the changes have been installed to the X or font server, they
  1449. are automatically used when appropriate.
  1450. <h4><a name="GS_fonts_as_X_fonts"></a>Using Ghostscript fonts on X displays</h4>
  1451. <p>
  1452. Font files distributed with Ghostscript can be used on X Windows displays.
  1453. You can find full instructions in the
  1454. <a href="Fonts.htm#Use_gs_fonts_with_X">documentation on fonts</a>.
  1455. <h4><a name="X_device_parameters"></a>X device parameters</h4>
  1456. <p>
  1457. In addition to the device parameters recognized by <a
  1458. href="Language.htm#Device_parameters">all devices</a>, Ghostscript's X
  1459. driver provides parameters to adjust its performance. Users will rarely
  1460. need to modify these. Note that these are parameters to be set with the
  1461. <b><tt>-d</tt></b> switch in the command line (e.g.,
  1462. <b><tt>-dMaxBitmap=10000000</tt></b>), not resources to be defined in the
  1463. <b><tt>~/.Xdefaults</tt></b> file.
  1464. <dl>
  1465. <dt><b><tt>AlwaysUpdate &lt;boolean&gt;</tt></b>
  1466. <dd>If <b><tt>true</tt></b>, the driver updates the screen after each
  1467. primitive drawing operation; if <b><tt>false</tt></b> (the default), the
  1468. driver uses an intelligent buffered updating algorithm.
  1469. </dl>
  1470. <dl>
  1471. <dt><b><tt>MaxBitmap &lt;integer&gt;</tt></b>
  1472. <dd>If the amount of memory required to hold the pixmap for the window is no
  1473. more than the value of <b><tt>MaxBitmap</tt></b>, the driver will draw to a
  1474. pixmap in Ghostscript's address space (called a "client-side pixmap") and
  1475. will copy it to the screen from time to time; if the amount of memory
  1476. required for the pixmap exceeds the value of <b><tt>MaxBitmap</tt></b>, the
  1477. driver will draw to a server pixmap. Using a client-side pixmap usually
  1478. provides better performance -- for bitmap images, possibly much better
  1479. performance -- but since it may require quite a lot of RAM (e.g., about 2.2
  1480. Mb for a 24-bit 1024x768 window), the default value of
  1481. <b><tt>MaxBitmap</tt></b> is 0.
  1482. </dl>
  1483. <dl>
  1484. <dt><b><tt>MaxTempPixmap, MaxTempImage, MaxBufferedTotal, MaxBufferedArea,
  1485. MaxBufferedCount &lt;integer&gt;</tt></b>
  1486. <dd>These control various aspects of the driver's buffering behavior. For
  1487. details, please consult the source file <b><tt>gdevx.h</tt></b>.
  1488. </dl>
  1489. <hr>
  1490. <h3><a name="SCO_Unix"></a>SCO Unix</h3>
  1491. <p>
  1492. Because of bugs in the SCO Unix kernel, Ghostscript will not work if you
  1493. select direct screen output and also allow it to write messages on the
  1494. console. If you are using direct screen output, redirect Ghostscript's
  1495. terminal output to a file.
  1496. <hr>
  1497. <h2><a name="Options"></a>Command line options</h2>
  1498. <p>
  1499. Unless otherwise noted, these switches can be used on all platforms.
  1500. <h3><a name="General_switches"></a>General switches</h3>
  1501. <h4><a name="Input_control"></a>Input control</h4>
  1502. <dl>
  1503. <dt><b><tt>@</tt></b><em>filename</em>
  1504. <dd>Causes Ghostscript to read <em>filename</em> and treat its contents the
  1505. same as the command line. (This was intended primarily for getting around
  1506. DOS's 128-character limit on the length of a command line.) Switches or
  1507. file names in the file may be separated by any amount of white space
  1508. (space, tab, line break); there is no limit on the size of the file.
  1509. </dl>
  1510. <dl>
  1511. <dt><b><tt>--</tt></b> <em>filename arg1 ...</em>
  1512. <br><b><tt>-+</tt></b> <em>filename arg1 ...</em>
  1513. <dd>Takes the next argument as a file name as usual, but takes all
  1514. remaining arguments (even if they have the syntactic form of switches) and
  1515. defines the name <b><tt>ARGUMENTS</tt></b> in userdict (not systemdict) as
  1516. an array of those strings, <em>before</em> running the file. When
  1517. Ghostscript finishes executing the file, it exits back to the shell.
  1518. </dl>
  1519. <dl>
  1520. <dt><b><tt>-@</tt></b> <em>filename arg1 ...</em>
  1521. <dd>Does the same thing as <b><tt>--</tt></b> and <b><tt>-+</tt></b>, but
  1522. expands <b><tt>@</tt></b><em>filename</em> arguments.
  1523. </dl>
  1524. <dl>
  1525. <dt><b><tt>-</tt></b>
  1526. <br><b><tt>-_</tt></b>
  1527. <dd>These are not really switches: they tell Ghostscript to read from
  1528. standard input, which is coming from a file or a pipe,
  1529. with or without buffering.
  1530. On some systems, Ghostscript may read the input one character at a time,
  1531. which is useful for programs such as ghostview that generate input for
  1532. Ghostscript dynamically and watch for some response, but can slow processing.
  1533. If performance is significantly slower than with a named file,
  1534. try '<tt>-_</tt>' which always reads the input in blocks.
  1535. However, '<tt>-</tt>' is equivalent on most systems.
  1536. </dl>
  1537. <dl>
  1538. <dt><b><tt>-c</tt></b> <em>tokens ...</em>
  1539. <dd>Interprets arguments as PostScript code up to the next argument that
  1540. begins with "<b><tt>-</tt></b>" followed by a non-digit, or with
  1541. "<b><tt>@</tt></b>". For example, if the file <b><tt>quit.ps</tt></b>
  1542. contains just the word "<b><tt>quit</tt></b>", then
  1543. <b><tt>-c&nbsp;quit</tt></b> on the command line is equivalent to
  1544. <b><tt>quit.ps</tt></b> there. Each argument must be exactly one token, as
  1545. defined by the <b><tt>token</tt></b> operator.
  1546. </dl>
  1547. <dl>
  1548. <dt><b><tt>-f</tt></b>
  1549. <dd>Interprets following non-switch arguments as file names to be executed
  1550. using the normal <b><tt>run</tt></b> command. Since this is the default
  1551. behavior, <b><tt>-f</tt></b> is useful only for terminating the list of
  1552. tokens for the <b><tt>-c</tt></b> switch.
  1553. </dl>
  1554. <dl>
  1555. <dt><b><tt>-f</tt></b><em>filename</em>
  1556. <dd>Execute the given file, even if its name begins with a
  1557. "<b><tt>-</tt></b>" or "<b><tt>@</tt></b>".
  1558. </dl>
  1559. <h4><a name="File_searching"></a>File searching</h4>
  1560. <p>
  1561. Note that by "library files" here we mean all the files identified using
  1562. the search rule under "<a href="#Finding_files">How Ghostscript finds
  1563. files</a>" above: Ghostscript's own initialization files, fonts, and files
  1564. named on the command line.
  1565. <dl>
  1566. <dt><a name="I_switch"></a><b><tt>-I</tt></b><em>directories</em>
  1567. <dd>Adds the designated list of directories at the head of the search path
  1568. for library files.
  1569. </dl>
  1570. <dl>
  1571. <dt><a name="P_switch"></a><b><tt>-P</tt></b>
  1572. <dd>Makes Ghostscript look first in the current directory for library
  1573. files. This is currently the default.
  1574. </dl>
  1575. <dl>
  1576. <dt><a name="P-_switch"></a><b><tt>-P-</tt></b>
  1577. <dd>Makes Ghostscript <b><em>not</em></b> look first in the current
  1578. directory for library files (unless, of course, the first explicitly
  1579. supplied directory is "<b><tt>.</tt></b>").
  1580. </dl>
  1581. <h4><a name="Parameters"></a>Setting parameters</h4>
  1582. <dl>
  1583. <dt><b><tt>-D</tt></b><em>name</em>
  1584. <br><b><tt>-d</tt></b><em>name</em>
  1585. <dd>Define a name in systemdict with value=true.
  1586. </dl>
  1587. <dl>
  1588. <dt><b><tt>-D</tt></b><em>name</em><b><tt>=</tt></b><em>token</em>
  1589. <br><b><tt>-d</tt></b><em>name</em><b><tt>=</tt></b><em>token</em>
  1590. <dd>Define a name in systemdict with the given definition. The token must
  1591. be exactly one token (as defined by the <b><tt>token</tt></b> operator) and
  1592. must not contain any whitespace. If the token is a non-literal name, it
  1593. must be true, false, or null.
  1594. </dl>
  1595. <dl>
  1596. <dt><b><tt>-S</tt></b><em>name</em><b><tt>=</tt></b><em>string</em>
  1597. <br><b><tt>-s</tt></b><em>name</em><b><tt>=</tt></b><em>string</em>
  1598. <dd>Define a name in systemdict with a given string as value. This is
  1599. different from <b><tt>-d</tt></b>. For example, <b><tt>-dXYZ=35</tt></b>
  1600. on the command line is equivalent to the program fragment
  1601. <blockquote><b><tt>
  1602. /XYZ 35 def
  1603. </tt></b></blockquote>
  1604. <p>
  1605. whereas <b><tt>-sXYZ=35</tt></b> is equivalent to
  1606. <blockquote><b><tt>
  1607. /XYZ (35) def
  1608. </tt></b></blockquote>
  1609. </dl>
  1610. <dl>
  1611. <dt><b><tt>-u</tt></b><em>name</em>
  1612. <dd>Un-define a name, cancelling <b><tt>-d</tt></b> or <b><tt>-s</tt></b>.
  1613. </dl>
  1614. <p>
  1615. Note that the initialization file <b><tt>gs_init.ps</tt></b> makes
  1616. <b><tt>systemdict</tt></b> read-only, so the values of names defined with
  1617. <b><tt>-D</tt></b>, <b><tt>-d</tt></b>, <b><tt>-S</tt></b>, and
  1618. <b><tt>-s</tt></b> cannot be changed -- although, of course, they can be
  1619. superseded by definitions in <b><tt>userdict</tt></b> or other dictionaries.
  1620. However, device parameters set this way (<b><tt>PageSize</tt></b>,
  1621. <b><tt>Margins</tt></b>, etc.) are <em>not</em> read-only, and <em>can</em>
  1622. be changed by code in PostScript files.
  1623. <dl>
  1624. <dt><b><tt>-g</tt></b><em>number1</em><b><tt>x</tt></b><em>number2</em>
  1625. <dd>Equivalent to <b><tt>-dDEVICEWIDTH=</tt></b><em>number1</em> and
  1626. <b><tt>-dDEVICEHEIGHT=</tt></b><em>number2</em>, specifying the device
  1627. width and height in pixels for the benefit of devices such as X11 windows
  1628. and VESA displays that require (or allow) you to specify width and height.
  1629. Note that this causes documents of other sizes to be clipped, not scaled:
  1630. see <b><tt>-dFIXEDMEDIA</tt></b> below.
  1631. </dl>
  1632. <dl>
  1633. <dt><a name="Resolution_switch"></a><b><tt>-r</tt></b><em>number</em> (same
  1634. as <b><tt>-r</tt></b><em>number</em><b><tt>x</tt></b><em>number</em>)
  1635. <br><b><tt>-r</tt></b><em>number1</em><b><tt>x</tt></b><em>number2</em>
  1636. <dd>Equivalent to <b><tt>-dDEVICEXRESOLUTION=</tt></b><em>number1</em> and
  1637. <b><tt>-dDEVICEYRESOLUTION=</tt></b><em>number2</em>, specifying the device
  1638. horizontal and vertical resolution in pixels per inch for the benefit of
  1639. devices such as printers that support multiple X and Y resolutions.
  1640. </dl>
  1641. <h4><a name="Quiet"></a>Suppress messages</h4>
  1642. <dl>
  1643. <dt><a name="Quiet"></a><b><tt>-q</tt></b>
  1644. <dd>Quiet startup: suppress normal startup messages, and also do the
  1645. equivalent of <a href="#dQUIET"><b><tt>-dQUIET</tt></b></a>.
  1646. </dl>
  1647. <h3><a name="Parameter_switches"></a>Parameter switches (<b><tt>-d</tt></b> and <b><tt>-s</tt></b>)</h3>
  1648. <p>
  1649. As noted above, <b><tt>-d</tt></b> and <b><tt>-s</tt></b> define initial
  1650. values for PostScript names. Some of these names are parameters that
  1651. control the interpreter or the graphics engine. You can also use
  1652. <b><tt>-d</tt></b> or <b><tt>-s</tt></b> to define a value for any device
  1653. parameter of the initial device (the one defined with
  1654. <b><tt>-sDEVICE=</tt></b>, or the default device if this switch is not
  1655. used). For example, since the <b><tt>ppmraw</tt></b> device has a numeric
  1656. <b><tt>GrayValues</tt></b> parameter that controls the number of bits per
  1657. component, <b><tt>-sDEVICE=ppmraw -dGrayValues=16</tt></b> will make this
  1658. the default device and set the number of bits per component to 4 (log2(16)).
  1659. <h4><a name="Rendering_parameters"></a>Rendering parameters</h4>
  1660. <dl>
  1661. <dt><b><tt>-dCOLORSCREEN
  1662. <br>-dCOLORSCREEN=0
  1663. <br>-dCOLORSCREEN=false</tt></b>
  1664. <dd>On high-resolution devices (at least 150 dpi resolution, or
  1665. <b><tt>-dDITHERPPI</tt></b> specified), <b><tt>-dCOLORSCREEN</tt></b>
  1666. forces the use of separate halftone screens with different angles for CMYK
  1667. or RGB if halftones are needed (this produces the best-quality output);
  1668. <b><tt>-dCOLORSCREEN=0</tt></b> uses separate screens with the same
  1669. frequency and angle; <b><tt>-dCOLORSCREEN=false</tt></b> forces the use of
  1670. a single binary screen. The default if <b><tt>COLORSCREEN</tt></b> is not
  1671. specified is to use separate screens with different angles if the device
  1672. has fewer than 5 bits per color, and a single binary screen (which is never
  1673. actually used under normal circumstances) on all other devices.
  1674. </dl>
  1675. <dl>
  1676. <dt><b><tt>-dDITHERPPI=</tt></b><em>lpi</em>
  1677. <dd>Forces all devices to be considered high-resolution, and forces use of
  1678. a halftone screen or screens with <em>lpi</em> lines per inch, disregarding
  1679. the actual device resolution. Reasonable values for <em>lpi</em> are
  1680. <b><em>N</em></b>/5 to <b><em>N</em></b>/20, where <b><em>N</em></b> is the
  1681. resolution in dots per inch.
  1682. </dl>
  1683. <dl>
  1684. <dt><b><tt>-dDOINTERPOLATE</tt></b>
  1685. <dd>Turns on image interpolation for all images, improving image quality for
  1686. scaled images at the expense of speed. Note that
  1687. <b><tt>-dNOINTERPOLATE</tt></b> overrides <b><tt>-dDOINTERPOLATE</tt></b> if
  1688. both are specified.
  1689. </dl>
  1690. <dl>
  1691. <dt><b><tt>-dTextAlphaBits=</tt></b><em>n</em>
  1692. <dt><b><tt>-dGraphicsAlphaBits=</tt></b><em>n</em>
  1693. <dd>These options control the use of subsample antialiasing. Their use is highly recommended for producing high quality rasterizations. The subsampling box size <em>n</em> should be 4 for optimum output, but smaller values can be used for faster rendering. Antialiasing is enabled separately for text and graphics content.
  1694. Allowed values are 1, 2 or 4.
  1695. <p>
  1696. Note that because of the way antialiasing blends the edges of shapes into the background when
  1697. they are drawn some files that rely on joining separate filled polygons together to cover
  1698. an area may not render as expected with <tt>GraphicsAlphaBits</tt> at 2 or 4. If you encounter
  1699. strange lines within solid areas, try rendering that file again with
  1700. <tt>-dGraphicsAlphaBits=1</tt>.
  1701. </dl>
  1702. <dl>
  1703. <dt><b><tt>-dAlignToPixels=</tt></b><em>n</em>
  1704. <dd>Chooses glyph alignent to integral pixel boundaries (if set to the value 1)
  1705. or to subpixels (value 0). Subpixels are a smaller raster grid
  1706. which is used internally for text antialiasing.
  1707. The number of subpixels in a pixel usually is <tt>2^TextAlphaBits</tt>,
  1708. but this may be automatically reduced for big characters to save space
  1709. in character cache.
  1710. <p>
  1711. The parameter has no effect if <b><tt>-dTextAlphaBits=1</tt></b>.
  1712. Default value is 0.
  1713. <p>
  1714. Setting <b><tt>-dAlignToPixels=0</tt></b> can improve rendering
  1715. of poorly hinted fonts, but may impair the appearance of well-hinted fonts.
  1716. </dl>
  1717. <dl>
  1718. <dt><b><tt>-dGridFitTT=</tt></b><em>n</em>
  1719. <dd> This specifies the initial value for the implementation specific
  1720. user parameter <a href="Language.htm#GridFitTT">GridFitTT</a>.
  1721. It controls grid fitting of True Type fonts
  1722. (Sometimes referred to as "hinting", but strictly speaking
  1723. the latter is a feature of Type 1 fonts).
  1724. Setting this to 2 enables automatic grid fitting for True Type glyphs.
  1725. The value 0 disables grid fitting. The default value is 2.
  1726. For more information see the description of the user parameter
  1727. <a href="Language.htm#GridFitTT">GridFitTT</a>.
  1728. </dl>
  1729. <dl>
  1730. <dt><b><tt>-dUseCIEColor</tt></b>
  1731. <dd>Set UseCIEColor in the page device dictionary, remapping device-dependent
  1732. color values through a CIE color space. This can can improve conversion
  1733. of CMYK documents to RGB.
  1734. </dl>
  1735. <dl>
  1736. <dt><b><tt>-dNOCIE</tt></b>
  1737. <dd>Substitutes <b><tt>DeviceGray</tt></b> and <b><tt>DeviceRGB</tt></b>
  1738. for CIEBasedA and CIEBasedABC color spaces respectively. Useful only on
  1739. very slow systems where color accuracy is less important.
  1740. </dl>
  1741. <dl>
  1742. <dt><b><tt>-dNOSUBSTDEVICECOLORS</tt></b>
  1743. <dd>This switch prevents the substitution of the <b><tt>ColorSpace</tt></b>
  1744. resources (<b><tt>DefaultGray</tt></b>, <b><tt>DefaultRGB</tt></b>, and
  1745. <b><tt>DefaultCMYK</tt></b>) for the <b><tt>DeviceGray</tt></b>,
  1746. <b><tt>DeviceRGB</tt></b>, and <b><tt>DeviceCMYK</tt></b> color spaces.
  1747. This switch is primarily useful for PDF creation using the <tt><b>pdfwrite</b></tt>
  1748. device when retaining the color spaces from the original document is
  1749. important.
  1750. </dl>
  1751. <dl>
  1752. <dt><b><tt>-dNOPSICC</tt></b>
  1753. <dd>Disables the automatic loading and use of an input color space that is
  1754. contained in a PostScript file as DSC comments starting with the %%BeginICCProfile:
  1755. comment. ICC profiles are sometimes embedded by applications to convey the exact
  1756. input color space allowing better color fidelity. Since the embedded ICC profiles
  1757. often use multidimensional RenderTables, color conversion may be slower than using
  1758. the Default color conversion invoked when the <b><tt>-dUseCIEColor</tt></b>
  1759. option is specified, therefore the <b><tt>-dNOPSICC</tt></b> option may result
  1760. in improved performance at slightly reduced color fidelity.
  1761. </dl>
  1762. <dl>
  1763. <dt><b><tt>-dNOINTERPOLATE</tt></b>
  1764. <dd>Turns off image interpolation, improving performance on interpolated
  1765. images at the expense of image quality. <b><tt>-dNOINTERPOLATE</tt></b>
  1766. overrides <b><tt>-dDOINTERPOLATE</tt></b>.
  1767. </dl>
  1768. <dl>
  1769. <dt><b><tt>-dNOTRANSPARENCY</tt></b>
  1770. <dd>Turns off PDF 1.4 transparency, resulting in faster (but possibly
  1771. incorrect) rendering of pages containing PDF 1.4 transparency and
  1772. blending.
  1773. </dl>
  1774. <dl>
  1775. <dt><b><tt>-dNO_TN5044</tt></b>
  1776. <dd>Turns off the TN 5044 psuedo operators. These psuedo operators are not a part
  1777. of the official Postscript specification. However they are defined in <i>Technical
  1778. Note #5044 Color Separation Conventions for PostScript Language Programs</i>.
  1779. These psuedo operators are required for some files from QuarkXPress. However some
  1780. files from Corel 9 and Illustrator 88 do not operate properly if these operators
  1781. are present.
  1782. </dl>
  1783. <dl>
  1784. <dt><b><tt>-dDOPS</tt></b>
  1785. <dd>Enables processing of DoPS directives in PDF files. DoPS has in
  1786. fact been deprecated for some time. Use of this option is not
  1787. recommended in security-conscious applications, as it increases the
  1788. scope for malicious code. <b><tt>-dDOPS</tt></b> has no effect on
  1789. processing of PostScript source files. Note: in releases 7.30 and
  1790. earlier, processing of DoPS was always enabled.
  1791. </dl>
  1792. <h4><a name="Page_parameters"></a>Page parameters</h4>
  1793. <dl>
  1794. <dt><a name="FIXEDMEDIA"></a><b><tt>-dFIXEDMEDIA</tt></b>
  1795. <dd>Causes the media size to be fixed after initialization, forcing pages
  1796. of other sizes or orientations to be clipped. This may be useful when
  1797. printing documents on a printer that can handle their requested paper size
  1798. but whose default is some other size. Note that <b><tt>-g</tt></b>
  1799. automatically sets <b><tt>-dFIXEDMEDIA</tt></b>, but
  1800. <b><tt>-sPAPERSIZE=</tt></b> does not.
  1801. </dl>
  1802. <dl>
  1803. <dt><b><tt>-dFIXEDRESOLUTION</tt></b>
  1804. <dd>Causes the media resolution to be fixed similarly. <b><tt>-r</tt></b>
  1805. automatically sets <b><tt>-dFIXEDRESOLUTION</tt></b>.
  1806. </dl>
  1807. <dl>
  1808. <dt><b><tt>-dORIENT1=true
  1809. <br>-dORIENT1=false</tt></b>
  1810. <dd>Defines the meaning of the 0 and 1 orientation values for the
  1811. setpage[params] compatibility operators. The default value of
  1812. <b><tt>ORIENT1</tt></b> is true (set in <b><tt>gs_init.ps</tt></b>), which
  1813. is the correct value for most files that use setpage[params] at all,
  1814. namely, files produced by badly designed applications that "know" that the
  1815. output will be printed on certain roll-media printers: these applications
  1816. use 0 to mean landscape and 1 to mean portrait.
  1817. <b><tt>-dORIENT1=false</tt></b> declares that 0 means portrait and 1 means
  1818. landscape, which is the convention used by a smaller number of files
  1819. produced by properly written applications.
  1820. </dl>
  1821. <dl>
  1822. <dt><b><tt>-dDEVICEWIDTHPOINTS=</tt></b><em>w</em>
  1823. <br><b><tt>-dDEVICEHEIGHTPOINTS=</tt></b><em>h</em>
  1824. <dd>Sets the initial page width to <em>w</em> or initial page height to
  1825. <em>h</em> respectively, specified in 1/72" units.
  1826. </dl>
  1827. <dl>
  1828. <dt><b><tt>-sDEFAULTPAPERSIZE=</tt></b><em>a4</em>
  1829. <dd>
  1830. This value will be used to replace the device default papersize ONLY
  1831. if the default papersize for the device is 'letter' or 'a4' serving
  1832. to insulate users of A4 or 8.5x11 from particular device defaults
  1833. (the collection of contributed drivers in Ghostscript vary as to
  1834. the default size).
  1835. </dd>
  1836. </dl>
  1837. <h4><a name="Font_related_parameters"></a>Font-related parameters</h4>
  1838. <dl>
  1839. <dt><a name="DISKFONTS"></a><b><tt>-dDISKFONTS</tt></b>
  1840. <dd>Causes individual character outlines to be loaded from the disk the
  1841. first time they are encountered. (Normally Ghostscript loads all the
  1842. character outlines when it loads a font.) This may allow loading more
  1843. fonts into memory at the expense of slower rendering.
  1844. <b><tt>DISKFONTS</tt></b> is effective only if the diskfont feature was
  1845. built into the executable; otherwise it is ignored.
  1846. </dl>
  1847. <dl>
  1848. <dt><b><tt>-dLOCALFONTS</tt></b>
  1849. <dd>Causes Type 1 fonts to be loaded into the current VM -- normally local
  1850. VM -- instead of always being loaded into global VM. Useful only for
  1851. compatibility with Adobe printers for loading some obsolete fonts.
  1852. </dl>
  1853. <dl>
  1854. <dt><b><tt>-dNOCCFONTS</tt></b>
  1855. <dd>Suppresses the use of fonts precompiled into the Ghostscript executable.
  1856. See <a href="Fonts.htm#Precompiling">"Precompiling fonts"</a> in the
  1857. documentation on fonts for details. This is probably useful only for
  1858. debugging.
  1859. </dl>
  1860. <dl>
  1861. <dt><a name="FONTMAP_switch"></a><b><tt>-dNOFONTMAP</tt></b>
  1862. <dd>Suppresses the normal loading of the Fontmap file. This may be useful
  1863. in environments without a file system.
  1864. </dl>
  1865. <dl>
  1866. <dt><b><tt>-dNOFONTPATH</tt></b>
  1867. <dd>Suppresses consultation of <b><tt>GS_FONTPATH</tt></b>. This may be
  1868. useful for debugging.
  1869. </dl>
  1870. <dl>
  1871. <dt><b><tt>-dNOPLATFONTS</tt></b>
  1872. <dd>Disables the use of fonts supplied by the underlying platform (X
  1873. Windows or Microsoft Windows). This may be needed if the platform fonts
  1874. look undesirably different from the scalable fonts.
  1875. </dl>
  1876. <dl>
  1877. <dt><b><tt>-sFONTMAP=</tt></b><em>filename1</em><b><tt>;</tt></b><em>filename2</em><b><tt>;</tt></b><em>...</em>
  1878. <dd>Specifies alternate name or names for the Fontmap file. Note that the
  1879. names are separated by "<b><tt>:</tt></b>" on Unix systems, by
  1880. "<b><tt>;</tt></b>" on MS Windows systems, and by
  1881. "<b><tt>,</tt></b>" on VMS systems, just as for search paths.
  1882. </dl>
  1883. <dl>
  1884. <dt><b><tt>-sFONTPATH=</tt></b><em>dir1</em><b><tt>;</tt></b><em>dir2</em><b><tt>;</tt></b><em>...</em>
  1885. <dd>Specifies a list of directories that will be scanned when looking for
  1886. fonts not found on the search path, overriding the environment variable
  1887. <b><tt>GS_FONTPATH</tt></b>.
  1888. </dl>
  1889. <dl>
  1890. <dt><b><tt>-sSUBSTFONT=</tt></b><em>fontname</em>
  1891. <dd>Causes the given font to be substituted for all unknown fonts, instead
  1892. of using the normal intelligent substitution algorithm. Also, in this
  1893. case, the font returned by <b><tt>findfont</tt></b> is the actual font
  1894. named <em>fontname</em>, not a copy of the font with its
  1895. <b><tt>FontName</tt></b> changed to the requested one.
  1896. THIS OPTION SHOULD NOT BE USED WITH HIGH LEVEL DEVICES, such as
  1897. <b><tt>pdfwrite</tt></b>, because it prevents such devices from
  1898. providing the original font names in the output document. The
  1899. font specified (<em>fontname</em>) will be embedded instead,
  1900. limiting all future users of the document to the same approximate
  1901. rendering.
  1902. </dl>
  1903. <h4><a name="Resource_related_parameters"></a>Resource-related parameters</h4>
  1904. <dl>
  1905. <dt><a name="GenericResourceDir"></a><b><tt>-sGenericResourceDir=path</tt></b>
  1906. <dd>Specifies a path to resource files.
  1907. The value is platform dependent. It must end with a directory separator.
  1908. <p>
  1909. Adobe specifies <b><tt>GenericResourceDir</tt></b> to be an absolute path
  1910. to a single resource directory. Ghostscript instead maintains
  1911. multiple resource directories and uses an extended method for finding
  1912. resources, which is explained in
  1913. <a href="PS_resources">"Finding PostScript Level 2 resources"</a>.
  1914. <p>
  1915. Due to the extended search method, Ghostscript uses <b><tt>GenericResourceDir</tt></b>
  1916. only as a default directory for resources being not installed.
  1917. Therefore <b><tt>GenericResourceDir</tt></b> may be considered as a place
  1918. where new resources to be installed. The default implementation of the function
  1919. <b><tt>ResourceFileName</tt></b> uses <b><tt>GenericResourceDir</tt></b> when
  1920. (1) it is an absolute path, or (2) the resource file is absent.
  1921. The extended search method does not call <b><tt>ResourceFileName</tt></b> .
  1922. <p>
  1923. Default value is <tt><b>(./Resource/)</b></tt> for Unix, and an equivalent one on other
  1924. platforms.
  1925. </dl>
  1926. <dl>
  1927. <dt><a name="FontResourceDir"></a><b><tt>-sFontResourceDir=path</tt></b>
  1928. <dd>Specifies a path where font files are installed.
  1929. It's meaning is similar to <b><tt>GenericResourceDir</tt></b>.
  1930. <p>
  1931. Default value is <tt><b>(./Font/)</b></tt> for Unix, and an equivalent one on other
  1932. platforms.
  1933. </dl>
  1934. <h4><a name="Interaction_related_parameters"></a>Interaction-related parameters</h4>
  1935. <dl>
  1936. <dt><b><tt>-dBATCH</tt></b>
  1937. <dd>Causes Ghostscript to exit after processing all files named on the
  1938. command line, rather than going into an interactive loop reading PostScript
  1939. commands. Equivalent to putting -c quit at the end of the command line.
  1940. </dl>
  1941. <dl>
  1942. <dt><b><tt>-dNOPAGEPROMPT</tt></b>
  1943. <dd>Disables only the prompt, but not the pause, at the end of each page.
  1944. This may be useful on PC displays that get confused if a program attempts
  1945. to write text to the console while the display is in a graphics mode.
  1946. </dl>
  1947. <dl>
  1948. <dt><a name="NoPause"></a><b><tt>-dNOPAUSE</tt></b>
  1949. <dd>Disables the prompt and pause at the end of each page. Normally one
  1950. should use this (along with <b><tt>-dBATCH</tt></b>) when producing output
  1951. on a printer or to a file; it also may be desirable for applications where
  1952. another program is "driving" Ghostscript.
  1953. </dl>
  1954. <dl>
  1955. <dt><b><tt>-dNOPROMPT</tt></b>
  1956. <dd>Disables the prompt printed by Ghostscript when it expects interactive
  1957. input, as well as the end-of-page prompt (<b><tt>-dNOPAGEPROMPT</tt></b>);
  1958. also disables the implicit <b><tt>flushpage</tt></b> that normally occurs
  1959. each time Ghostscript asks for more input. This allows piping input
  1960. directly into Ghostscript, as long as the data doesn't refer to
  1961. <b><tt>currentfile</tt></b>.
  1962. </dl>
  1963. <dl>
  1964. <dt><a name="dQUIET"></a><b><tt>-dQUIET</tt></b>
  1965. <dd>Suppresses routine information comments on standard output. This is
  1966. currently necessary when redirecting device output to standard output.
  1967. </dl>
  1968. <dl>
  1969. <dt><b><tt>-dSHORTERRORS</tt></b>
  1970. <dd>Makes certain error and information messages more Adobe-compatible.
  1971. </dl>
  1972. <dl>
  1973. <dt><b><tt>-sstdout=</tt></b><em>filename</em>
  1974. <dd>Redirect PostScript <b><tt>%stdout</tt></b> to a file or
  1975. <b><tt>stderr</tt></b>, to avoid it being mixed with device stdout.
  1976. To redirect stdout to stderr use <b><tt>-sstdout=%stderr</tt></b>.
  1977. To cancel redirection of stdout use <b><tt>-sstdout=%stdout</tt></b>
  1978. or <b><tt>-sstdout=-</tt></b>.
  1979. </dl>
  1980. <dl>
  1981. <dt><b><tt>-dTTYPAUSE</tt></b>
  1982. <dd>Causes Ghostscript to read a character from <b><tt>/dev/tty</tt></b>,
  1983. rather than standard input, at the end of each page. This may be useful if
  1984. input is coming from a pipe. Note that <b><tt>-dTTYPAUSE</tt></b>
  1985. overrides <b><tt>-dNOPAUSE</tt></b>.
  1986. </dl>
  1987. <h4><a name="Output_selection_parameters"></a>Device and output selection parameters</h4>
  1988. <dl>
  1989. <dt><b><tt>-dNODISPLAY</tt></b>
  1990. <dd>Initializes Ghostscript with a null device (a device that discards the
  1991. output image) rather than the default device or the device selected with
  1992. <b><tt>-sDEVICE=</tt></b>. This is usually useful only when running
  1993. PostScript code whose purpose is to compute something rather than to
  1994. produce an output image; for instance, when converting PostScript to PDF.
  1995. </dl>
  1996. <dl>
  1997. <dt><a name="DEVICE_switch"></a><b><tt>-sDEVICE=</tt></b><em>device</em>
  1998. <dd>Selects an alternate <a href="#Output_device">initial output
  1999. device</a>.
  2000. </dl>
  2001. <dl>
  2002. <dt><b><tt>-sOutputFile=</tt></b><em>filename</em>
  2003. <dd>Selects an alternate output file (or pipe) for the initial output
  2004. device, as described above.
  2005. </dl>
  2006. <h4><a name="EPS_parameters"></a>EPS parameters</h4>
  2007. <dl>
  2008. <dt><b><tt>-dEPSCrop</tt></b>
  2009. <dd>Crop an EPS file to the bounding box.
  2010. This is useful when converting an EPS file to a bitmap.
  2011. </dl>
  2012. <dl>
  2013. <dt><b><tt>-dEPSFitPage</tt></b>
  2014. <dd>Resize an EPS file to fit the page.
  2015. This is useful for enlarging an EPS file to fit the paper size when printing.
  2016. </dl>
  2017. <dl>
  2018. <dt><b><tt>-dNOEPS</tt></b>
  2019. <dd>Prevent special processing of EPS files.
  2020. This is useful when EPS files have incorrect Document
  2021. Structuring Convention comments.
  2022. </dl>
  2023. <h4><a name="Other_parameters"></a>Other parameters</h4>
  2024. <dl>
  2025. <dt><b><tt>-dDELAYBIND</tt></b>
  2026. <dd>Causes <b><tt>bind</tt></b> to remember all its invocations, but not
  2027. actually execute them until the <b><tt>.bindnow</tt></b> procedure is
  2028. called. Useful only for certain specialized packages like
  2029. <b><tt>pstotext</tt></b> that redefine operators. See the documentation
  2030. for <a href="Language.htm#bindnow"><tt>.bindnow</tt></a> for more information
  2031. on using this feature.
  2032. </dl>
  2033. <dl>
  2034. <dt><b><tt>-dDOPDFMARKS</tt></b>
  2035. <dd>Causes <b><tt>pdfmark</tt></b> to be called for bookmarks,
  2036. annotations, links and cropbox when processing PDF files.
  2037. Normally, <b><tt>pdfmark</tt></b> is only called for these types
  2038. for PostScript files or when the output device requests it
  2039. (e.g. pdfwrite device).
  2040. </dl>
  2041. <dl>
  2042. <dt><b><tt>-dJOBSERVER</tt></b>
  2043. <dd>Define <tt>\004 (^D)</tt> to start a new encapsulated job used for
  2044. compatibility with Adobe PS Interpreters that ordinarily run under a job
  2045. server. The <b><tt>-dNOOUTERSAVE</tt></b> switch is ignored if <b><tt>-dJOBSERVER</tt></b>
  2046. is specified since job servers <b>always</b> execute the input PostScript
  2047. under a save level, although the <b><tt>exitserver</tt></b> operator can
  2048. be used to escape from the encapsulated job and execute as if the
  2049. <b><tt>-dNOOUTERSAVE</tt></b> was specified.
  2050. <p>
  2051. This also requires that the input be from stdin, otherwise an error will
  2052. result (<tt>Error: /invalidrestore in --restore--</tt>).
  2053. <p>Example usage is:
  2054. <pre>
  2055. gs ... -dJOBSERVER - < inputfile.ps
  2056. -or-
  2057. cat inputfile.ps | gs ... -dJOBSERVER -
  2058. </pre>
  2059. <b>Note: </b>The <tt>^D</tt> does not result in an end-of-file action
  2060. on stdin as it may on some PostScript printers that rely on TBCP (Tagged
  2061. Binary Communication Protocol) to cause an out-of-band <tt>^D</tt> to
  2062. signal EOF in a stream input data. This means that direct file actions
  2063. on stdin such as <b><tt>flushfile</tt></b> and <b><tt>closefile</tt></b>
  2064. will affect processing of data beyond the <tt>^D</tt> in the stream.
  2065. </dl>
  2066. <dl>
  2067. <dt><b><tt>-dNOBIND</tt></b>
  2068. <dd>Disables the <b><tt>bind</tt></b> operator. Useful only for debugging.
  2069. </dl>
  2070. <dl>
  2071. <dt><b><tt>-dNOCACHE</tt></b>
  2072. <dd>Disables character caching. Useful only for debugging.
  2073. </dl>
  2074. <dl>
  2075. <dt><b><tt>-dNOGC</tt></b>
  2076. <dd>Suppresses the initial automatic enabling of the garbage collector in
  2077. Level 2 systems. (The <b><tt>vmreclaim</tt></b> operator is not disabled.)
  2078. Useful only for debugging.
  2079. </dl>
  2080. <dl>
  2081. <dt><b><tt>-dNOOUTERSAVE</tt></b>
  2082. <dd>Suppresses the initial save that is used for compatibility with Adobe
  2083. PS Interpreters that ordinarily run under a job server. If a job server is
  2084. going to be used to set up the outermost save level, then <b><tt>-dNOOUTERSAVE</tt></b>
  2085. should be used so that the restore between jobs will restore global VM as
  2086. expected.
  2087. </dl>
  2088. <dl>
  2089. <dt><b><tt>-dNOSAFER</tt></b> (equivalent to <b><tt>-dDELAYSAFER</tt></b>).
  2090. <dd>This flag disables SAFER mode until the <b><tt>.setsafe</tt></b>
  2091. procedure is run. This is intended for clients or scripts that cannot
  2092. operate in SAFER mode. If Ghostscript is started with <b><tt>-dNOSAFER</tt></b>
  2093. or <b><tt>-dDELAYSAFER</tt></b>, PostScript programs are allowed to read, write,
  2094. rename or delete any files in the system that are not protected by operating
  2095. system permissions.
  2096. <p><b>This mode should be used with caution, and <tt>.setsafe</tt> should be
  2097. run prior to running any PostScript file with unknown contents.</b>
  2098. </dl>
  2099. <a name="Safer"></a>
  2100. <dl>
  2101. <dt><b><tt>-dSAFER</tt></b>
  2102. <dd>Disables the <b><tt>deletefile</tt></b> and <b><tt>renamefile</tt></b>
  2103. operators, and the ability to open piped commands (<b><tt>%pipe%</tt></b><em>cmd</em>)
  2104. at all. Only <b><tt>%stdout</tt></b> and <b><tt>%stderr</tt></b> can be opened
  2105. for writing. Disables reading of files other than <b><tt>%stdin</tt></b>,
  2106. those given as a command line argument, or those contained on one of the paths
  2107. given by LIBPATH and FONTPATH and specified by the system params /FontResourceDir
  2108. and /GenericResourceDir.
  2109. <p>
  2110. This mode also sets the <a href="Language.htm#LockSafetyParams">.LockSafetyParams</a>
  2111. parameter of the default device, or the device specified with the <b><tt>-sDEVICE= </tt></b>
  2112. switch to protect against programs that attempt to write to files using the
  2113. OutputFile device parameter. Note that since the device parameters specified
  2114. on the command line (including OutputFile) are set prior to SAFER mode,
  2115. the <b><tt>-sOutputFile=...</tt></b> on the command line is unrestricted.
  2116. <p>
  2117. SAFER mode also prevents changing the /GenericResourceDir, /FontResourceDir
  2118. and either the /SystemParamsPassword or the /StartJobPassword.
  2119. <p>
  2120. <b>Note: </b>While SAFER mode is not the default, in a subsequent release of
  2121. Ghostscript, SAFER mode will be the default thus scripts or programs that need
  2122. to open files or set restricted parameters will require the <b><tt>-dNOSAFER</tt></b>
  2123. command line option.
  2124. <p>
  2125. When running -dNOSAFER it is possible to perform a <b><tt>save</tt></b>,
  2126. followed by <b><tt>.setsafe</tt></b>, execute a file or procedure in SAFER mode,
  2127. then use <b><tt>restore</tt></b> to return to NOSAFER mode. In order to prevent
  2128. the save object from being restored by the foreign file or procedure, the
  2129. <a href="Language.htm#Runandhide"><b>.runandhide</b></a> operator should
  2130. be used to hide the save object from the restricted procedure.
  2131. </dl>
  2132. <dl>
  2133. <dt><b><tt>-dSTRICT</tt></b>
  2134. <dd>Disables as many Ghostscript extensions as feasible, to be more helpful
  2135. in debugging applications that produce output for Adobe and other RIPs.
  2136. </dl>
  2137. <dl>
  2138. <dt><b><tt>-dWRITESYSTEMDICT</tt></b>
  2139. <dd>Leaves <b><tt>systemdict</tt></b> writable. This is necessary when
  2140. running special utility programs such as <b><tt>font2c</tt></b> and
  2141. <b><tt>pcharstr</tt></b>, which must bypass normal PostScript access
  2142. protection.
  2143. </dl>
  2144. <hr>
  2145. <h2><a name="Improving_performance"></a>Improving performance</h2>
  2146. <p>
  2147. Ghostscript attempts to find an optimum balance between speed and memory
  2148. consumption, but there are some cases in which you may get a very large
  2149. speedup by telling Ghostscript to use more memory.
  2150. <ul>
  2151. <li>
  2152. If you are using X Windows, setting the <b><tt>-dMaxBitmap=</tt></b>
  2153. parameter described <a href="#X_device_parameters">above</a> may
  2154. dramatically improve performance on files that have a lot of bitmap images.
  2155. <li>
  2156. If you are using Chinese, Japanese, or other fonts with very large character
  2157. sets, adding the following sequence of switches before the first file name
  2158. may dramatically improve performance at the cost of an additional 2-3 Mb of
  2159. memory: <b><tt>-c&nbsp;3000000&nbsp;setvmthreshold&nbsp;-f</tt></b>. This
  2160. can also be useful in processing large documents when using a high-level
  2161. output device (like pdfwrite) that maintains significant internal state.
  2162. In fact, the <a href="Language.htm#.setpdfwrite"><tt>.setpdfwrite</tt></a>
  2163. operator used by the ps2pdf script and others sets a vmthreshold value of
  2164. 3&nbsp;MB to account for this.
  2165. </ul>
  2166. <h2><a name="Environment_variables"></a>Summary of environment variables</h2>
  2167. <dl>
  2168. <dt><b><tt>GS</tt></b>, <b><tt>GSC</tt></b> (MS Windows only)
  2169. <dd>Specify the names of the Ghostscript executables. <b><tt>GS</tt></b>
  2170. brings up a new typein window and possibly a graphics window;
  2171. <b><tt>GSC</tt></b> uses the DOS console. If these are not set,
  2172. <b><tt>GS</tt></b> defaults to <b><tt>gswin32</tt></b>, and
  2173. <b><tt>GSC</tt></b> defaults to <b><tt>gswin32c</tt></b>.
  2174. </dl>
  2175. <dl>
  2176. <dt><a href="#GS_DEVICE"><b><tt>GS_DEVICE</tt></b></a>
  2177. <dd>Defines the default output device. This overrides the compiled-in default, but is overridden by any commandline setting.
  2178. </dl>
  2179. <dl>
  2180. <dt><a href="#Font_lookup"><b><tt>GS_FONTPATH</tt></b></a>
  2181. <dd>Specifies a list of directories to scan for fonts if a font requested
  2182. can't be found anywhere on the search path.
  2183. </dl>
  2184. <dl>
  2185. <dt><a href="#Finding_files"><b><tt>GS_LIB</tt></b></a>
  2186. <dd>Provides a search path for initialization files and fonts.
  2187. </dl>
  2188. <dl>
  2189. <dt><b><tt>GS_OPTIONS</tt></b>
  2190. <dd>Defines a list of command-line arguments to be processed before the
  2191. ones actually specified on the command line. For example, setting
  2192. <b><tt>GS_DEVICE</tt></b> to XYZ is equivalent to setting
  2193. <b><tt>GS_OPTIONS</tt></b> to <b><tt>-sDEVICE=XYZ</tt></b>. The contents
  2194. of <b><tt>GS_OPTIONS</tt></b> are not limited to switches; they may include
  2195. actual file names or even <a href="#Input_control">"@file" arguments</a>.
  2196. </dl>
  2197. <dl>
  2198. <dt><a href="#Temp_files"><b><tt>TEMP</tt></b>, <b><tt>TMPDIR</tt></b></a>
  2199. <dd>Defines a directory name for temporary files. If both
  2200. <b><tt>TEMP</tt></b> and <b><tt>TMPDIR</tt></b> are defined,
  2201. <b><tt>TMPDIR</tt></b> takes precedence.
  2202. </dl>
  2203. <hr>
  2204. <h2><a name="Debugging"></a>Debugging</h2>
  2205. <p>
  2206. The information here describing is probably interesting only to developers.
  2207. <h4><a name="Debug_switches"></a>Debug switches</h4>
  2208. There are several debugging switches that are detected by the interpreter.
  2209. These switches are available whether or not Ghostscript was built with the
  2210. DEBUG macro defined to the compiler (refer to <a href="Make.htm#Debugging">
  2211. building a debugging configuration</a>).
  2212. <p>Previous to 8.10, there was a single DEBUG flag, enabled with <b><tt>-dDEBUG
  2213. </tt></b> on the command line. Now there are several debugging flags to allow
  2214. more selective debugging information to be printed containing only what is
  2215. needed to investigate particular areas. For backward compatibilty, the
  2216. <b><tt>-dDEBUG</tt></b> option will set all of the subset switches.
  2217. <ul>
  2218. <table cellpadding=0 cellspacing=0>
  2219. <tr><td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<td>&nbsp;
  2220. <tr><td><b><tt>-dCCFONTDEBUG</tt></b><td><td>Compiled Fonts
  2221. <tr><td><b><tt>-dCFFDEBUG</tt></b><td><td>CFF Fonts
  2222. <tr><td><b><tt>-dCMAPDEBUG</tt></b><td><td>CMAP
  2223. <tr><td><b><tt>-dDOCIEDEBUG</tt></b><td><td>CIE color
  2224. <tr><td><b><tt>-dEPSDEBUG</tt></b><td><td>EPS handling
  2225. <tr><td><b><tt>-dFAPIDEBUG</tt></b><td><td>Font API
  2226. <tr><td><b><tt>-dINITDEBUG</tt></b><td><td>Initialization
  2227. <tr><td><b><tt>-dPDFDEBUG</tt></b><td><td>PDF Interpreter
  2228. <tr><td><b><tt>-dPDFOPTDEBUG</tt></b><td><td>PDF Optimizer (Linearizer)
  2229. <tr><td><b><tt>-dPDFWRDEBUG</tt></b><td><td>PDF Writer
  2230. <tr><td><b><tt>-dSETPDDEBUG</tt></b><td><td>setpagedevice
  2231. <tr><td><b><tt>-dSTRESDEBUG</tt></b><td><td>Static Resources
  2232. <tr><td><b><tt>-dTTFDEBUG</tt></b><td><td>TTF Fonts
  2233. <tr><td><b><tt>-dVGIFDEBUG</tt></b><td><td>ViewGIF
  2234. <tr><td><b><tt>-dVJPGDEBUG</tt></b><td><td>ViewJPEG
  2235. </table></ul>
  2236. <p><p>
  2237. The <b><tt>-Z</tt></b> and <b><tt>-T</tt></b> switches apply only
  2238. if the interpreter was <a href="Make.htm#Debugging">built for a debugging
  2239. configuration</a>. In the table below, the first column is a debugging
  2240. switch, the second is an equivalent switch (if any) and the third is its
  2241. usage.
  2242. <table cellpadding=0 cellspacing=0>
  2243. <tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Switches used in debugging</font><hr>
  2244. <tr> <th align=left>Switch
  2245. <td>&nbsp;&nbsp;
  2246. <th align=left>Equivalent
  2247. <td>&nbsp;&nbsp;
  2248. <th>&nbsp;
  2249. <tr> <td colspan=5><hr>
  2250. <tr> <td valign=top><b><tt>-A</tt></b>
  2251. <td>&nbsp;
  2252. <td valign=top><b><tt>-Z@</tt></b>
  2253. <td>&nbsp;
  2254. <td>Fill empty storage with a distinctive bit pattern for debugging
  2255. <tr> <td valign=top><b><tt>-A-</tt></b>
  2256. <td>&nbsp;
  2257. <td valign=top><b><tt>-Z-@</tt></b>
  2258. <td>&nbsp;
  2259. <td>Turn off <b><tt>-A</tt></b>
  2260. <tr> <td valign=top><b><tt>-B</tt></b><em>size</em>
  2261. <td>&nbsp;
  2262. <td>&nbsp;
  2263. <td>&nbsp;
  2264. <td>Run all subsequent files named on the command line (except for
  2265. <b><tt>-F</tt></b>) through the run_string interface, using a
  2266. buffer of <em>size</em> bytes
  2267. <tr> <td valign=top><b><tt>-B-</tt></b>
  2268. <td>&nbsp;
  2269. <td>&nbsp;
  2270. <td>&nbsp;
  2271. <td>Turn off <b><tt>-B</tt></b>: run subsequent files (except for
  2272. <b><tt>-F</tt></b>) directly in the normal way
  2273. <tr> <td valign=top><b><tt>-E</tt></b>
  2274. <td>&nbsp;
  2275. <td valign=top><b><tt>-Z#</tt></b>
  2276. <td>&nbsp;
  2277. <td>Turn on tracing of error returns from operators
  2278. <tr> <td valign=top><b><tt>-E-</tt></b>
  2279. <td>&nbsp;
  2280. <td valign=top><b><tt>-Z-#</tt></b>
  2281. <td>&nbsp;
  2282. <td>Turn off <b><tt>-E</tt></b>
  2283. <tr> <td valign=top><b><tt>-F</tt></b><em>file</em>
  2284. <td>&nbsp;
  2285. <td>&nbsp;
  2286. <td>&nbsp;
  2287. <td>Execute the file with <b><tt>-B1</tt></b> temporarily in effect
  2288. <tr> <td valign=top><b><tt>-K</tt></b><em>n</em>
  2289. <td>&nbsp;
  2290. <td>&nbsp;
  2291. <td>&nbsp;
  2292. <td>Limit the total amount of memory that the interpreter can have
  2293. allocated at any one time to <b><em>n</em></b>K bytes.
  2294. <b><em>n</em></b> is a positive decimal integer.
  2295. <tr> <td valign=top><b><tt>-M</tt></b><em>n</em>
  2296. <td>&nbsp;
  2297. <td>&nbsp;
  2298. <td>&nbsp;
  2299. <td>Force the interpreter's allocator to acquire additional memory
  2300. in units of <b><em>n</em></b>K bytes, rather than the default
  2301. (currently 20K on DOS systems, 50K on Unix). <b><em>n</em></b>
  2302. is a positive decimal integer, on DOS systems no greater than
  2303. 63.
  2304. <tr> <td valign=top><b><tt>-N</tt></b><em>n</em>
  2305. <td>&nbsp;
  2306. <td>&nbsp;
  2307. <td>&nbsp;
  2308. <td>Allocate space for <b><em>n</em></b>K names, rather than the
  2309. default (normally 64K). <b><em>n</em></b> may be greater than
  2310. 64 only if <b><tt>EXTEND_NAMES</tt></b> was defined when the
  2311. interpreter was compiled .
  2312. <tr> <td valign=top><b><tt>-Z</tt></b><em>xxx</em><br><b><tt>-Z-</tt></b><em>xxx</em>
  2313. <td>&nbsp;
  2314. <td>&nbsp;
  2315. <td>&nbsp;
  2316. <td>Turn debugging printout on (off). Each of the <em>xxx</em>
  2317. characters selects an option. Case is significant: "a" and
  2318. "A" have different meanings.
  2319. <dl compact>
  2320. <dt><b><tt>0</tt></b><dd>garbage collector, minimal detail
  2321. <dt><b><tt>1</tt></b><dd>type 1 and type 42 font interpreter
  2322. <dt><b><tt>2</tt></b><dd>curve subdivider/rasterizer
  2323. <dt>&nbsp;&nbsp;&nbsp;<b><tt>3</tt></b><dd>curve subdivider/rasterizer, detail
  2324. <dt><b><tt>4</tt></b><dd>garbage collector (strings)
  2325. <dt>&nbsp;&nbsp;&nbsp;<b><tt>5</tt></b><dd>garbage collector (strings, detail)
  2326. <dt><b><tt>6</tt></b><dd>garbage collector (chunks, roots)
  2327. <dt>&nbsp;&nbsp;&nbsp;<b><tt>7</tt></b><dd>garbage collector (objects)
  2328. <dt>&nbsp;&nbsp;&nbsp;<b><tt>8</tt></b><dd>garbage collector (refs)
  2329. <dt>&nbsp;&nbsp;&nbsp;<b><tt>9</tt></b><dd>garbage collector (pointers)
  2330. <dt><b><tt>a</tt></b><dd>allocator (large blocks only)
  2331. <dt>&nbsp;&nbsp;&nbsp;<b><tt>A</tt></b><dd>allocator (all calls)
  2332. <dt><b><tt>b</tt></b><dd>bitmap image processor
  2333. <dt>&nbsp;&nbsp;&nbsp;<b><tt>B</tt></b><dd>bitmap images, detail
  2334. <dt><b><tt>c</tt></b><dd>color/halftone mapper
  2335. <dt><b><tt>d</tt></b><dd>dictionary put/undef
  2336. <dt>&nbsp;&nbsp;&nbsp;<b><tt>D</tt></b><dd>dictionary lookups
  2337. <dt><b><tt>e</tt></b><dd>external (OS-related) calls
  2338. <dt><b><tt>f</tt></b><dd>fill algorithm (summary)
  2339. <dt>&nbsp;&nbsp;&nbsp;<b><tt>F</tt></b><dd>fill algorithm (detail)
  2340. <dt><b><tt>g</tt></b><dd>gsave/grestore[all]
  2341. <dt><b><tt>h</tt></b><dd>halftone renderer
  2342. <dt>&nbsp;&nbsp;&nbsp;<b><tt>H</tt></b><dd>halftones, every pixel
  2343. <dt><b><tt>i</tt></b><dd>interpreter, just names
  2344. <dt>&nbsp;&nbsp;&nbsp;<b><tt>I</tt></b><dd>interpreter, everything
  2345. <dt><b><tt>j</tt></b><dd>(Japanese) composite fonts
  2346. <dt><b><tt>k</tt></b><dd>character cache and xfonts
  2347. <dt>&nbsp;&nbsp;&nbsp;<b><tt>K</tt></b><dd>character cache, every access
  2348. <dt><b><tt>l</tt></b><dd>command lists, bands
  2349. <dt>&nbsp;&nbsp;&nbsp;<b><tt>L</tt></b><dd>command lists, everything
  2350. <dt><b><tt>m</tt></b><dd>makefont and font cache
  2351. <dt><b><tt>n</tt></b><dd>name lookup (new names only)
  2352. <dt><b><tt>o</tt></b><dd>outliner (stroke)
  2353. <dt>&nbsp;&nbsp;&nbsp;<b><tt>O</tt></b><dd>stroke detail
  2354. <dt><b><tt>p</tt></b><dd>band list paths
  2355. <dt>&nbsp;&nbsp;&nbsp;<b><tt>P</tt></b><dd>all paths
  2356. <dt><b><tt>q</tt></b><dd>clipping
  2357. <dt><b><tt>r</tt></b><dd>arc renderer
  2358. <dt><b><tt>s</tt></b><dd>streams
  2359. <dt>&nbsp;&nbsp;&nbsp;<b><tt>S</tt></b><dd>scanner
  2360. <dt><b><tt>t</tt></b><dd>tiling algorithm
  2361. <dt><b><tt>u</tt></b><dd>undo saver (for save/restore), finalization
  2362. <dt>&nbsp;&nbsp;&nbsp;<b><tt>U</tt></b><dd>undo saver, more detail
  2363. <dt><b><tt>v</tt></b><dd>alpha/transparency
  2364. <dt>&nbsp;&nbsp;&nbsp;<b><tt>V</tt></b><dd>alpha/transparency, more detail
  2365. <dt><b><tt>w</tt></b><dd>compression encoder/decoder
  2366. <dt><b><tt>x</tt></b><dd>transformations
  2367. <dt><b><tt>y</tt></b><dd>Type 1 hints
  2368. <dt>&nbsp;&nbsp;&nbsp;<b><tt>Y</tt></b><dd>Type 1 hints, every access
  2369. <dt><b><tt>z</tt></b><dd>trapezoid fill
  2370. <dt><b><tt>#</tt></b><dd>operator error returns
  2371. <dt><b><tt>%</tt></b><dd>externally processed comments
  2372. <dt><b><tt>*</tt></b><dd>image and RasterOp parameters
  2373. <dt><b><tt>:</tt></b><dd>command list and allocator/time summary
  2374. <dt><b><tt>~</tt></b><dd>math functions and Functions
  2375. <dt><b><tt>'</tt></b><dd>contexts, create/destroy
  2376. <dt>&nbsp;&nbsp;&nbsp;<b><tt>"</tt></b><dd>contexts, every operation
  2377. <dt><b><tt>^</tt></b><dd>reference counting
  2378. <dt><b><tt>_</tt></b><dd>high-level output
  2379. <dt><b><tt>|</tt></b><dd>(reserved for experimental code)
  2380. </dl>
  2381. <p>
  2382. The following switch affects what is printed, but does not select specific
  2383. items for printing:
  2384. <dl compact>
  2385. <dt><b><tt>/</tt></b><dd>include file name and line number on all trace output
  2386. </dl>
  2387. <p>
  2388. These switches select debugging options other than what should be printed:
  2389. <dl compact>
  2390. <dt><b><tt>$</tt></b><dd>set unused parts of object references to
  2391. identifiable garbage values
  2392. <dt><b><tt>+</tt></b><dd>use minimum-size stack blocks
  2393. <dt><b><tt>,</tt></b><dd>don't use path-based banding
  2394. <dt><b><tt>`</tt></b><dd>don't use high-level banded images
  2395. <dt><b><tt>.</tt></b><dd>use small-memory table sizes even on large-memory
  2396. machines
  2397. <dt><b><tt>?</tt></b><dd>validate pointers before, during and after garbage
  2398. collection, also before and after save and restore; also make other
  2399. allocator validity checks
  2400. <dt><b><tt>@</tt></b><dd>fill newly allocated, garbage-collected, and freed
  2401. storage with a marker (a1, c1, and f1 respectively)
  2402. </dl>
  2403. <p>
  2404. <tr> <td valign=top><b><tt>-T</tt></b><em>xxx</em><br><b><tt>-T-</tt></b><em>xxx</em>
  2405. <td>&nbsp;
  2406. <td>&nbsp;
  2407. <td>&nbsp;
  2408. <td>Turn <a href="#Visual_trace">Visual Trace</a> on (off). Each of the <em>xxx</em>
  2409. characters selects an option. Case is significant: "f" and
  2410. "F" have different meanings.
  2411. <dl compact>
  2412. <dt><b><tt>f</tt></b><dd>the filling algorithm with characters
  2413. <dt><b><tt>F</tt></b><dd>the filling algorithm with non-character paths
  2414. <dt><b><tt>h</tt></b><dd>the Type 1 hinter
  2415. <dt><b><tt>s</tt></b><dd>the shading algorithm
  2416. <dt><b><tt>S</tt></b><dd>the stroking algorithm
  2417. </dl>
  2418. </table>
  2419. <h4><a name="Visual_trace"></a>Visual Trace</h4>
  2420. <p>
  2421. Visual Trace allows to view internal Ghostscript data in a graphical form
  2422. while execution of C code. Special
  2423. <a href="Lib.htm#Visual_trace">instructions</a> to be inserted into
  2424. C code for generating the output. Client application
  2425. rasterizes it into a window.
  2426. <p>
  2427. Currently the rasterization is implemented for Windows only, in clients
  2428. gswin32.exe and gswin32c.exe. They open Visual Trace window when graphical
  2429. debug output appears, <b><tt>-T</tt></b> <a href="#Debug_switches">switch</a> is set,
  2430. and Ghostscript was <a href="Make.htm#Debugging">built</a> with DEBUG option.
  2431. There are two important incompletenesses of the implementation :
  2432. <p>
  2433. 1. The graphical output uses a hardcoded scale. An advanced client
  2434. would provide a scale option via user interface.
  2435. <p>
  2436. 2. Breaks are not implemented in the client. If you need a step-by-step
  2437. view, you should use an interactive C debugger to delay execution at breakpoints.
  2438. <p>
  2439. <hr>
  2440. <h2><a name="Known_paper_sizes"></a>Appendix: Paper sizes known to Ghostscript</h2>
  2441. <p>
  2442. The paper sizes known to Ghostscript are defined at the beginning of the
  2443. initialization file <b><tt>gs_statd.ps</tt></b>; see the comments there for
  2444. more details about the definitions. The table here lists them by name and
  2445. size. <b><tt>gs_statd.ps</tt></b> defines their sizes exactly in points,
  2446. and the dimensions in inches (at 72 points per inch) and centimeters shown
  2447. in the table are derived from those, rounded to the nearest 0.1 unit. A
  2448. guide to international paper sizes can be found at
  2449. <blockquote>
  2450. <a href="http://www.twics.com/~eds/paper/index.html">http://www.twics.com/~eds/paper/</a>
  2451. </blockquote>
  2452. <table cellpadding=0 cellspacing=0>
  2453. <tr><th colspan=13 bgcolor="#CCCC00"><hr><font size="+1">Paper sizes known to Ghostscript</font><hr>
  2454. <tr><th colspan=13>U.S. standard
  2455. <tr> <td>&nbsp;
  2456. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2457. <th colspan=3>Inches
  2458. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2459. <th colspan=3>mm
  2460. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2461. <th colspan=3>Points
  2462. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2463. <td>&nbsp;
  2464. <tr> <th align=left>Name
  2465. <td>&nbsp;
  2466. <th>&nbsp;W&nbsp;
  2467. <td>&times;
  2468. <th>&nbsp;H&nbsp;
  2469. <td>&nbsp;
  2470. <th>&nbsp;W&nbsp;
  2471. <td>&times;
  2472. <th>&nbsp;H&nbsp;
  2473. <td>&nbsp;
  2474. <th>&nbsp;W&nbsp;
  2475. <td>&times;
  2476. <th>&nbsp;H&nbsp;
  2477. <td>&nbsp;
  2478. <td>&nbsp;
  2479. <tr> <td colspan=13><hr>
  2480. <tr> <td>11x17
  2481. <td>&nbsp;&nbsp;<td align=right>11.0<td>&nbsp;&nbsp;<td align=right>17.0<td>&nbsp;&nbsp;<td align=right>279<td>&nbsp;&nbsp;<td align=right>432<td>&nbsp;&nbsp;<td align=right>792<td>&nbsp;&nbsp;<td align=right>1224<td>&nbsp;&nbsp;<td>11&times;17in portrait
  2482. <tr> <td>ledger
  2483. <td>&nbsp;<td align=right>17.0<td>&nbsp;<td align=right>11.0<td>&nbsp;<td align=right>432<td>&nbsp;<td align=right>279<td>&nbsp;<td align=right>1224<td>&nbsp;<td align=right>792<td>&nbsp;<td>11&times;17in landscape
  2484. <tr> <td>legal
  2485. <td>&nbsp;<td align=right>8.5<td>&nbsp;<td align=right>14.0<td>&nbsp;<td align=right>216<td>&nbsp;<td align=right>356<td>&nbsp;<td align=right>612<td>&nbsp;<td align=right>1008<td>&nbsp;<td>&nbsp;
  2486. <tr> <td>letter
  2487. <td>&nbsp;<td align=right>8.5<td>&nbsp;<td align=right>11.0<td>&nbsp;<td align=right>216<td>&nbsp;<td align=right>279<td>&nbsp;<td align=right>612<td>&nbsp;<td align=right>792<td>&nbsp;<td>&nbsp;
  2488. <tr> <td>lettersmall
  2489. <td>&nbsp;<td align=right>8.5<td>&nbsp;<td align=right>11.0<td>&nbsp;<td align=right>216<td>&nbsp;<td align=right>279<td>&nbsp;<td align=right>612<td>&nbsp;<td align=right>792<td>&nbsp;<td>&nbsp;
  2490. <tr> <td>archE
  2491. <td>&nbsp;<td align=right>36.0<td>&nbsp;<td align=right>48.0<td>&nbsp;<td align=right>914<td>&nbsp;<td align=right>1219<td>&nbsp;<td align=right>2592<td>&nbsp;<td align=right>3456<td>&nbsp;<td>&nbsp;
  2492. <tr> <td>archD
  2493. <td>&nbsp;<td align=right>24.0<td>&nbsp;<td align=right>36.0<td>&nbsp;<td align=right>610<td>&nbsp;<td align=right>914<td>&nbsp;<td align=right>1728<td>&nbsp;<td align=right>2592<td>&nbsp;<td>&nbsp;
  2494. <tr> <td>archC
  2495. <td>&nbsp;<td align=right>18.0<td>&nbsp;<td align=right>24.0<td>&nbsp;<td align=right>457<td>&nbsp;<td align=right>610<td>&nbsp;<td align=right>1296<td>&nbsp;<td align=right>1728<td>&nbsp;<td>&nbsp;
  2496. <tr> <td>archB
  2497. <td>&nbsp;<td align=right>12.0<td>&nbsp;<td align=right>18.0<td>&nbsp;<td align=right>305<td>&nbsp;<td align=right>457<td>&nbsp;<td align=right>864<td>&nbsp;<td align=right>1296<td>&nbsp;<td>&nbsp;
  2498. <tr> <td>archA
  2499. <td>&nbsp;<td align=right>9.0<td>&nbsp;<td align=right>12.0<td>&nbsp;<td align=right>229<td>&nbsp;<td align=right>305<td>&nbsp;<td align=right>648<td>&nbsp;<td align=right>864<td>&nbsp;<td>&nbsp;
  2500. <tr> <td colspan=13><hr>
  2501. <tr><th colspan=13>ISO standard
  2502. <tr> <td colspan=13><hr>
  2503. <tr> <td>a0
  2504. <td>&nbsp;<td align=right>33.1<td>&nbsp;<td align=right>46.8<td>&nbsp;<td align=right>841<td>&nbsp;<td align=right>1189<td>&nbsp;<td align=right>2384<td>&nbsp;<td align=right>3370<td>&nbsp;<td>&nbsp;
  2505. <tr> <td>a1
  2506. <td>&nbsp;<td align=right>23.4<td>&nbsp;<td align=right>33.1<td>&nbsp;<td align=right>594<td>&nbsp;<td align=right>841<td>&nbsp;<td align=right>1684<td>&nbsp;<td align=right>2384<td>&nbsp;<td>&nbsp;
  2507. <tr> <td>a2
  2508. <td>&nbsp;<td align=right>16.5<td>&nbsp;<td align=right>23.4<td>&nbsp;<td align=right>420<td>&nbsp;<td align=right>594<td>&nbsp;<td align=right>1191<td>&nbsp;<td align=right>1684<td>&nbsp;<td>&nbsp;
  2509. <tr> <td>a3
  2510. <td>&nbsp;<td align=right>11.7<td>&nbsp;<td align=right>16.5<td>&nbsp;<td align=right>297<td>&nbsp;<td align=right>420<td>&nbsp;<td align=right>842<td>&nbsp;<td align=right>1191<td>&nbsp;<td>&nbsp;
  2511. <tr> <td>a4
  2512. <td>&nbsp;<td align=right>8.3<td>&nbsp;<td align=right>11.7<td>&nbsp;<td align=right>210<td>&nbsp;<td align=right>297<td>&nbsp;<td align=right>595<td>&nbsp;<td align=right>842<td>&nbsp;<td>&nbsp;
  2513. <tr> <td>a4small
  2514. <td>&nbsp;<td align=right>8.3<td>&nbsp;<td align=right>11.7<td>&nbsp;<td align=right>210<td>&nbsp;<td align=right>297<td>&nbsp;<td align=right>595<td>&nbsp;<td align=right>842<td>&nbsp;<td>&nbsp;
  2515. <tr> <td>a5
  2516. <td>&nbsp;<td align=right>5.8<td>&nbsp;<td align=right>8.3<td>&nbsp;<td align=right>148<td>&nbsp;<td align=right>210<td>&nbsp;<td align=right>420<td>&nbsp;<td align=right>595<td>&nbsp;<td>&nbsp;
  2517. <tr> <td>a6
  2518. <td>&nbsp;<td align=right>4.1<td>&nbsp;<td align=right>5.8<td>&nbsp;<td align=right>105<td>&nbsp;<td align=right>148<td>&nbsp;<td align=right>297<td>&nbsp;<td align=right>420<td>&nbsp;<td>&nbsp;
  2519. <tr> <td>a7
  2520. <td>&nbsp;<td align=right>2.9<td>&nbsp;<td align=right>4.1<td>&nbsp;<td align=right>74<td>&nbsp;<td align=right>105<td>&nbsp;<td align=right>210<td>&nbsp;<td align=right>297<td>&nbsp;<td>&nbsp;
  2521. <tr> <td>a8
  2522. <td>&nbsp;<td align=right>2.1<td>&nbsp;<td align=right>2.9<td>&nbsp;<td align=right>52<td>&nbsp;<td align=right>74<td>&nbsp;<td align=right>148<td>&nbsp;<td align=right>210<td>&nbsp;<td>&nbsp;
  2523. <tr> <td>a9
  2524. <td>&nbsp;<td align=right>1.5<td>&nbsp;<td align=right>2.1<td>&nbsp;<td align=right>37<td>&nbsp;<td align=right>52<td>&nbsp;<td align=right>105<td>&nbsp;<td align=right>148<td>&nbsp;<td>&nbsp;
  2525. <tr> <td>a10
  2526. <td>&nbsp;<td align=right>1.0<td>&nbsp;<td align=right>1.5<td>&nbsp;<td align=right>26<td>&nbsp;<td align=right>37<td>&nbsp;<td align=right>73<td>&nbsp;<td align=right>105<td>&nbsp;<td>&nbsp;
  2527. <tr> <td>isob0
  2528. <td>&nbsp;<td align=right>39.4<td>&nbsp;<td align=right>55.7<td>&nbsp;<td align=right>1000<td>&nbsp;<td align=right>1414<td>&nbsp;<td align=right>2835<td>&nbsp;<td align=right>4008<td>&nbsp;<td>&nbsp;
  2529. <tr> <td>isob1
  2530. <td>&nbsp;<td align=right>27.8<td>&nbsp;<td align=right>39.4<td>&nbsp;<td align=right>707<td>&nbsp;<td align=right>1000<td>&nbsp;<td align=right>2004<td>&nbsp;<td align=right>2835<td>&nbsp;<td>&nbsp;
  2531. <tr> <td>isob2
  2532. <td>&nbsp;<td align=right>19.7<td>&nbsp;<td align=right>27.8<td>&nbsp;<td align=right>500<td>&nbsp;<td align=right>707<td>&nbsp;<td align=right>1417<td>&nbsp;<td align=right>2004<td>&nbsp;<td>&nbsp;
  2533. <tr> <td>isob3
  2534. <td>&nbsp;<td align=right>13.9<td>&nbsp;<td align=right>19.7<td>&nbsp;<td align=right>353<td>&nbsp;<td align=right>500<td>&nbsp;<td align=right>1001<td>&nbsp;<td align=right>1417<td>&nbsp;<td>&nbsp;
  2535. <tr> <td>isob4
  2536. <td>&nbsp;<td align=right>9.8<td>&nbsp;<td align=right>13.9<td>&nbsp;<td align=right>250<td>&nbsp;<td align=right>353<td>&nbsp;<td align=right>709<td>&nbsp;<td align=right>1001<td>&nbsp;<td>&nbsp;
  2537. <tr> <td>isob5
  2538. <td>&nbsp;<td align=right>6.9<td>&nbsp;<td align=right>9.8<td>&nbsp;<td align=right>176<td>&nbsp;<td align=right>250<td>&nbsp;<td align=right>499<td>&nbsp;<td align=right>709<td>&nbsp;<td>&nbsp;
  2539. <tr> <td>isob6
  2540. <td>&nbsp;<td align=right>4.9<td>&nbsp;<td align=right>6.9<td>&nbsp;<td align=right>125<td>&nbsp;<td align=right>176<td>&nbsp;<td align=right>354<td>&nbsp;<td align=right>499<td>&nbsp;<td>&nbsp;
  2541. <tr> <td>c0
  2542. <td>&nbsp;<td align=right>36.1<td>&nbsp;<td align=right>51.1<td>&nbsp;<td align=right>917<td>&nbsp;<td align=right>1297<td>&nbsp;<td align=right>2599<td>&nbsp;<td align=right>3677<td>&nbsp;<td>&nbsp;
  2543. <tr> <td>c1
  2544. <td>&nbsp;<td align=right>25.5<td>&nbsp;<td align=right>36.1<td>&nbsp;<td align=right>648<td>&nbsp;<td align=right>917<td>&nbsp;<td align=right>1837<td>&nbsp;<td align=right>2599<td>&nbsp;<td>&nbsp;
  2545. <tr> <td>c2
  2546. <td>&nbsp;<td align=right>18.0<td>&nbsp;<td align=right>25.5<td>&nbsp;<td align=right>458<td>&nbsp;<td align=right>648<td>&nbsp;<td align=right>1298<td>&nbsp;<td align=right>1837<td>&nbsp;<td>&nbsp;
  2547. <tr> <td>c3
  2548. <td>&nbsp;<td align=right>12.8<td>&nbsp;<td align=right>18.0<td>&nbsp;<td align=right>324<td>&nbsp;<td align=right>458<td>&nbsp;<td align=right>918<td>&nbsp;<td align=right>1298<td>&nbsp;<td>&nbsp;
  2549. <tr> <td>c4
  2550. <td>&nbsp;<td align=right>9.0<td>&nbsp;<td align=right>12.8<td>&nbsp;<td align=right>229<td>&nbsp;<td align=right>324<td>&nbsp;<td align=right>649<td>&nbsp;<td align=right>918<td>&nbsp;<td>&nbsp;
  2551. <tr> <td>c5
  2552. <td>&nbsp;<td align=right>6.4<td>&nbsp;<td align=right>9.0<td>&nbsp;<td align=right>162<td>&nbsp;<td align=right>229<td>&nbsp;<td align=right>459<td>&nbsp;<td align=right>649<td>&nbsp;<td>&nbsp;
  2553. <tr> <td>c6
  2554. <td>&nbsp;<td align=right>4.5<td>&nbsp;<td align=right>6.4<td>&nbsp;<td align=right>114<td>&nbsp;<td align=right>162<td>&nbsp;<td align=right>323<td>&nbsp;<td align=right>459<td>&nbsp;<td>&nbsp;
  2555. <tr> <td colspan=13><hr>
  2556. <tr><th colspan=13>JIS standard
  2557. <tr> <td colspan=13><hr>
  2558. <tr> <td>jisb0
  2559. <td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td align=right>1030<td>&nbsp;<td align=right>1456<td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td>&nbsp;
  2560. <tr> <td>jisb1
  2561. <td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td align=right>728<td>&nbsp;<td align=right>1030<td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td>&nbsp;
  2562. <tr> <td>jisb2
  2563. <td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td align=right>515<td>&nbsp;<td align=right>728<td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td>&nbsp;
  2564. <tr> <td>jisb3
  2565. <td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td align=right>364<td>&nbsp;<td align=right>515<td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td>&nbsp;
  2566. <tr> <td>jisb4
  2567. <td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td align=right>257<td>&nbsp;<td align=right>364<td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td>&nbsp;
  2568. <tr> <td>jisb5
  2569. <td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td align=right>182<td>&nbsp;<td align=right>257<td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td>&nbsp;
  2570. <tr> <td>jisb6
  2571. <td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td align=right>128<td>&nbsp;<td align=right>182<td>&nbsp;<td align=right><td>&nbsp;<td align=right><td>&nbsp;<td>&nbsp;
  2572. <tr> <td colspan=13><hr>
  2573. <tr><th colspan=13>ISO/JIS switchable
  2574. <tr> <td colspan=13><hr>
  2575. <tr> <td>b0 (see * below)
  2576. <tr> <td>b1 (see * below)
  2577. <tr> <td>b2 (see * below)
  2578. <tr> <td>b3 (see * below)
  2579. <tr> <td>b4 (see * below)
  2580. <tr> <td>b5 (see * below)
  2581. <tr> <td colspan=13><hr>
  2582. <tr><th colspan=13>Other
  2583. <tr> <td colspan=13><hr>
  2584. <tr> <td>flsa
  2585. <td>&nbsp;<td align=right>8.5<td>&nbsp;<td align=right>13.0<td>&nbsp;<td align=right>216<td>&nbsp;<td align=right>330<td>&nbsp;<td align=right>612<td>&nbsp;<td align=right>936<td>&nbsp;<td>U.S. foolscap
  2586. <tr> <td>flse
  2587. <td>&nbsp;<td align=right>8.5<td>&nbsp;<td align=right>13.0<td>&nbsp;<td align=right>216<td>&nbsp;<td align=right>330<td>&nbsp;<td align=right>612<td>&nbsp;<td align=right>936<td>&nbsp;<td>European foolscap
  2588. <tr> <td>halfletter
  2589. <td>&nbsp;<td align=right>5.5<td>&nbsp;<td align=right>8.5<td>&nbsp;<td align=right>140<td>&nbsp;<td align=right>216<td>&nbsp;<td align=right>396<td>&nbsp;<td align=right>612<td>&nbsp;<td>&nbsp;
  2590. </table>
  2591. <p>
  2592. *<em>Note:</em> Initially the B paper sizes are the ISO sizes, e.g.,
  2593. <b><tt>b0</tt></b> is the same as <b><tt>isob0</tt></b>. Running the file
  2594. <b><tt>lib/jispaper.ps</tt></b> makes the B paper sizes be the JIS sizes,
  2595. e.g., <b><tt>b0</tt></b> becomes the same as <b><tt>jisb0</tt></b>.
  2596. <hr>
  2597. <h2><a name="X_font_mappings"></a>Appendix: X default font mappings</h2>
  2598. <h3><a name="Standard_X_server_fonts"></a>Standard X servers</h3>
  2599. <h4><a name="X_regular_fonts"></a>Regular fonts</h4>
  2600. <pre> AvantGarde-Book: -Adobe-ITC Avant Garde Gothic-Book-R-Normal--\n\
  2601. AvantGarde-BookOblique: -Adobe-ITC Avant Garde Gothic-Book-O-Normal--\n\
  2602. AvantGarde-Demi: -Adobe-ITC Avant Garde Gothic-Demi-R-Normal--\n\
  2603. AvantGarde-DemiOblique: -Adobe-ITC Avant Garde Gothic-Demi-O-Normal--\n\
  2604. Bookman-Demi: -Adobe-ITC Bookman-Demi-R-Normal--\n\
  2605. Bookman-DemiItalic: -Adobe-ITC Bookman-Demi-I-Normal--\n\
  2606. Bookman-Light: -Adobe-ITC Bookman-Light-R-Normal--\n\
  2607. Bookman-LightItalic: -Adobe-ITC Bookman-Light-I-Normal--\n\
  2608. Courier: -Adobe-Courier-Medium-R-Normal--\n\
  2609. Courier-Bold: -Adobe-Courier-Bold-R-Normal--\n\
  2610. Courier-BoldOblique: -Adobe-Courier-Bold-O-Normal--\n\
  2611. Courier-Oblique: -Adobe-Courier-Medium-O-Normal--\n\
  2612. Helvetica: -Adobe-Helvetica-Medium-R-Normal--\n\
  2613. Helvetica-Bold: -Adobe-Helvetica-Bold-R-Normal--\n\
  2614. Helvetica-BoldOblique: -Adobe-Helvetica-Bold-O-Normal--\n\
  2615. Helvetica-Narrow: -Adobe-Helvetica-Medium-R-Narrow--\n\
  2616. Helvetica-Narrow-Bold: -Adobe-Helvetica-Bold-R-Narrow--\n\
  2617. Helvetica-Narrow-BoldOblique: -Adobe-Helvetica-Bold-O-Narrow--\n\
  2618. Helvetica-Narrow-Oblique: -Adobe-Helvetica-Medium-O-Narrow--\n\
  2619. Helvetica-Oblique: -Adobe-Helvetica-Medium-O-Normal--\n\
  2620. NewCenturySchlbk-Bold: -Adobe-New Century Schoolbook-Bold-R-Normal--\n\
  2621. NewCenturySchlbk-BoldItalic: -Adobe-New Century Schoolbook-Bold-I-Normal--\n\
  2622. NewCenturySchlbk-Italic: -Adobe-New Century Schoolbook-Medium-I-Normal--\n\
  2623. NewCenturySchlbk-Roman: -Adobe-New Century Schoolbook-Medium-R-Normal--\n\
  2624. Palatino-Bold: -Adobe-Palatino-Bold-R-Normal--\n\
  2625. Palatino-BoldItalic: -Adobe-Palatino-Bold-I-Normal--\n\
  2626. Palatino-Italic: -Adobe-Palatino-Medium-I-Normal--\n\
  2627. Palatino-Roman: -Adobe-Palatino-Medium-R-Normal--\n\
  2628. Times-Bold: -Adobe-Times-Bold-R-Normal--\n\
  2629. Times-BoldItalic: -Adobe-Times-Bold-I-Normal--\n\
  2630. Times-Italic: -Adobe-Times-Medium-I-Normal--\n\
  2631. Times-Roman: -Adobe-Times-Medium-R-Normal--\n\
  2632. ZapfChancery-MediumItalic: -Adobe-ITC Zapf Chancery-Medium-I-Normal--
  2633. </pre>
  2634. <h4><a name="X_symbol_fonts"></a>Symbol fonts</h4>
  2635. <pre> Symbol: -Adobe-Symbol-Medium-R-Normal--
  2636. </pre>
  2637. <h4><a name="X_dingbat_fonts"></a>Dingbat fonts</h4>
  2638. <pre> ZapfDingbats: -Adobe-ITC Zapf Dingbats-Medium-R-Normal--
  2639. </pre>
  2640. <h3><a name="OpenWindows_fonts"></a>Sun OpenWindows</h3>
  2641. <p>
  2642. For Sun's X11/NeWS one can use the OpenWindows scalable fonts instead,
  2643. which gives good output for any point size. In this environment, the
  2644. relevant section of the resource file should look like this:
  2645. <pre>Ghostscript.regularFonts: \
  2646. AvantGarde-Book: -itc-avantgarde-book-r-normal-- \n\
  2647. AvantGarde-BookOblique: -itc-avantgarde-book-o-normal-- \n\
  2648. AvantGarde-Demi: -itc-avantgarde-demi-r-normal-- \n\
  2649. AvantGarde-DemiOblique: -itc-avantgarde-demi-o-normal-- \n\
  2650. Bembo: -monotype-bembo-medium-r-normal-- \n\
  2651. Bembo-Bold: -monotype-bembo-bold-r-normal-- \n\
  2652. Bembo-BoldItalic: -monotype-bembo-bold-i-normal-- \n\
  2653. Bembo-Italic: -monotype-bembo-medium-i-normal-- \n\
  2654. Bookman-Demi: -itc-bookman-demi-r-normal-- \n\
  2655. Bookman-DemiItalic: -itc-bookman-demi-i-normal-- \n\
  2656. Bookman-Light: -itc-bookman-light-r-normal-- \n\
  2657. Bookman-LightItalic: -itc-bookman-light-i-normal-- \n\
  2658. Courier: -itc-courier-medium-r-normal-- \n\
  2659. Courier-Bold: -itc-courier-bold-r-normal-- \n\
  2660. Courier-BoldOblique: -itc-courier-bold-o-normal-- \n\
  2661. Courier-Oblique: -itc-courier-medium-o-normal-- \n\
  2662. GillSans: -monotype-gill-medium-r-normal-sans- \n\
  2663. GillSans-Bold: -monotype-gill-bold-r-normal-sans- \n\
  2664. GillSans-BoldItalic: -monotype-gill-bold-i-normal-sans- \n\
  2665. GillSans-Italic: -monotype-gill-normal-i-normal-sans- \n\
  2666. Helvetica: -linotype-helvetica-medium-r-normal-- \n\
  2667. Helvetica-Bold: -linotype-helvetica-bold-r-normal-- \n\
  2668. Helvetica-BoldOblique: -linotype-helvetica-bold-o-normal-- \n\
  2669. Helvetica-Narrow: -linotype-helvetica-medium-r-narrow-- \n\
  2670. Helvetica-Narrow-Bold: -linotype-helvetica-bold-r-narrow-- \n\
  2671. Helvetica-Narrow-BoldOblique: -linotype-helvetica-bold-o-narrow-- \n\
  2672. Helvetica-Narrow-Oblique: -linotype-helvetica-medium-o-narrow-- \n\
  2673. Helvetica-Oblique: -linotype-helvetica-medium-o-normal-- \n\
  2674. LucidaBright: -b&amp;h-lucidabright-medium-r-normal-- \n\
  2675. LucidaBright-Demi: -b&amp;h-lucidabright-demibold-r-normal-- \n\
  2676. LucidaBright-DemiItalic: -b&amp;h-lucidabright-demibold-i-normal-- \n\
  2677. LucidaBright-Italic: -b&amp;h-lucidabright-medium-i-normal-- \n\
  2678. LucidaSans: -b&amp;h-lucida-medium-r-normal-sans- \n\
  2679. LucidaSans-Bold: -b&amp;h-lucida-bold-r-normal-sans- \n\
  2680. LucidaSans-BoldItalic: -b&amp;h-lucida-bold-i-normal-sans- \n\
  2681. LucidaSans-Italic: -b&amp;h-lucida-medium-i-normal-sans- \n\
  2682. LucidaSans-Typewriter: -b&amp;h-lucidatypewriter-medium-r-normal-sans- \n\
  2683. LucidaSans-TypewriterBold: -b&amp;h-lucidatypewriter-bold-r-normal-sans- \n\
  2684. NewCenturySchlbk-BoldItalic: -linotype-new century schoolbook-bold-i-normal-- \n\
  2685. NewCenturySchlbk-Bold: -linotype-new century schoolbook-bold-r-normal-- \n\
  2686. NewCenturySchlbk-Italic: -linotype-new century schoolbook-medium-i-normal-- \n\
  2687. NewCenturySchlbk-Roman: -linotype-new century schoolbook-medium-r-normal-- \n\
  2688. Palatino-Bold: -linotype-palatino-bold-r-normal-- \n\
  2689. Palatino-BoldItalic: -linotype-palatino-bold-i-normal-- \n\
  2690. Palatino-Italic: -linotype-palatino-medium-i-normal-- \n\
  2691. Palatino-Roman: -linotype-palatino-medium-r-normal-- \n\
  2692. Rockwell: -monotype-rockwell-medium-r-normal-- \n\
  2693. Rockwell-Bold: -monotype-rockwell-bold-r-normal-- \n\
  2694. Rockwell-BoldItalic: -monotype-rockwell-bold-i-normal-- \n\
  2695. Rockwell-Italic: -monotype-rockwell-medium-i-normal-- \n\
  2696. Times-Bold: -linotype-times-bold-r-normal-- \n\
  2697. Times-BoldItalic: -linotype-times-bold-i-normal-- \n\
  2698. Times-Italic: -linotype-times-medium-i-normal-- \n\
  2699. Times-Roman: -linotype-times-medium-r-normal-- \n\
  2700. Utopia-Bold: -adobe-utopia-bold-r-normal-- \n\
  2701. Utopia-BoldItalic: -adobe-utopia-bold-i-normal-- \n\
  2702. Utopia-Italic: -adobe-utopia-regular-i-normal-- \n\
  2703. Utopia-Regular: -adobe-utopia-regular-r-normal-- \n\
  2704. ZapfChancery-MediumItalic: -itc-zapfchancery-medium-i-normal-- \n
  2705. Ghostscript.dingbatFonts: \
  2706. ZapfDingbats: -itc-zapfdingbats-medium-r-normal--
  2707. Ghostscript.symbolFonts: \
  2708. Symbol: --symbol-medium-r-normal--
  2709. </pre>
  2710. <h2><a name="FAPI_run"></a>Running Ghostscript with 3d party font renderers</h2>
  2711. <p>
  2712. Font API (FAPI) is a new feature which allows to attach 3d party font renderers to Ghostscript.
  2713. This section explains how to run Ghostscript with 3d party font renderers,
  2714. such as Agfa UFST or Free Type.
  2715. <p>
  2716. <em>Note: To run Ghostscript with Agfa UFST you need a license from Agfa.
  2717. Please ignore issues about UFST if you haven't got it.
  2718. </em>
  2719. <p>
  2720. <em>
  2721. Important note: Third-party font renderers are incompatible
  2722. with devices that can embed fonts in their output (such as pdfwrite),
  2723. because such renderers store fonts in a form from which Ghostscript cannot
  2724. get the necessary information for embedding. Ghostscript disables such
  2725. renderers when such device is being used. In particular, UFST and Free Type are
  2726. disabled while running Ghostscript with the <b><tt>pdfwrite</tt></b>
  2727. device.
  2728. </em>
  2729. <p>
  2730. To run Ghostscript with Free Type, you first need to build Ghostscript
  2731. with the Free Type bridge. Refer <a href="Make.htm#FT_build">How to build Ghostscript with Free Type</a>.
  2732. <p>
  2733. To run Ghostscript with UFST, you first need to build Ghostscript
  2734. with the UFST bridge. Refer <a href="Make.htm#UFST_build">How to build Ghostscript with UFST</a>.
  2735. Both bridges may run together.
  2736. <p>
  2737. <p>
  2738. Then you need to obtain the Decoding resources from Artifex Software Inc. and install them with Ghostscript.
  2739. Just copy the files to the <b><tt>Resource/Decoding</tt></b> directory (or to the subdirectory
  2740. <b><tt>Decoding</tt></b> of a directory, which is specified in <b><tt>GenericResourcePath</tt></b>).
  2741. <p>
  2742. There are 2 ways to handle fonts with a 3d party font renderer (FAPI). First, you can substitute
  2743. any FAPI-handled font to a PostScript font, using special map files.
  2744. Second, you can redirect PostScript fonts to FAPI, setting
  2745. entries in <b><tt>lib/FAPIconfig</tt></b> file.
  2746. <p>
  2747. The file <b><tt>lib/FAPIfontmap</tt></b> defines a map table for FAPI-handled fonts.
  2748. The format of <b><tt>lib/FAPIfontmap</tt></b> is explained below.
  2749. <p>
  2750. Font files being handled with FAPI may reside in any directory in your hard disk.
  2751. Paths to them to be specified in <b><tt>lib/FAPIfontmap</tt></b>. The path may be either
  2752. absolute or relative. Relative ones are being resolved from the path,
  2753. which is specified in <b><tt>lib/FAPIconfig</tt></b> file.
  2754. <p>
  2755. The file <b><tt>lib/FAPIfontmap</tt></b> is actually special PostScript code.
  2756. It contains records for each font being rendered with FAPI.
  2757. Records must end with semicolon. Each record is a pair.
  2758. The first element of the pair is the font name (the name that PostScript
  2759. documents use to access the font, which may differ
  2760. from real name of the font which the font file defines).
  2761. The second element is a dictionary with entries :
  2762. <table cellpadding=0 cellspacing=10>
  2763. <tr> <th>Key
  2764. <th>Type
  2765. <th>Description
  2766. <tr> <td>Path
  2767. <td>string
  2768. <td>Absolute path to font file, or relative path to font file from the FontPath value,
  2769. being specified in <b><tt>lib/FAPIconfig</tt></b>.
  2770. <tr> <td>FontType
  2771. <td>interger
  2772. <td>PostScript type for this font. Only 1 and 42 are currently allowed.
  2773. Note that this is unrelated to the real type of the font file -
  2774. the bridge will perform a format conversion.
  2775. <tr> <td>FAPI
  2776. <td>name
  2777. <td>Name of the renderer to be used with the font.
  2778. Only <b><tt>/AgfaUFST</tt></b> and <b><tt>/FreeType</tt></b> are now allowed.
  2779. <tr> <td>SubfontId
  2780. <td>integer
  2781. <td>(optional) Index of the font in font collection, such as FCO or TTC.
  2782. It is being ignored if Path doesn't specify a collection.
  2783. Note that Free Type can't handle FCO.
  2784. Default value is 0.
  2785. <tr> <td>Decoding
  2786. <td>name
  2787. <td>(optional) The name of a Decoding resource to be used with the font.
  2788. If specified, <b><tt>lib/xlatmap</tt></b> (see below) doesn't work for this font.
  2789. </table>
  2790. <p>
  2791. Example of FAPI font map record :
  2792. <blockquote>
  2793. <b><tt>
  2794. /FCO1 &lt&lt /Path (/AFPL/Agfa/fontdata/MTFONTS/PCLPS3/MT1/PCLP3__F.fco) /FontType 1 /FAPI /AgfaUFST &gt&gt ;
  2795. </tt></b>
  2796. </blockquote>
  2797. <p>
  2798. Note that <b><tt>lib/FAPIfontmap</tt></b> specifies only instances of
  2799. Font category. CID fonts to be listed in another map file.
  2800. <p>
  2801. The file <b><tt>lib/FAPIcidfmap</tt></b> defines a mapping table for
  2802. CIDFont resources. It contains records for each CID font being rendered with FAPI.
  2803. The format is similar to <b><tt>lib/FAPIfontmap</tt></b>,
  2804. but dictionaries must contain few different entries :
  2805. <table cellpadding=0 cellspacing=10>
  2806. <tr> <th>Key
  2807. <th>Type
  2808. <th>Description
  2809. <tr> <td>Path
  2810. <td>string
  2811. <td>Absolute path to font file, or relative path to font file from the CIDFontPath value,
  2812. being specified in <b><tt>lib/FAPIconfig</tt></b>.
  2813. <tr> <td>CIDFontType
  2814. <td>interger
  2815. <td>PostScript type for this CID font. Only 0, 1 and 2 are currently allowed.
  2816. Note that this is unrelated to the real type of the font file -
  2817. the bridge will perform format conversion.
  2818. <tr> <td>FAPI
  2819. <td>name
  2820. <td>Name of the renderer to be used with the font.
  2821. Only <b><tt>/AgfaUFST</tt></b> and <b><tt>/FreeType</tt></b> are now allowed.
  2822. <tr> <td>SubfontId
  2823. <td>integer
  2824. <td>(optional) Index of the font in font collection, such as FCO or TTC.
  2825. It is being ignored if Path doesn't specify a collection.
  2826. Default value is 0.
  2827. <tr> <td>CSI
  2828. <td>array of 2 elements
  2829. <td>(required) Information for building <b><tt>CIDSystemInfo</tt></b>.
  2830. The first element is a string, which specifies <b><tt>Ordering</tt></b>.
  2831. The second element is a number, which specifies <b><tt>Supplement</tt></b>.
  2832. </table>
  2833. <p>
  2834. Example of FAPI CID font map record :
  2835. <blockquote>
  2836. <b><tt>
  2837. /HeiseiKakuGo-W5 &lt&lt /Path (/WIN2000/Fonts/PMINGLIU.TTF) /CIDFontType 0 /FAPI /AgfaUFST /CSI [(Japan1) 2] &gt&gt ;
  2838. </tt></b>
  2839. </blockquote>
  2840. <p>
  2841. The control file <b><tt>lib/FAPIconfig</tt></b> defines 4 entries :
  2842. <table cellpadding=0 cellspacing=10>
  2843. <tr> <th>Key
  2844. <th>Type
  2845. <th>Description
  2846. <tr> <td>FontPath
  2847. <td>string
  2848. <td>Absolute path to a directory, which contains fonts. Used to resolve
  2849. relative paths in <b><tt>lib/FAPIfontmap</tt></b>.
  2850. <tr> <td>CIDFontPath
  2851. <td>string
  2852. <td>Absolute path to a directory, which contains fonts to substitute to CID fonts.
  2853. Used to resolve relative paths in <b><tt>lib/FAPIcidfmap</tt></b>.
  2854. It may be same or different than FontPath.
  2855. <tr> <td>HookDiskFonts
  2856. <td>array of integers.
  2857. <td>List of PS font types to be handled with FAPI.
  2858. This controls other fonts that ones listed in <b><tt>lib/FAPIfontmap</tt></b>
  2859. and <b><tt>lib/FAPIcidfmap</tt></b> - such ones are PS fonts installed to
  2860. Ghostscript with <b><tt>lib/fontmap</tt></b> or with <b><tt>GS_FONTPATH</tt></b>,
  2861. or regular CID font resources. Unlisted font types will be
  2862. rendered with the native Ghostscript font renderer.
  2863. Only allowed values now are 1,9,11,42. Note that 9 and 11
  2864. correspond to CIDFontType 0 and 2.
  2865. <tr> <td>HookEmbeddedFonts
  2866. <td>array of integers.
  2867. <td>List of PS font types to be handled with FAPI.
  2868. This controls fonts being embedded into a document -
  2869. either fonts or CID font resources. Unlisted font types will be
  2870. rendered with the native Ghostscript font renderer.
  2871. Only allowed values now are 1,9,11,42. Note that 9 and 11
  2872. correspond to CIDFontType 0 and 2.
  2873. </table>
  2874. <p>
  2875. You may need to customize the file <b><tt>lib/xlatmap</tt></b>. Follow instructions in it.
  2876. <p>
  2877. Note that UFST and Free Type cannot handle some Ghostscript fonts because
  2878. they does not include a PostScript interpreter and therefore has stronger restrictions on
  2879. font formats than Ghostscript itself does.
  2880. If their font types are listed in HookDiskFonts or in HookEmbeddedFonts,
  2881. Ghostscript interpret them as PS files, then serializes font data into a RAM buffer and
  2882. passes it to FAPI as PCLEOs.
  2883. <p>
  2884. <!-- [2.0 end contents] ==================================================== -->
  2885. <!-- [3.0 begin visible trailer] =========================================== -->
  2886. <hr>
  2887. <p>
  2888. <small>Copyright &copy; 1996-2002 artofcode LLC. All rights reserved.</small>
  2889. <p>
  2890. This software is provided AS-IS with no warranty, either express or
  2891. implied.
  2892. This software is distributed under license and may not be copied,
  2893. modified or distributed except as expressly authorized under the terms
  2894. of the license contained in the file LICENSE in this distribution.
  2895. For more information about licensing, please refer to
  2896. http://www.ghostscript.com/licensing/. For information on
  2897. commercial licensing, go to http://www.artifex.com/licensing/ or
  2898. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  2899. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  2900. <p>
  2901. <small>Ghostscript version 8.53, 20 October 2005
  2902. <!-- [3.0 end visible trailer] ============================================= -->
  2903. </small></h3></body>
  2904. </html>