13ff48bf5SDavid du Colombier<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 23ff48bf5SDavid du Colombier"http://www.w3.org/TR/html4/loose.dtd"> 37dd7cddfSDavid du Colombier<html> 47dd7cddfSDavid du Colombier<head> 53ff48bf5SDavid du Colombier<title>Ghostscript and the PostScript language</title> 6*593dc095SDavid du Colombier<!-- $Id: Language.htm,v 1.98 2005/10/20 19:46:23 ray Exp $ --> 77dd7cddfSDavid du Colombier<!-- Originally: language.txt --> 83ff48bf5SDavid du Colombier<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style"> 97dd7cddfSDavid du Colombier</head> 107dd7cddfSDavid du Colombier 117dd7cddfSDavid du Colombier<body> 127dd7cddfSDavid du Colombier<!-- [1.0 begin visible header] ============================================ --> 137dd7cddfSDavid du Colombier 147dd7cddfSDavid du Colombier<!-- [1.1 begin headline] ================================================== --> 157dd7cddfSDavid du Colombier 163ff48bf5SDavid du Colombier<h1>Ghostscript and the PostScript language</h1> 177dd7cddfSDavid du Colombier 187dd7cddfSDavid du Colombier<!-- [1.1 end headline] ==================================================== --> 197dd7cddfSDavid du Colombier 207dd7cddfSDavid du Colombier<!-- [1.2 begin table of contents] ========================================= --> 217dd7cddfSDavid du Colombier 227dd7cddfSDavid du Colombier<h2>Table of contents</h2> 237dd7cddfSDavid du Colombier 247dd7cddfSDavid du Colombier<blockquote><ul> 257dd7cddfSDavid du Colombier<li><a href="#Capabilities">Ghostscript's capabilities in relation to PostScript</a> 267dd7cddfSDavid du Colombier<li><a href="#Implementation_limits">Implementation limits</a> 277dd7cddfSDavid du Colombier<ul> 287dd7cddfSDavid du Colombier<li><a href="#Architectural_limits">Architectural limits</a> 297dd7cddfSDavid du Colombier<li><a href="#Typical_memory_limits">Typical memory limits in LanguageLevel 1</a> 307dd7cddfSDavid du Colombier<li><a href="#VM_consumption">Other differences in VM consumption</a> 317dd7cddfSDavid du Colombier</ul> 327dd7cddfSDavid du Colombier<li><a href="#Additional_operators">Additional operators in Ghostscript</a> 337dd7cddfSDavid du Colombier<ul> 347dd7cddfSDavid du Colombier<li><a href="#Graphics_and_text">Graphics and text operators</a> 357dd7cddfSDavid du Colombier<ul> 363ff48bf5SDavid du Colombier<li><a href="#Transparency">Transparency</a> 373ff48bf5SDavid du Colombier<ul> 383ff48bf5SDavid du Colombier<li><a href="#Transparency_graphics_state_operators">Graphics state operators</a> 393ff48bf5SDavid du Colombier<li><a href="#Transparency_rendering_stack_operators">Rendering stack operators</a> 403ff48bf5SDavid du Colombier<li><a href="#Transparency_ImageType">New ImageType</a> 413ff48bf5SDavid du Colombier</ul> 423ff48bf5SDavid du Colombier<li><a href="#Graphics_state">Other graphics state operators</a> 437dd7cddfSDavid du Colombier<li><a href="#Path">Path operators</a> 447dd7cddfSDavid du Colombier<li><a href="#Painting">Painting operators</a> 457dd7cddfSDavid du Colombier<li><a href="#Character">Character operators</a> 467dd7cddfSDavid du Colombier</ul> 477dd7cddfSDavid du Colombier<li><a href="#Other">Other operators</a> 487dd7cddfSDavid du Colombier<ul> 497dd7cddfSDavid du Colombier<li><a href="#Mathematical">Mathematical operators</a> 503ff48bf5SDavid du Colombier<li><a href="#Dictionary">Dictionary operators</a> 513ff48bf5SDavid du Colombier<li><a href="#String">String and name operators</a> 527dd7cddfSDavid du Colombier<li><a href="#Relational">Relational operators</a> 537dd7cddfSDavid du Colombier<li><a href="#File">File operators</a> 547dd7cddfSDavid du Colombier<li><a href="#Virtual_memory">Virtual memory operators</a> 557dd7cddfSDavid du Colombier<li><a href="#Miscellaneous">Miscellaneous operators</a> 567dd7cddfSDavid du Colombier<li><a href="#Device">Device operators</a> 577dd7cddfSDavid du Colombier</ul> 587dd7cddfSDavid du Colombier</ul> 593ff48bf5SDavid du Colombier<li><a href="#Filters">Filters</a> 603ff48bf5SDavid du Colombier<ul> 613ff48bf5SDavid du Colombier<li><a href="#Standard_filters">Standard filters</a> 623ff48bf5SDavid du Colombier<li><a href="#Non_standard_filters">Non-standard filters</a> 633ff48bf5SDavid du Colombier<li><a href="#Unstable_filters">Unstable filters</a> 643ff48bf5SDavid du Colombier</ul> 657dd7cddfSDavid du Colombier<li><a href="#Device_parameters">Device parameters</a> 663ff48bf5SDavid du Colombier<li><a href="#User_parameters">User parameters</a> 677dd7cddfSDavid du Colombier<li><a href="#Miscellaneous_additions">Miscellaneous additions</a> 68*593dc095SDavid du Colombier<ul> 69*593dc095SDavid du Colombier<li><a href="#Extended_semantics_of_run">Extended semantics of 'run'</a> 70*593dc095SDavid du Colombier<li><a href="#DecodingResources">Decoding resources</a> 71*593dc095SDavid du Colombier<li><a href="#CIDDecodingResources">CIDDecoding resources</a> 72*593dc095SDavid du Colombier<li><a href="#GlyphNames2Unicode">GlyphNames2Unicode</a> 73*593dc095SDavid du Colombier<li><a href="#MultipleResourceDirectories">Multiple Resource directories</a> 74*593dc095SDavid du Colombier</ul> 757dd7cddfSDavid du Colombier</ul></blockquote> 767dd7cddfSDavid du Colombier 777dd7cddfSDavid du Colombier<!-- [1.2 end table of contents] =========================================== --> 787dd7cddfSDavid du Colombier 797dd7cddfSDavid du Colombier<!-- [1.3 begin hint] ====================================================== --> 807dd7cddfSDavid du Colombier 817dd7cddfSDavid du Colombier<p>For other information, see the <a href="Readme.htm">Ghostscript 827dd7cddfSDavid du Colombieroverview</a>. 837dd7cddfSDavid du Colombier 847dd7cddfSDavid du Colombier<!-- [1.3 end hint] ======================================================== --> 857dd7cddfSDavid du Colombier 867dd7cddfSDavid du Colombier<hr> 877dd7cddfSDavid du Colombier 887dd7cddfSDavid du Colombier<!-- [1.0 end visible header] ============================================== --> 897dd7cddfSDavid du Colombier 907dd7cddfSDavid du Colombier<!-- [2.0 begin contents] ================================================== --> 917dd7cddfSDavid du Colombier 923ff48bf5SDavid du Colombier<h2><a name="Capabilities"></a>Ghostscript's capabilities in relation to PostScript</h2> 937dd7cddfSDavid du Colombier 947dd7cddfSDavid du Colombier<p> 957dd7cddfSDavid du ColombierThe Ghostscript interpreter, except as noted below, is intended to execute 967dd7cddfSDavid du Colombierproperly any source program written in the (LanguageLevel 3) 973ff48bf5SDavid du Colombier<b>PostScript</b> language as defined in the <cite>PostScript 983ff48bf5SDavid du ColombierLanguage Reference, Third Edition</cite> (ISBN 0-201-37922-8) published by 997dd7cddfSDavid du ColombierAddison-Wesley in mid-1999. However, the interpreter is configurable in 1007dd7cddfSDavid du Colombierways that can restrict it to various subsets of this language. 1017dd7cddfSDavid du ColombierSpecifically, the base interpreter accepts the Level 1 subset of the 1023ff48bf5SDavid du ColombierPostScript language, as defined in the first edition of the <cite>PostScript 1033ff48bf5SDavid du ColombierLanguage Reference Manual</cite> (ISBN 0-201-10174-2) Addison-Wesley 1985, 1047dd7cddfSDavid du Colombierplus the file system, version 25.0 language, and miscellaneous additions 1057dd7cddfSDavid du Colombierlisted in sections A.1.6, A.1.7, and A.1.8 of the Second Edition 1067dd7cddfSDavid du Colombierrespectively, including allowing a string operand for the 1077dd7cddfSDavid du Colombier"<b><tt>status</tt></b>" operator. The base interpreter may be configured 1087dd7cddfSDavid du Colombier(see the <a href="Make.htm">documentation on building Ghostscript</a> for 1097dd7cddfSDavid du Colombierhow to configure it) by adding any combination of the following: 1107dd7cddfSDavid du Colombier 1117dd7cddfSDavid du Colombier<ul> 1127dd7cddfSDavid du Colombier<li>The ability to process PostScript Type 1 fonts. This facility is 1137dd7cddfSDavid du Colombiernormally included in the interpreter. 1147dd7cddfSDavid du Colombier 1157dd7cddfSDavid du Colombier<li>The CMYK color extensions listed in section A.1.4 of the Second Edition 1167dd7cddfSDavid du Colombier(including <b><tt>colorimage</tt></b>). These facilities are available 1177dd7cddfSDavid du Colombieronly if the <b><tt>color</tt></b>, <b><tt>dps</tt></b>, or 1187dd7cddfSDavid du Colombier<b><tt>level2</tt></b> feature was selected when Ghostscript was built. 1197dd7cddfSDavid du Colombier 1207dd7cddfSDavid du Colombier<li>The Display PostScript extensions listed in section A.1.3 of the Second 1217dd7cddfSDavid du ColombierEdition, but excluding the operators listed in section A.1.2. These 1227dd7cddfSDavid du Colombierfacilities are available only if the <b><tt>dps</tt></b> feature or the 1237dd7cddfSDavid du Colombier<b><tt>level2</tt></b> feature was selected when Ghostscript was built. 1247dd7cddfSDavid du Colombier 1257dd7cddfSDavid du Colombier<li>The composite font extensions listed in section A.1.5 of the Second 1267dd7cddfSDavid du ColombierEdition, and the ability to handle Type 0 fonts. These facilities are 1277dd7cddfSDavid du Colombieravailable only if the <b><tt>compfont</tt></b> feature or the 1287dd7cddfSDavid du Colombier<b><tt>level2</tt></b> feature was selected when Ghostscript was built. 1297dd7cddfSDavid du Colombier 1307dd7cddfSDavid du Colombier<li>The ability to load TrueType fonts and to handle PostScript Type 42 1317dd7cddfSDavid du Colombier(encapsulated TrueType) fonts. These facilities are available only if the 1327dd7cddfSDavid du Colombier<b><tt>ttfont</tt></b> feature was selected when Ghostscript was built. 1337dd7cddfSDavid du Colombier 1347dd7cddfSDavid du Colombier<li>The PostScript Level 2 "filter" facilities except the 1357dd7cddfSDavid du Colombier<b><tt>DCTEncode</tt></b> and <b><tt>DCTDecode</tt></b> filters. These 1367dd7cddfSDavid du Colombierfacilities are available only if the <b><tt>filter</tt></b>, 1377dd7cddfSDavid du Colombier<b><tt>dps</tt></b>, or <b><tt>level2</tt></b> feature was selected when 1387dd7cddfSDavid du ColombierGhostscript was built. 1397dd7cddfSDavid du Colombier 1407dd7cddfSDavid du Colombier<li>The PostScript Level 2 <b><tt>DCTEncode</tt></b> and 1417dd7cddfSDavid du Colombier<b><tt>DCTDecode</tt></b> filters. These facilities are available only if 1427dd7cddfSDavid du Colombierthe <b><tt>dct</tt></b> or <b><tt>level2</tt></b> feature was selected when 1437dd7cddfSDavid du ColombierGhostscript was built. 1447dd7cddfSDavid du Colombier 1457dd7cddfSDavid du Colombier<li>All the other PostScript Level 2 operators and facilities listed in 1467dd7cddfSDavid du Colombiersection A.1.1 of the Second Edition and not listed in any of the other 1477dd7cddfSDavid du ColombierA.1.n sections. These facilities are available only if the 1487dd7cddfSDavid du Colombier<b><tt>level2</tt></b> feature was selected when Ghostscript was built. 1497dd7cddfSDavid du Colombier 1507dd7cddfSDavid du Colombier<li>All PostScript LanguageLevel 3 operators and facilities listed in the 1517dd7cddfSDavid du ColombierThird Edition, except as noted below. These facilities are available only 1527dd7cddfSDavid du Colombierif the <b><tt>psl3</tt></b> feature was selected when Ghostscript was built. 1537dd7cddfSDavid du Colombier 1547dd7cddfSDavid du Colombier<li>The ability to recognize DOS EPSF files and process only the PostScript 1557dd7cddfSDavid du Colombierpart, ignoring bitmap previews or other information. This facility is 1567dd7cddfSDavid du Colombieravailable only if the <b><tt>epsf</tt></b> feature was selected when 1577dd7cddfSDavid du ColombierGhostscript was built. 1587dd7cddfSDavid du Colombier</ul> 1597dd7cddfSDavid du Colombier 1607dd7cddfSDavid du Colombier<p> 1617dd7cddfSDavid du ColombierGhostscript currently does not implement the following PostScript 1627dd7cddfSDavid du ColombierLanguageLevel 3 facilities: 1637dd7cddfSDavid du Colombier 1647dd7cddfSDavid du Colombier<ul> 1657dd7cddfSDavid du Colombier<li>Native <b><tt>Separation</tt></b> and <b><tt>DeviceN</tt></b> color 1667dd7cddfSDavid du Colombierspaces -- the alternate space is always used. 1677dd7cddfSDavid du Colombier 1687dd7cddfSDavid du Colombier<li>Settable <b><tt>ProcessColorModel</tt></b> for page devices, except for 1697dd7cddfSDavid du Colombiera very few special devices. 1707dd7cddfSDavid du Colombier 1717dd7cddfSDavid du Colombier<li><b><tt>IODevice</tt></b>s other than <b><tt>%stdin</tt></b>, 1727dd7cddfSDavid du Colombier<b><tt>%stdout</tt></b>, <b><tt>%stderr</tt></b>, <b><tt>%lineedit</tt></b>, 1737dd7cddfSDavid du Colombier<b><tt>%statementedit</tt></b>, <b><tt>%os%</tt></b>, and (if configured) 174*593dc095SDavid du Colombier<b><tt>%pipe%</tt></b> and <b><tt>%disk0%</tt></b> through <b><tt>%disk0%</tt></b>. 1757dd7cddfSDavid du Colombier</ul> 1767dd7cddfSDavid du Colombier 1777dd7cddfSDavid du Colombier<p> 1787dd7cddfSDavid du ColombierGhostscript can also interpret files in the Portable Document Format (PDF) 1797dd7cddfSDavid du Colombier1.3 format defined in the <a 1807dd7cddfSDavid du Colombierhref="http://partners.adobe.com/asn/developer/PDFS/TN/PLRM.pdf"><em>Portable 1817dd7cddfSDavid du ColombierDocument Format Reference Manual</em> Version 1.3</a> of March 11, 1999, 1827dd7cddfSDavid du Colombierdistributed by <a href="http://www.adobe.com/">Adobe Systems 1837dd7cddfSDavid du ColombierIncorporated</a>, except as noted below. This facility is available only if 1847dd7cddfSDavid du Colombierthe <b><tt>pdf</tt></b> feature was selected when Ghostscript was built. 1857dd7cddfSDavid du Colombier 1867dd7cddfSDavid du Colombier<p> 1877dd7cddfSDavid du ColombierGhostscript currently does not implement the following PDF 1.3 facilities: 1887dd7cddfSDavid du Colombier 1897dd7cddfSDavid du Colombier<ul> 1907dd7cddfSDavid du Colombier<li>Native <b><tt>Separation</tt></b> and <b><tt>DeviceN</tt></b> color 1917dd7cddfSDavid du Colombierspaces, as noted above for PostScript. 1927dd7cddfSDavid du Colombier 1937dd7cddfSDavid du Colombier<li>Native <b><tt>ICCBased</tt></b> color spaces -- these too always use the 1947dd7cddfSDavid du Colombieralternate space. 1957dd7cddfSDavid du Colombier</ul> 1967dd7cddfSDavid du Colombier 1977dd7cddfSDavid du Colombier<p> 1987dd7cddfSDavid du ColombierGhostscript also includes a number of 1997dd7cddfSDavid du Colombier<a href="#Additional_operators">additional operators</a> defined below that 2007dd7cddfSDavid du Colombierare not in the PostScript language defined by Adobe. 2017dd7cddfSDavid du Colombier 2027dd7cddfSDavid du Colombier<hr> 2037dd7cddfSDavid du Colombier 2043ff48bf5SDavid du Colombier<h2><a name="Implementation_limits"></a>Implementation limits</h2> 2057dd7cddfSDavid du Colombier 2067dd7cddfSDavid du Colombier<p> 2077dd7cddfSDavid du ColombierThe implementation limits show here correspond to those in Tables B.1 and 2087dd7cddfSDavid du ColombierB.2 of the Second and Third Editions, which describe the quantities fully. 2097dd7cddfSDavid du ColombierWhere Ghostscript's limits are different from those of Adobe's 2107dd7cddfSDavid du Colombierimplementations (as shown in the Third Edition), Adobe's limits are also 2117dd7cddfSDavid du Colombiershown. 2127dd7cddfSDavid du Colombier 2133ff48bf5SDavid du Colombier<h3><a name="Architectural_limits"></a>Architectural limits</h3> 2147dd7cddfSDavid du Colombier 2157dd7cddfSDavid du Colombier<blockquote><table cellpadding=0 cellspacing=0> 2167dd7cddfSDavid du Colombier<tr><th colspan=7 bgcolor="#CCCC00"><hr><font size="+1">Architectural limits (corresponds to Adobe table B.1)</font><hr> 2177dd7cddfSDavid du Colombier<tr valign=bottom> 2187dd7cddfSDavid du Colombier <th align=left>Quantity 2197dd7cddfSDavid du Colombier <td> 2207dd7cddfSDavid du Colombier <th align=left>Limit 2217dd7cddfSDavid du Colombier <td> 2227dd7cddfSDavid du Colombier <th align=left>Type 2237dd7cddfSDavid du Colombier <td> 2247dd7cddfSDavid du Colombier <th align=left>Adobe 2257dd7cddfSDavid du Colombier<tr> <td colspan=7><hr> 2267dd7cddfSDavid du Colombier<tr valign=top> <td>integer 2277dd7cddfSDavid du Colombier <td> 2287dd7cddfSDavid du Colombier <td>32-bit 2297dd7cddfSDavid du Colombier <td> 2307dd7cddfSDavid du Colombier <td>twos complement integer 2317dd7cddfSDavid du Colombier <td> 2327dd7cddfSDavid du Colombier <td> 2337dd7cddfSDavid du Colombier<tr valign=top> <td>real 2347dd7cddfSDavid du Colombier <td> 2357dd7cddfSDavid du Colombier <td>single-precision 2367dd7cddfSDavid du Colombier <td> 2377dd7cddfSDavid du Colombier <td>IEEE float 2387dd7cddfSDavid du Colombier <td> 2397dd7cddfSDavid du Colombier <td> 2407dd7cddfSDavid du Colombier<tr valign=top> <td>array 2417dd7cddfSDavid du Colombier <td> 2427dd7cddfSDavid du Colombier <td>65535 2437dd7cddfSDavid du Colombier <td> 2447dd7cddfSDavid du Colombier <td>elements 2457dd7cddfSDavid du Colombier <td> 2467dd7cddfSDavid du Colombier <td> 2477dd7cddfSDavid du Colombier<tr valign=top> <td>dictionary 2487dd7cddfSDavid du Colombier <td> 2497dd7cddfSDavid du Colombier <td>65534 2507dd7cddfSDavid du Colombier <td> 2517dd7cddfSDavid du Colombier <td>elements 2527dd7cddfSDavid du Colombier <td> 2537dd7cddfSDavid du Colombier <td>65535 2547dd7cddfSDavid du Colombier<tr valign=top> <td>string 2557dd7cddfSDavid du Colombier <td> 2567dd7cddfSDavid du Colombier <td>65535 2577dd7cddfSDavid du Colombier <td> 2587dd7cddfSDavid du Colombier <td>characters 2597dd7cddfSDavid du Colombier <td> 2607dd7cddfSDavid du Colombier <td> 2617dd7cddfSDavid du Colombier<tr valign=top> <td>name 2627dd7cddfSDavid du Colombier <td> 2637dd7cddfSDavid du Colombier <td>16383 2647dd7cddfSDavid du Colombier <td> 2657dd7cddfSDavid du Colombier <td>characters 2667dd7cddfSDavid du Colombier <td> 2677dd7cddfSDavid du Colombier <td>127 2687dd7cddfSDavid du Colombier<tr valign=top> <td>filename 2697dd7cddfSDavid du Colombier <td> 2703ff48bf5SDavid du Colombier <td>128* 2717dd7cddfSDavid du Colombier <td> 2727dd7cddfSDavid du Colombier <td>characters 2737dd7cddfSDavid du Colombier <td> 2747dd7cddfSDavid du Colombier <td> 2757dd7cddfSDavid du Colombier<tr valign=top> <td><b><tt>save</tt></b> level 2767dd7cddfSDavid du Colombier <td> 2777dd7cddfSDavid du Colombier <td>none 2787dd7cddfSDavid du Colombier <td> 2797dd7cddfSDavid du Colombier <td>(capacity of memory) 2807dd7cddfSDavid du Colombier <td> 2817dd7cddfSDavid du Colombier <td>15 2827dd7cddfSDavid du Colombier<tr valign=top> <td><b><tt>gsave</tt></b> level 2837dd7cddfSDavid du Colombier <td> 2847dd7cddfSDavid du Colombier <td>none 2857dd7cddfSDavid du Colombier <td> 2867dd7cddfSDavid du Colombier <td>(capacity of memory) 2877dd7cddfSDavid du Colombier <td> 2887dd7cddfSDavid du Colombier <td>13 2897dd7cddfSDavid du Colombier</table></blockquote> 2907dd7cddfSDavid du Colombier 2913ff48bf5SDavid du Colombier<p> 2923ff48bf5SDavid du Colombier* The limit on the length of a file name is 128 characters if the name 2933ff48bf5SDavid du Colombierstarts with a %...% IODevice designation, or 124 characters if it does not. 2943ff48bf5SDavid du Colombier 2953ff48bf5SDavid du Colombier<h3><a name="Typical_memory_limits"></a>Typical memory limits in LanguageLevel 1</h3> 2967dd7cddfSDavid du Colombier 2977dd7cddfSDavid du Colombier<blockquote><table cellpadding=0 cellspacing=0> 2987dd7cddfSDavid du Colombier 2997dd7cddfSDavid du Colombier<tr><th colspan=7 bgcolor="#CCCC00"><hr><font size="+1">Memory limits (corresponds to Adobe table B.2)</font><hr> 3007dd7cddfSDavid du Colombier<tr valign=bottom> 3017dd7cddfSDavid du Colombier <th align=left>Quantity 3027dd7cddfSDavid du Colombier <td> 3037dd7cddfSDavid du Colombier <th align=left>Limit 3047dd7cddfSDavid du Colombier <td> 3057dd7cddfSDavid du Colombier <th align=left>Type 3067dd7cddfSDavid du Colombier <td> 3077dd7cddfSDavid du Colombier <th align=left>Adobe 3087dd7cddfSDavid du Colombier<tr> <td colspan=7><hr> 3097dd7cddfSDavid du Colombier<tr valign=top> <td><b><tt>userdict</tt></b> 3107dd7cddfSDavid du Colombier <td> 3117dd7cddfSDavid du Colombier <td>200 3127dd7cddfSDavid du Colombier <td> 3137dd7cddfSDavid du Colombier <td> 3147dd7cddfSDavid du Colombier <td> 3157dd7cddfSDavid du Colombier <td> 3167dd7cddfSDavid du Colombier<tr valign=top> <td><b><tt>FontDirectory</tt></b> 3177dd7cddfSDavid du Colombier <td> 3187dd7cddfSDavid du Colombier <td>100 3197dd7cddfSDavid du Colombier <td> 3207dd7cddfSDavid du Colombier <td> 3217dd7cddfSDavid du Colombier <td> 3227dd7cddfSDavid du Colombier <td> 3237dd7cddfSDavid du Colombier<tr valign=top> <td>operand stack 3247dd7cddfSDavid du Colombier <td> 3257dd7cddfSDavid du Colombier <td>800 3267dd7cddfSDavid du Colombier <td> 3277dd7cddfSDavid du Colombier <td> 3287dd7cddfSDavid du Colombier <td> 3297dd7cddfSDavid du Colombier <td>500 3307dd7cddfSDavid du Colombier<tr valign=top> <td>dictionary stack 3317dd7cddfSDavid du Colombier <td> 3327dd7cddfSDavid du Colombier <td>20 3337dd7cddfSDavid du Colombier <td> 3347dd7cddfSDavid du Colombier <td> 3357dd7cddfSDavid du Colombier<tr valign=top> <td>execution stack 3367dd7cddfSDavid du Colombier <td> 3377dd7cddfSDavid du Colombier <td>250 3387dd7cddfSDavid du Colombier <td> 3397dd7cddfSDavid du Colombier <td> 3407dd7cddfSDavid du Colombier<tr valign=top> <td>interpreter level 3417dd7cddfSDavid du Colombier <td> 3427dd7cddfSDavid du Colombier <td>none 3437dd7cddfSDavid du Colombier <td> 3447dd7cddfSDavid du Colombier <td>(capacity of memory) 3457dd7cddfSDavid du Colombier <td> 3467dd7cddfSDavid du Colombier <td>10 3477dd7cddfSDavid du Colombier<tr valign=top> <td>path 3487dd7cddfSDavid du Colombier <td> 3497dd7cddfSDavid du Colombier <td>none 3507dd7cddfSDavid du Colombier <td> 3517dd7cddfSDavid du Colombier <td>(capacity of memory) 3527dd7cddfSDavid du Colombier <td> 3537dd7cddfSDavid du Colombier <td>1500 3547dd7cddfSDavid du Colombier<tr valign=top> <td>dash 3557dd7cddfSDavid du Colombier <td> 3567dd7cddfSDavid du Colombier <td>11 3577dd7cddfSDavid du Colombier <td> 3587dd7cddfSDavid du Colombier <td> 3597dd7cddfSDavid du Colombier<tr valign=top> <td>VM 3607dd7cddfSDavid du Colombier <td> 3617dd7cddfSDavid du Colombier <td>none 3627dd7cddfSDavid du Colombier <td> 3637dd7cddfSDavid du Colombier <td>(capacity of memory) 3647dd7cddfSDavid du Colombier <td> 3657dd7cddfSDavid du Colombier <td>240000 3667dd7cddfSDavid du Colombier<tr valign=top> <td>file 3677dd7cddfSDavid du Colombier <td> 3687dd7cddfSDavid du Colombier <td>none 3697dd7cddfSDavid du Colombier <td> 3707dd7cddfSDavid du Colombier <td>(determined by operating system) 3717dd7cddfSDavid du Colombier <td> 3727dd7cddfSDavid du Colombier <td>6 3737dd7cddfSDavid du Colombier<tr valign=top> <td>image 3747dd7cddfSDavid du Colombier <td> 3757dd7cddfSDavid du Colombier <td>65535 3767dd7cddfSDavid du Colombier <td> 377*593dc095SDavid du Colombier <td>values (samples × components)<br>for1-, 2-, 4-, or 8-bit samples 3787dd7cddfSDavid du Colombier <td> 3797dd7cddfSDavid du Colombier <td>3300 3807dd7cddfSDavid du Colombier<tr valign=top> <td> 3817dd7cddfSDavid du Colombier <td> 3827dd7cddfSDavid du Colombier <td>32767 3837dd7cddfSDavid du Colombier <td> 3847dd7cddfSDavid du Colombier <td>values for 12-bit samples 3857dd7cddfSDavid du Colombier <td> 3867dd7cddfSDavid du Colombier <td>3300 3877dd7cddfSDavid du Colombier</table></blockquote> 3887dd7cddfSDavid du Colombier 3893ff48bf5SDavid du Colombier<h3><a name="VM_consumption"></a>Other differences in VM consumption</h3> 3907dd7cddfSDavid du Colombier 3917dd7cddfSDavid du Colombier<p> 3927dd7cddfSDavid du ColombierPacked array elements occupy either 2 bytes or 8 bytes. The average 3937dd7cddfSDavid du Colombierelement size is probably about 5 bytes. Names occupy 12 bytes plus the 3947dd7cddfSDavid du Colombierspace for the string. 395*593dc095SDavid du Colombier<p> 396*593dc095SDavid du ColombierThe garbage collector doesn't reclaim portions of arrays obtained with 397*593dc095SDavid du Colombier<tt>getinterval</tt>, rather it collects entire arrays. 3987dd7cddfSDavid du Colombier<hr> 3997dd7cddfSDavid du Colombier 4003ff48bf5SDavid du Colombier<h2><a name="Additional_operators"></a>Additional operators in Ghostscript</h2> 4017dd7cddfSDavid du Colombier 4023ff48bf5SDavid du Colombier<h3><a name="Graphics_and_text"></a>Graphics and text operators</h3> 4037dd7cddfSDavid du Colombier 4043ff48bf5SDavid du Colombier<h4><a name="Transparency"></a>Transparency</h4> 4053ff48bf5SDavid du Colombier 4063ff48bf5SDavid du Colombier<p> 4073ff48bf5SDavid du ColombierGhostscript provides a set of operators for implementing the transparency 4083ff48bf5SDavid du Colombierand compositing facilities of PDF 1.4. These are defined only if the 4093ff48bf5SDavid du Colombier<b><tt>transpar</tt></b> option was selected when Ghostscript was built. We 4103ff48bf5SDavid du Colombierdo not attempt to explain the underlying graphics model here: for details, 4113ff48bf5SDavid du Colombiersee <a 4123ff48bf5SDavid du Colombierhref="http://partners.adobe.com/asn/developer/technotes.html#acrobat-pdf" 4133ff48bf5SDavid du Colombierclass="offsite">Adobe 4143ff48bf5SDavid du ColombierTechnical Note</a> #5407, "<a 4153ff48bf5SDavid du Colombierhref="http://partners.adobe.com/asn/developer/acrosdk/DOCS/PDF_Transparency.pdf" 4163ff48bf5SDavid du Colombierclass="offsite">Transparency 4173ff48bf5SDavid du Colombierin PDF</a>". Note, however, that 4183ff48bf5SDavid du ColombierGhostscript's model generalizes that of PDF 1.4 in that Ghostscript 4193ff48bf5SDavid du Colombiermaintains separate alpha and mask values for opacity and shape, rather than 4203ff48bf5SDavid du Colombiera single value with a Boolean that says whether it represents opacity or 4213ff48bf5SDavid du Colombiershape. EVERYTHING IN THIS SECTION IS SUBJECT TO CHANGE. 4223ff48bf5SDavid du Colombier 4233ff48bf5SDavid du Colombier<h5><a name="Transparency_graphics_state_operators"></a>Graphics state 4243ff48bf5SDavid du Colombieroperators</h5> 4253ff48bf5SDavid du Colombier 4263ff48bf5SDavid du Colombier<dl> 4273ff48bf5SDavid du Colombier<dt><b><tt><modename> .setblendmode -</tt></b> 4283ff48bf5SDavid du Colombier<dd>Sets the blending mode in the graphics state. If the mode name is not 4293ff48bf5SDavid du Colombierrecognized, causes a <b><tt>rangecheck</tt></b> error. The initial value of 4303ff48bf5SDavid du Colombierthe blending mode is <b><tt>/Compatible</tt></b>. 4313ff48bf5SDavid du Colombier</dl> 4323ff48bf5SDavid du Colombier 4333ff48bf5SDavid du Colombier<dl> 4343ff48bf5SDavid du Colombier<dt><b><tt>- .currentblendmode <modename></tt></b> 4353ff48bf5SDavid du Colombier<dd>Returns the current blending mode. 4363ff48bf5SDavid du Colombier</dl> 4373ff48bf5SDavid du Colombier 4383ff48bf5SDavid du Colombier<dl> 4393ff48bf5SDavid du Colombier<dt><b><tt><0..1> .setopacityalpha -</tt></b> 4403ff48bf5SDavid du Colombier<dd>Sets the opacity alpha value in the graphics state. 4413ff48bf5SDavid du ColombierThe initial opacity alpha value is 1. 4423ff48bf5SDavid du Colombier</dl> 4433ff48bf5SDavid du Colombier 4443ff48bf5SDavid du Colombier<dl> 4453ff48bf5SDavid du Colombier<dt><b><tt>- .currentopacityalpha <0..1></tt></b> 4463ff48bf5SDavid du Colombier<dd>Returns the current opacity alpha value. 4473ff48bf5SDavid du Colombier</dl> 4483ff48bf5SDavid du Colombier 4493ff48bf5SDavid du Colombier<dl> 4503ff48bf5SDavid du Colombier<dt><b><tt><0..1> .setshapealpha -</tt></b> 4513ff48bf5SDavid du Colombier<dd>Sets the shape alpha value in the graphics state. 4523ff48bf5SDavid du ColombierThe initial shape alpha value is 1. 4533ff48bf5SDavid du Colombier</dl> 4543ff48bf5SDavid du Colombier 4553ff48bf5SDavid du Colombier<dl> 4563ff48bf5SDavid du Colombier<dt><b><tt>- .currentshapealpha <0..1></tt></b> 4573ff48bf5SDavid du Colombier<dd>Returns the current shape alpha value. 4583ff48bf5SDavid du Colombier</dl> 4593ff48bf5SDavid du Colombier 4603ff48bf5SDavid du Colombier<dl> 4613ff48bf5SDavid du Colombier<dt><b><tt><bool> .settextknockout -</tt></b> 4623ff48bf5SDavid du Colombier<dd>Sets the text knockout flag in the graphics state. 4633ff48bf5SDavid du ColombierThe initial value of the text knockout flag is <b><tt>true</tt></b>. 4643ff48bf5SDavid du Colombier</dl> 4653ff48bf5SDavid du Colombier 4663ff48bf5SDavid du Colombier<dl> 4673ff48bf5SDavid du Colombier<dt><b><tt>- .currenttextknockout <bool></tt></b> 4683ff48bf5SDavid du Colombier<dd>Returns the current text knockout flag. 4693ff48bf5SDavid du Colombier</dl> 4703ff48bf5SDavid du Colombier 4713ff48bf5SDavid du Colombier<h5><a name="Transparency_rendering_stack_operators"></a>Rendering stack 4723ff48bf5SDavid du Colombieroperators</h5> 4733ff48bf5SDavid du Colombier 4743ff48bf5SDavid du Colombier<p> 4753ff48bf5SDavid du ColombierThe interpreter state is extended to include a (per-context) rendering stack 4763ff48bf5SDavid du Colombierfor handling transparency groups and masks (generically, "layers"). Groups 4773ff48bf5SDavid du Colombieraccumulate a full value for each pixel (paint plus transparency); masks 4783ff48bf5SDavid du Colombieraccumulate only a coverage value. Layers must be properly nested, i.e., the 4793ff48bf5SDavid du Colombier'end' or 'discard' operator must match the corresponding 'begin' operator. 4803ff48bf5SDavid du Colombier 4813ff48bf5SDavid du Colombier<p> 4823ff48bf5SDavid du ColombierBeginning and ending layers must nest properly with respect to 4833ff48bf5SDavid du Colombier<b><tt>save</tt></b> and <b><tt>restore</tt></b>: <b><tt>save</tt></b> and 4843ff48bf5SDavid du Colombier<b><tt>restore</tt></b> do not save and restore the layer stack. Currently, 4853ff48bf5SDavid du Colombierlayers are not required to nest with respect to <b><tt>gsave</tt></b> and 4863ff48bf5SDavid du Colombier<b><tt>grestore</tt></b>, except that the device that is current in the 4873ff48bf5SDavid du Colombiergraphics state when ending a layer must be the same as the device that was 4883ff48bf5SDavid du Colombiercurrent when beginning the layer. THIS AREA IS SUBJECT TO CHANGE. 4893ff48bf5SDavid du Colombier 4903ff48bf5SDavid du Colombier<dl> 4913ff48bf5SDavid du Colombier<dt><b><tt><paramdict> <llx> <lly> <urx> <ury> 4923ff48bf5SDavid du Colombier.begintransparencygroup -</tt></b> 4933ff48bf5SDavid du Colombier<dd>Begins a new transparency group. The <b><tt>ll/ur</tt></b> coordinates 4943ff48bf5SDavid du Colombierare the bounding box of the group in the current user coordinate system. 4953ff48bf5SDavid du Colombier<b><tt>paramdict</tt></b> has the following keys: 4963ff48bf5SDavid du Colombier<dl> 4973ff48bf5SDavid du Colombier<dt><b><tt>/Isolated</tt></b> 4983ff48bf5SDavid du Colombier<dd>(optional) Boolean; default value = <b><tt>false</tt></b>. 4993ff48bf5SDavid du Colombier<dt><b><tt>/Knockout</tt></b> 5003ff48bf5SDavid du Colombier<dd>(optional) Boolean; default value = <b><tt>false</tt></b>. 5013ff48bf5SDavid du Colombier</dl> 5023ff48bf5SDavid du Colombier</dl> 5033ff48bf5SDavid du Colombier 5043ff48bf5SDavid du Colombier<dl> 5053ff48bf5SDavid du Colombier<dt><b><tt>- .discardtransparencygroup -</tt></b> 5063ff48bf5SDavid du Colombier<dd>Ends and discards the current transparency group. 5073ff48bf5SDavid du Colombier</dl> 5083ff48bf5SDavid du Colombier 5093ff48bf5SDavid du Colombier<dl> 5103ff48bf5SDavid du Colombier<dt><b><tt>- .endtransparencygroup -</tt></b> 5113ff48bf5SDavid du Colombier<dd>Ends the current transparency group, compositing the group being ended 5123ff48bf5SDavid du Colombieronto the group that now becomes current. 5133ff48bf5SDavid du Colombier</dl> 5143ff48bf5SDavid du Colombier 5153ff48bf5SDavid du Colombier<dl> 5163ff48bf5SDavid du Colombier<dt><b><tt><paramdict> <llx> <lly> <urx> <ury> 517*593dc095SDavid du Colombier.begintransparencymaskgroup -</tt></b> 518*593dc095SDavid du Colombier<dd>Begins a new transparency mask, which is represented as a group. 519*593dc095SDavid du ColombierThe <b><tt>ll/ur</tt></b> coordinates 5203ff48bf5SDavid du Colombierare the bounding box of the mask in the current user coordinate system. 5213ff48bf5SDavid du Colombier<b><tt>paramdict</tt></b> has the following keys: 5223ff48bf5SDavid du Colombier<dl> 5233ff48bf5SDavid du Colombier<dt><b><tt>/Subtype</tt></b> 5243ff48bf5SDavid du Colombier<dd>(required) Name, either <b><tt>/Alpha</tt></b> or 5253ff48bf5SDavid du Colombier<b><tt>/Luminosity</tt></b>. 5263ff48bf5SDavid du Colombier<dt><b><tt>/Background</tt></b> 5273ff48bf5SDavid du Colombier<dd>(optional) Array of number. 5283ff48bf5SDavid du Colombier<dt><b><tt>/TransferFunction</tt></b> 5293ff48bf5SDavid du Colombier<dd>(optional) Function object (produced by applying 5303ff48bf5SDavid du Colombier<b><tt>.buildfunction</tt></b> to a Function dictionary). 5313ff48bf5SDavid du Colombier</dl> 5323ff48bf5SDavid du Colombier</dl> 5333ff48bf5SDavid du Colombier 5343ff48bf5SDavid du Colombier<dl> 535*593dc095SDavid du Colombier<dt><b><tt>- .begintransparencymaskimage -</tt></b> 536*593dc095SDavid du Colombier<dd>Begins a new transparency mask, which is represented as a single image. 537*593dc095SDavid du Colombier</dl> 538*593dc095SDavid du Colombier</dl> 539*593dc095SDavid du Colombier 540*593dc095SDavid du Colombier<dl> 5413ff48bf5SDavid du Colombier<dt><b><tt>- .discardtransparencymask -</tt></b> 5423ff48bf5SDavid du Colombier<dd>Ends and discards the current transparency mask. 5433ff48bf5SDavid du Colombier</dl> 5443ff48bf5SDavid du Colombier 5453ff48bf5SDavid du Colombier<dl> 5463ff48bf5SDavid du Colombier<dt><b><tt><masknum> .endtransparencymask -</tt></b> 5473ff48bf5SDavid du Colombier<dd>Ends the current transparency mask, installing it as the current opacity 5483ff48bf5SDavid du Colombier(<b><tt>masknum</tt></b> = 0) or shape (<b><tt>masknum</tt></b> = 1) mask in 5493ff48bf5SDavid du Colombierthe graphics state. 5503ff48bf5SDavid du Colombier</dl> 5513ff48bf5SDavid du Colombier 5523ff48bf5SDavid du Colombier<dl> 5533ff48bf5SDavid du Colombier<dt><b><tt><masknum> .inittransparencymask -</tt></b> 5543ff48bf5SDavid du Colombier<dd>Resets the current opacity (<b><tt>masknum</tt></b> = 0) or shape 5553ff48bf5SDavid du Colombier(<b><tt>masknum</tt></b> = 1) mask to an infinite mask with alpha = 1 5563ff48bf5SDavid du Colombiereverywhere. 5573ff48bf5SDavid du Colombier</dl> 5583ff48bf5SDavid du Colombier 5593ff48bf5SDavid du Colombier<h5><a name="Transparency_ImageType"></a>New ImageType</h5> 5603ff48bf5SDavid du Colombier 5613ff48bf5SDavid du Colombier<p> 5623ff48bf5SDavid du ColombierThe transparency extension defines a new ImageType 103, similar to ImageType 5633ff48bf5SDavid du Colombier3 with the following differences: 5643ff48bf5SDavid du Colombier 5653ff48bf5SDavid du Colombier<ul> 5663ff48bf5SDavid du Colombier 5673ff48bf5SDavid du Colombier<li>The required <b><tt>MaskDict</tt></b> is replaced by two optional 5683ff48bf5SDavid du Colombierdictionaries, <b><tt>OpacityMaskDict</tt></b> and 5693ff48bf5SDavid du Colombier<b><tt>ShapeMaskDict</tt></b>. If present, these dictionaries must have a 5703ff48bf5SDavid du Colombier<b><tt>BitsPerComponent</tt></b> entry, whose value may be greater than 1. 5713ff48bf5SDavid du ColombierNote that in contrast to ImageType 3, where any non-zero chunky mask value 5723ff48bf5SDavid du Colombieris equivalent to 1, ImageType 103 simply takes the low-order bits of chunky 5733ff48bf5SDavid du Colombiermask values. 5743ff48bf5SDavid du Colombier 5753ff48bf5SDavid du Colombier<li>A <b><tt>Matte</tt></b> entry may be present in one or both mask 5763ff48bf5SDavid du Colombierdictionaries, indicating premultiplication of the data values. If both 5773ff48bf5SDavid du Colombier<b><tt>MaskDict</tt></b>s have a <b><tt>Matte</tt></b> entry and the values 5783ff48bf5SDavid du Colombierof the two <b><tt>Matte</tt></b> entries are different, a 5793ff48bf5SDavid du Colombier<b><tt>rangecheck</tt></b> error occurs. 5803ff48bf5SDavid du Colombier 5813ff48bf5SDavid du Colombier<li><b><tt>InterleaveType</tt></b> appears in the <b><tt>MaskDict</tt></b>s, 5823ff48bf5SDavid du Colombiernot the <b><tt>DataDict</tt></b>, because each mask has its own 5833ff48bf5SDavid du Colombier<b><tt>InterleaveType</tt></b>. <b><tt>InterleaveType</tt></b> 2 5843ff48bf5SDavid du Colombier(interlaced scan lines) is not supported. 5853ff48bf5SDavid du Colombier 5863ff48bf5SDavid du Colombier</ul> 5873ff48bf5SDavid du Colombier 5883ff48bf5SDavid du Colombier<h4><a name="Graphics_state"></a>Other graphics state operators</h4> 5897dd7cddfSDavid du Colombier 5907dd7cddfSDavid du Colombier<dl> 5917dd7cddfSDavid du Colombier<dt><b><tt><bool> .setaccuratecurves -</tt></b> 5927dd7cddfSDavid du Colombier<dd>Sets a graphics state flag that determines whether curves and arcs, 5937dd7cddfSDavid du Colombierwhen flattened, always start and end with a line that is a segment of the 5947dd7cddfSDavid du Colombiertangent; this also causes butt and square caps to be properly perpendicular 5957dd7cddfSDavid du Colombierto the tangent. <b><tt>initgraphics</tt></b> sets this flag to false, to 5967dd7cddfSDavid du Colombiermatch other PostScript implementations. 5977dd7cddfSDavid du Colombier</dl> 5987dd7cddfSDavid du Colombier 5997dd7cddfSDavid du Colombier<dl> 6007dd7cddfSDavid du Colombier<dt><b><tt>- .currentaccuratecurves <bool></tt></b> 6017dd7cddfSDavid du Colombier<dd>Returns the current value of the accurate curves flag. 6027dd7cddfSDavid du Colombier</dl> 6037dd7cddfSDavid du Colombier 6047dd7cddfSDavid du Colombier<dl> 6057dd7cddfSDavid du Colombier<dt><b><tt><int> .setcurvejoin -</tt></b> 606*593dc095SDavid du Colombier<dd>Obsolete, left for backward compatibility. 6077dd7cddfSDavid du Colombier<dd>Sets a graphics state parameter that determines how to treat the joins 6087dd7cddfSDavid du Colombierbetween the line segments produced when a curve is flattened. The parameter 6097dd7cddfSDavid du Colombiervalue may be either -1 or a value acceptable to <b><tt>setlinejoin</tt></b>. 6107dd7cddfSDavid du ColombierIf the parameter value is -1, the join used for flattened curve line 6117dd7cddfSDavid du Colombiersegments is given by the current line join parameter in the graphics state 6127dd7cddfSDavid du Colombier(except that if the line join value is "none", a bevel join is used), which 613*593dc095SDavid du Colombiermatches the Adobe Red Book, but not some old Adobe implementations; if the curve 6147dd7cddfSDavid du Colombierjoin parameter value is a line join value, that type of join is used for 6157dd7cddfSDavid du Colombierflattened curve line segments, regardless of the value of the graphics state 6167dd7cddfSDavid du Colombierline join parameter. The initial (and default) value of the curve join 617*593dc095SDavid du Colombierparameter is -1, causing the compatibility to Red Book and to modern Adobe 6187dd7cddfSDavid du Colombierimplementations. <b><tt>initgraphics</tt></b> sets the parameter to its 6197dd7cddfSDavid du Colombierdefault value. 6207dd7cddfSDavid du Colombier</dl> 6217dd7cddfSDavid du Colombier 6227dd7cddfSDavid du Colombier<dl> 6237dd7cddfSDavid du Colombier<dt><b><tt>- .currentcurvejoin <int></tt></b> 624*593dc095SDavid du Colombier<dd>Obsolete, left for backward compatibility. 6257dd7cddfSDavid du Colombier<dd>Returns the current value of the curve join parameter. 6267dd7cddfSDavid du Colombier</dl> 6277dd7cddfSDavid du Colombier 6287dd7cddfSDavid du Colombier<dl> 6297dd7cddfSDavid du Colombier<dt><b><tt><bool> .setdashadapt -</tt></b> 6307dd7cddfSDavid du Colombier<dd>Sets a graphics state flag that determines whether dash patterns do 6317dd7cddfSDavid du Colombier(true) or do not (false) automatically scale themselves so that each line 6327dd7cddfSDavid du Colombiersegment consists of an integral number of pattern repetitions. 6337dd7cddfSDavid du Colombier<b><tt>initgraphics</tt></b> sets this flag to false. 6347dd7cddfSDavid du Colombier</dl> 6357dd7cddfSDavid du Colombier 6367dd7cddfSDavid du Colombier<dl> 6377dd7cddfSDavid du Colombier<dt><b><tt>- .currentdashadapt <bool></tt></b> 6387dd7cddfSDavid du Colombier<dd>Returns the current value of the dash adaptation flag. 6397dd7cddfSDavid du Colombier</dl> 6407dd7cddfSDavid du Colombier 6417dd7cddfSDavid du Colombier<dl> 6427dd7cddfSDavid du Colombier<dt><b><tt><matrix> .setdefaultmatrix -</tt></b> 6437dd7cddfSDavid du Colombier<dd>Sets the default matrix that is returned by 6447dd7cddfSDavid du Colombier<b><tt>defaultmatrix</tt></b> and installed by <b><tt>initmatrix</tt></b>. 6457dd7cddfSDavid du ColombierOrdinary programs should not use this operator. 6467dd7cddfSDavid du Colombier</dl> 6477dd7cddfSDavid du Colombier 6487dd7cddfSDavid du Colombier<dl> 6497dd7cddfSDavid du Colombier<dt><b><tt><num> <bool> .setdotlength -</tt></b> 6507dd7cddfSDavid du Colombier<dd>Sets a graphics state parameter that determines the handling of 6517dd7cddfSDavid du Colombierzero-length lines (dots). If the dot length is zero, dots are painted as 6527dd7cddfSDavid du Colombiercircles if round line caps are in effect, otherwise they are not painted at 6537dd7cddfSDavid du Colombierall. If the dot length is non-zero, dots are treated exactly like lines of 6547dd7cddfSDavid du Colombierthe given length: the length is specified in user coordinates (like line 6557dd7cddfSDavid du Colombierwidth) if <b><tt>bool</tt></b> is false, or in default user coordinates of 6567dd7cddfSDavid du Colombierpoints (units of 1/72in; see the <a href="Devices.htm#Measurements">notes 6577dd7cddfSDavid du Colombieron measurements</a> in the documentation on devices) if 6587dd7cddfSDavid du Colombier<b><tt>bool</tt></b> is true. Dots occurring as part of dash patterns will 6597dd7cddfSDavid du Colombierbe oriented correctly; isolated dots will be oriented as though they were 6607dd7cddfSDavid du Colombierpart of a vertical line. <b><tt>initgraphics</tt></b> sets the dot length 6617dd7cddfSDavid du Colombierto zero. 6627dd7cddfSDavid du Colombier</dl> 6637dd7cddfSDavid du Colombier 6647dd7cddfSDavid du Colombier<dl> 6657dd7cddfSDavid du Colombier<dt><b><tt>- .currentdotlength <num> <bool></tt></b> 6667dd7cddfSDavid du Colombier<dd>Returns the current dot length and dot length mode. 6677dd7cddfSDavid du Colombier</dl> 6687dd7cddfSDavid du Colombier 6697dd7cddfSDavid du Colombier<dl> 6707dd7cddfSDavid du Colombier<dt><b><tt><dx> <dy> .setfilladjust2 -</tt></b> 6717dd7cddfSDavid du Colombier<dd>Sets graphics state parameters that cause all filled and stroked 6727dd7cddfSDavid du Colombierregions to be "fattened" by the given amount relative to an algorithm that 6737dd7cddfSDavid du Colombieronly paints pixels whose centers fall within the region to be painted. 6747dd7cddfSDavid du Colombier<b><tt>dx</tt></b> and <b><tt>dy</tt></b> are numbers between 0 and 0.5, 6757dd7cddfSDavid du Colombiermeasured in device space. The only two values that are likely to be useful 6767dd7cddfSDavid du Colombierare 0, which gives a pure center-of-pixel rule, and 0.5, which gives 6777dd7cddfSDavid du ColombierAdobe's any-part-of-pixel rule. (0.5 is treated slightly specially in 6787dd7cddfSDavid du Colombierorder to create half-open pixels per Adobe's specification.) 6797dd7cddfSDavid du Colombier</dl> 6807dd7cddfSDavid du Colombier 6817dd7cddfSDavid du Colombier<dl> 6827dd7cddfSDavid du Colombier<dt><b><tt>- .currentfilladjust2 <dx> <dy></tt></b> 6837dd7cddfSDavid du Colombier<dd>Returns the current fill adjustment values. 6847dd7cddfSDavid du Colombier</dl> 6857dd7cddfSDavid du Colombier 6863ff48bf5SDavid du Colombier<dl> 6873ff48bf5SDavid du Colombier<dt><b><tt><bool> .setlimitclamp -</tt></b> 6883ff48bf5SDavid du Colombier<dd>Sets a graphics state flag that determines whether attempts to set the 6893ff48bf5SDavid du Colombiercurrent point outside the internally representable range should clamp the 6903ff48bf5SDavid du Colombiervalue to the largest representable value (true) or give a 6913ff48bf5SDavid du Colombier<b><tt>limitcheck</tt></b> error (false). <b><tt>initgraphics</tt></b> sets 6923ff48bf5SDavid du Colombierthis flag to false, to match other PostScript implementations. 6933ff48bf5SDavid du Colombier</dl> 6943ff48bf5SDavid du Colombier 6953ff48bf5SDavid du Colombier<dl> 6963ff48bf5SDavid du Colombier<dt><b><tt>- .currentlimitclamp <bool></tt></b> 6973ff48bf5SDavid du Colombier<dd>Returns the current value of the limit clamp flag. 6983ff48bf5SDavid du Colombier</dl> 6993ff48bf5SDavid du Colombier 7003ff48bf5SDavid du Colombier<dl> 7013ff48bf5SDavid du Colombier<dt><b><tt><int> .setoverprintmode -</tt></b> 7023ff48bf5SDavid du Colombier<dd>Sets the overprint mode in the graphics state. Legal values are 0 or 1. 7033ff48bf5SDavid du ColombierPer the PDF 1.3 specification, if the overprint mode is 1, then when the 7043ff48bf5SDavid du Colombiercurrent color space is <b><tt>DeviceCMYK</tt></b>, color components whose 7053ff48bf5SDavid du Colombiervalue is 0 do not write into the target, rather than writing a 0 value. 7063ff48bf5SDavid du ColombierTHIS BEHAVIOR IS NOT IMPLEMENTED YET. The initial value of the overprint 7073ff48bf5SDavid du Colombiermode is 0. 7083ff48bf5SDavid du Colombier</dl> 7093ff48bf5SDavid du Colombier 7103ff48bf5SDavid du Colombier<dl> 7113ff48bf5SDavid du Colombier<dt><b><tt>- .currentoverprintmode <int></tt></b> 7123ff48bf5SDavid du Colombier<dd>Returns the current overprint mode. 7133ff48bf5SDavid du Colombier</dl> 7143ff48bf5SDavid du Colombier 7153ff48bf5SDavid du Colombier<h4><a name="Path"></a>Path operators</h4> 7167dd7cddfSDavid du Colombier 7177dd7cddfSDavid du Colombier<dl> 7187dd7cddfSDavid du Colombier<dt><b><tt>- .dashpath -</tt></b> 7197dd7cddfSDavid du Colombier<dd>If there is no current dash pattern, does nothing. Otherwise, does the 7207dd7cddfSDavid du Colombierequivalent of <b><tt>flattenpath</tt></b> and then chops up the path as 7217dd7cddfSDavid du Colombierdetermined by the dash pattern. 7227dd7cddfSDavid du Colombier</dl> 7237dd7cddfSDavid du Colombier 7247dd7cddfSDavid du Colombier<dl> 7257dd7cddfSDavid du Colombier<dt><b><tt><x> <y> <width> <height> .rectappend -</tt></b> 7267dd7cddfSDavid du Colombier<dt><b><tt><numarray> .rectappend -</tt></b> 7277dd7cddfSDavid du Colombier<dt><b><tt><numstring> .rectappend -</tt></b> 7287dd7cddfSDavid du Colombier<dd>Appends a rectangle or rectangles to the current path, in the same 7297dd7cddfSDavid du Colombiermanner as <b><tt>rectfill</tt></b>, <b><tt>rectclip</tt></b>, etc. Defined 7307dd7cddfSDavid du Colombieronly if the <b><tt>dps</tt></b> or <b><tt>level2</tt></b> option was 7317dd7cddfSDavid du Colombierselected when Ghostscript was built. 7327dd7cddfSDavid du Colombier</dl> 7337dd7cddfSDavid du Colombier 7343ff48bf5SDavid du Colombier<h4><a name="Painting"></a>Painting operators</h4> 7357dd7cddfSDavid du Colombier 7367dd7cddfSDavid du Colombier<p> 7377dd7cddfSDavid du ColombierGhostscript supports an experimental extension of the PostScript imaging 7387dd7cddfSDavid du Colombiermodel to include <b><tt>RasterOp</tt></b> and some related facilities. 7397dd7cddfSDavid du ColombierThis extension is available only if the <b><tt>rasterop</tt></b> option was 7407dd7cddfSDavid du Colombierselected when building Ghostscript. 7417dd7cddfSDavid du Colombier 7427dd7cddfSDavid du Colombier<p> 7437dd7cddfSDavid du ColombierWith the <b><tt>RasterOp</tt></b> extension, imaging operations compute a 7447dd7cddfSDavid du Colombierfunction <b>D = f(D,S,T)</b> in RGB space, where <b>f</b> is an 7457dd7cddfSDavid du Colombierarbitrary 3-input Boolean function, <b>D</b> is the destination (frame 7467dd7cddfSDavid du Colombierbuffer or print buffer), <b>S</b> is the source (described below), and 7477dd7cddfSDavid du Colombier<b>T</b> is the texture (the current PostScript color, which may be a 7487dd7cddfSDavid du Colombierpattern). The source and texture depend on the PostScript imaging 7497dd7cddfSDavid du Colombieroperation: 7507dd7cddfSDavid du Colombier 7517dd7cddfSDavid du Colombier<ul> 7527dd7cddfSDavid du Colombier<li>For <b><tt>fill</tt></b> and <b><tt>stroke</tt></b>, the source is 7537dd7cddfSDavid du Colombiersolid black, covering the region to be painted; the texture is the current 7547dd7cddfSDavid du ColombierPostScript color. 7557dd7cddfSDavid du Colombier 7567dd7cddfSDavid du Colombier<li>For <b><tt>show</tt></b> and <b><tt>imagemask</tt></b>, the source is 7577dd7cddfSDavid du Colombiersolid black, covering the pixels to be painted; the texture is the current 7587dd7cddfSDavid du ColombierPostScript color. 7597dd7cddfSDavid du Colombier 7607dd7cddfSDavid du Colombier<li>For <b><tt>image</tt></b> and <b><tt>colorimage</tt></b>, the source is 7617dd7cddfSDavid du Colombierthe image data; the texture depends on an optional Boolean parameter, 7627dd7cddfSDavid du Colombier<b><tt>CombineWithColor</tt></b>, in the image dictionary. If 7637dd7cddfSDavid du Colombier<b><tt>CombineWithColor</tt></b> is false (the default), the texture is 7647dd7cddfSDavid du Colombiersolid black. If <b><tt>CombineWithColor</tt></b> is true, the texture is 7657dd7cddfSDavid du Colombierthe current color. For the non-dictionary form of the image operator, 7667dd7cddfSDavid du Colombier<b><tt>CombineWithColor</tt></b> is considered to be false. 7677dd7cddfSDavid du Colombier</ul> 7687dd7cddfSDavid du Colombier 7697dd7cddfSDavid du Colombier<p> 7707dd7cddfSDavid du ColombierThe <b><tt>rasterop</tt></b> option adds the following operators: 7717dd7cddfSDavid du Colombier 7727dd7cddfSDavid du Colombier<dl> 7737dd7cddfSDavid du Colombier<dt><b><tt><int8> .setrasterop -</tt></b> 7747dd7cddfSDavid du Colombier<dd>Sets the <b><tt>RasterOp</tt></b> function in the graphics state. The 7757dd7cddfSDavid du Colombierdefault function is 252, Source | Texture. 7767dd7cddfSDavid du Colombier</dl> 7777dd7cddfSDavid du Colombier 7787dd7cddfSDavid du Colombier<dl> 7797dd7cddfSDavid du Colombier<dt><b><tt>- .currentrasterop <int8></tt></b> 7807dd7cddfSDavid du Colombier<dd>Returns the current <b><tt>RasterOp</tt></b> function. 7817dd7cddfSDavid du Colombier</dl> 7827dd7cddfSDavid du Colombier 7837dd7cddfSDavid du Colombier<dl> 7847dd7cddfSDavid du Colombier<dt><b><tt><bool> .setsourcetransparent -</tt></b> 7857dd7cddfSDavid du Colombier<dd>Sets source transparency in the graphics state. When source 7867dd7cddfSDavid du Colombiertransparency is true, white source pixels prevent storing into the 7877dd7cddfSDavid du Colombierdestination, regardless of what the <b><tt>RasterOp</tt></b> function 7887dd7cddfSDavid du Colombierreturns. The default source transparency is false. 7897dd7cddfSDavid du Colombier</dl> 7907dd7cddfSDavid du Colombier 7917dd7cddfSDavid du Colombier<dl> 7927dd7cddfSDavid du Colombier<dt><b><tt>- .currentsourcetransparent <bool> -</tt></b> 7937dd7cddfSDavid du Colombier<dd>Returns the current source transparency. 7947dd7cddfSDavid du Colombier</dl> 7957dd7cddfSDavid du Colombier 7967dd7cddfSDavid du Colombier<dl> 7977dd7cddfSDavid du Colombier<dt><b><tt><bool> .settexturetransparent -</tt></b> 7987dd7cddfSDavid du Colombier<dd>Sets texture transparency in the graphics state. When texture 7997dd7cddfSDavid du Colombiertransparency is true, white texture pixels prevent storing into the 8007dd7cddfSDavid du Colombierdestination, regardless of what the <b><tt>RasterOp</tt></b> function 8017dd7cddfSDavid du Colombierreturns. The default texture transparency is false. 8027dd7cddfSDavid du Colombier</dl> 8037dd7cddfSDavid du Colombier 8047dd7cddfSDavid du Colombier<dl> 8057dd7cddfSDavid du Colombier<dt><b><tt>- .currenttexturetransparent <bool> -</tt></b> 8067dd7cddfSDavid du Colombier<dd>Returns the current texture transparency. 8077dd7cddfSDavid du Colombier</dl> 8087dd7cddfSDavid du Colombier 8097dd7cddfSDavid du Colombier<p> 8107dd7cddfSDavid du ColombierFor more information on RasterOp and transparency, please consult chapter 5 8117dd7cddfSDavid du Colombierof the "PCL 5 Color Technical Reference Manual", 8127dd7cddfSDavid du Colombier<a href="http://www.hp.com/cposupport/printers/support_doc/bpl01354.html">Hewlett-Packard 8137dd7cddfSDavid du ColombierManual Part No. 5961-0635</a>. 8147dd7cddfSDavid du Colombier 8153ff48bf5SDavid du Colombier<h4><a name="Character"></a>Character operators</h4> 8167dd7cddfSDavid du Colombier 8177dd7cddfSDavid du Colombier<dl> 8187dd7cddfSDavid du Colombier<dt><b><tt><string> <bool> .charboxpath -</tt></b> 8197dd7cddfSDavid du Colombier<dd>For each character <b>C</b> in the rendering of <string>, let the 8207dd7cddfSDavid du Colombierbounding box of <b>C</b> <b><em>in device space</em></b> be the four 8217dd7cddfSDavid du Colombier<b><em>user-space</em></b> points p1x/y, p2x/y, p3x/y, and p4x/y. For each 8227dd7cddfSDavid du Colombiercharacter in order, <b><tt>.charboxpath</tt></b> appends the following to 8237dd7cddfSDavid du Colombierthe current path: 8247dd7cddfSDavid du Colombier 8257dd7cddfSDavid du Colombier<ul><li>If <b><tt><bool></tt></b> is true, the equivalent of: 8267dd7cddfSDavid du Colombier 8277dd7cddfSDavid du Colombier<blockquote> 8287dd7cddfSDavid du Colombierp1x p1y <b><tt>moveto</tt></b><br> 8297dd7cddfSDavid du Colombierp2x p2y <b><tt>lineto</tt></b><br> 8307dd7cddfSDavid du Colombierp3x p3y <b><tt>lineto</tt></b><br> 8317dd7cddfSDavid du Colombierp4x p4y <b><tt>lineto</tt></b><br> 8327dd7cddfSDavid du Colombier<b><tt>closepath</tt></b> 8337dd7cddfSDavid du Colombier</blockquote> 8347dd7cddfSDavid du Colombier</ul> 8357dd7cddfSDavid du Colombier 8367dd7cddfSDavid du Colombier<p> 8377dd7cddfSDavid du ColombierThis creates a path whose <b><tt>pathbbox</tt></b> is the 8387dd7cddfSDavid du Colombier<b><tt>bbox</tt></b> of the string. 8397dd7cddfSDavid du Colombier 8407dd7cddfSDavid du Colombier<ul><li>If <b><tt><bool></tt></b> is false, the equivalent of: 8417dd7cddfSDavid du Colombier 8427dd7cddfSDavid du Colombier<blockquote> 8437dd7cddfSDavid du Colombierp1x p1y <b><tt>moveto</tt></b><br> 8447dd7cddfSDavid du Colombierp3x p3y <b><tt>lineto</tt></b> 8457dd7cddfSDavid du Colombier</blockquote> 8467dd7cddfSDavid du Colombier</ul> 8477dd7cddfSDavid du Colombier 8487dd7cddfSDavid du Colombier<p> 8497dd7cddfSDavid du ColombierIf the CTM is well-behaved (consists only of reflection, scaling, and 8507dd7cddfSDavid du Colombierrotation by multiples of 90 degrees), this too creates a (simpler) path 8517dd7cddfSDavid du Colombierwhose <b><tt>pathbbox</tt></b> is the <b><tt>bbox</tt></b> of the string. 8527dd7cddfSDavid du Colombier</dl> 8537dd7cddfSDavid du Colombier 8547dd7cddfSDavid du Colombier<dl> 8557dd7cddfSDavid du Colombier<dt><b><tt><font> <charname|charcode> <charname> <charstring> .type1execchar -</tt></b> 8567dd7cddfSDavid du Colombier<dd>Does all the work for rendering a Type 1 outline. This operator, like 8577dd7cddfSDavid du Colombier<b><tt>setcharwidth</tt></b> and <b><tt>setcachedevice</tt></b>, is valid 8587dd7cddfSDavid du Colombieronly in the context of a show operator -- that is, it must only be called 8597dd7cddfSDavid du Colombierfrom within a <b><tt>BuildChar</tt></b> or <b><tt>BuildGlyph</tt></b> 8607dd7cddfSDavid du Colombierprocedure. 8617dd7cddfSDavid du Colombier</dl> 8627dd7cddfSDavid du Colombier 8637dd7cddfSDavid du Colombier<dl> 8647dd7cddfSDavid du Colombier<dt><b><tt><font> <charcode> %Type1BuildChar -</tt></b> 8657dd7cddfSDavid du Colombier<dd>This is not a new operator: rather, it is a name known specially to the 8667dd7cddfSDavid du Colombierinterpreter. Whenever the interpreter needs to render a character (during 8677dd7cddfSDavid du Colombiera ...<b><tt>show</tt></b>, <b><tt>stringwidth</tt></b>, or 8687dd7cddfSDavid du Colombier<b><tt>charpath</tt></b>), it looks up the name <b><tt>BuildChar</tt></b> 8697dd7cddfSDavid du Colombierin the font dictionary to find a procedure to run. If it does not find 8707dd7cddfSDavid du Colombierthis name, and if the <b><tt>FontType</tt></b> is 1, the interpreter 8717dd7cddfSDavid du Colombierinstead uses the value (looked up on the dictionary stack in the usual way) 8727dd7cddfSDavid du Colombierof the name <b><tt>%Type1BuildChar</tt></b>. 8737dd7cddfSDavid du Colombier 8747dd7cddfSDavid du Colombier<p> 8757dd7cddfSDavid du ColombierThe standard definition of <b><tt>%Type1BuildChar</tt></b> is in the 8767dd7cddfSDavid du Colombierinitialization file <b><tt>gs_type1.ps</tt></b>. Users should not need to 8777dd7cddfSDavid du Colombierredefine <b><tt>%Type1BuildChar</tt></b>, except perhaps for tracing or 8787dd7cddfSDavid du Colombierdebugging. 8797dd7cddfSDavid du Colombier</dl> 8807dd7cddfSDavid du Colombier 8817dd7cddfSDavid du Colombier<dl> 8827dd7cddfSDavid du Colombier<dt><b><tt><font> <charname> %Type1BuildGlyph -</tt></b> 8837dd7cddfSDavid du Colombier<dd>Provides the Type 1 implementation of <b><tt>BuildGlyph</tt></b>. 8847dd7cddfSDavid du Colombier</dl> 8857dd7cddfSDavid du Colombier 8863ff48bf5SDavid du Colombier<h3><a name="Other"></a>Other operators</h3> 8877dd7cddfSDavid du Colombier 8883ff48bf5SDavid du Colombier<h4><a name="Mathematical"></a>Mathematical operators</h4> 8897dd7cddfSDavid du Colombier 8907dd7cddfSDavid du Colombier<dl> 8917dd7cddfSDavid du Colombier<dt><b><tt><number> arccos <number></tt></b> 8927dd7cddfSDavid du Colombier<dd>Computes the arc cosine of a number between -1 and 1. 8937dd7cddfSDavid du Colombier</dl> 8947dd7cddfSDavid du Colombier 8957dd7cddfSDavid du Colombier<dl> 8967dd7cddfSDavid du Colombier<dt><b><tt><number> arcsin <number></tt></b> 8977dd7cddfSDavid du Colombier<dd>Computes the arc sine of a number between -1 and 1. 8987dd7cddfSDavid du Colombier</dl> 8997dd7cddfSDavid du Colombier 9003ff48bf5SDavid du Colombier<h4><a name="Dictionary"></a>Dictionary operators</h4> 9013ff48bf5SDavid du Colombier 9023ff48bf5SDavid du Colombier<dl> 9033ff48bf5SDavid du Colombier<dt><b><tt>mark <key1> <value1> <key2> <value2> ... .dicttomark <dict></tt></b> 9043ff48bf5SDavid du Colombier<dd>Creates and returns a dictionary with the given keys and values. This 9053ff48bf5SDavid du Colombieris the same as the PostScript Level 2 <b><tt>>></tt></b> operator, 9063ff48bf5SDavid du Colombierbut is available even in Level 1 configurations. 9073ff48bf5SDavid du Colombier</dl> 9083ff48bf5SDavid du Colombier 9093ff48bf5SDavid du Colombier<dl> 9103ff48bf5SDavid du Colombier<dt><b><tt><dict> <key> <value> .forceput - </tt></b> 9113ff48bf5SDavid du Colombier<dd>Equivalent to <b><tt>put</tt></b>, but works even if 9123ff48bf5SDavid du Colombier<b><tt>dict</tt></b> is not writable, and (if <b><tt>dict</tt></b> is 9133ff48bf5SDavid du Colombier<b><tt>systemdict</tt></b> or the current save level is 0) even if 9143ff48bf5SDavid du Colombier<b><tt>dict</tt></b> is in global VM and <b><tt>key</tt></b> and/or 9153ff48bf5SDavid du Colombier<b><tt>value</tt></b> is in local VM. <strong>This operator should be used 9163ff48bf5SDavid du Colombieronly initialization code, and only in executeonly procedures: it must not be 9173ff48bf5SDavid du Colombieraccessible after initialization.</strong> 9183ff48bf5SDavid du Colombier</dl> 9193ff48bf5SDavid du Colombier 9203ff48bf5SDavid du Colombier<dl> 9213ff48bf5SDavid du Colombier<dt><b><tt><dict> <key> .forceundef - </tt></b> 9223ff48bf5SDavid du Colombier<dd>Equivalent to <b><tt>undef</tt></b>, but works even if 9233ff48bf5SDavid du Colombier<b><tt>dict</tt></b> is not writable. <strong>This operator should be used 9243ff48bf5SDavid du Colombieronly initialization code, and only in executeonly procedures: it must not be 9253ff48bf5SDavid du Colombieraccessible after initialization.</strong> 9263ff48bf5SDavid du Colombier</dl> 9273ff48bf5SDavid du Colombier 9283ff48bf5SDavid du Colombier 9293ff48bf5SDavid du Colombier<dl> 9303ff48bf5SDavid du Colombier<dt><b><tt><dict> <key> .knownget <value> true</tt></b> 9313ff48bf5SDavid du Colombier<dt><b><tt><dict> <key> .knownget false</tt></b> 9323ff48bf5SDavid du Colombier<dd>Combines <b><tt>known</tt></b> and <b><tt>get</tt></b> in the 9333ff48bf5SDavid du Colombierobvious way. 9343ff48bf5SDavid du Colombier</dl> 9353ff48bf5SDavid du Colombier 9363ff48bf5SDavid du Colombier<dl> 9373ff48bf5SDavid du Colombier<dt><b><tt><dict> <integer> .setmaxlength -</tt></b> 9383ff48bf5SDavid du Colombier<dd>Sets the capacity (<b><tt>maxlength</tt></b>) of a dictionary. 9393ff48bf5SDavid du ColombierCauses a <b><tt>dictfull</tt></b> error if the dictionary has more 9403ff48bf5SDavid du Colombieroccupied entries than the requested capacity. 9413ff48bf5SDavid du Colombier</dl> 9423ff48bf5SDavid du Colombier 9433ff48bf5SDavid du Colombier<h4><a name="String"></a>String and name operators</h4> 9443ff48bf5SDavid du Colombier 9453ff48bf5SDavid du Colombier<dl> 9463ff48bf5SDavid du Colombier<dt><b><tt><integer> .bytestring <bytestring></tt></b> 9473ff48bf5SDavid du Colombier<dd>Allocates and returns a bytestring, a special data type that can be 9483ff48bf5SDavid du Colombierlarger than the maximum size of a string (64K-1 bytes) and can be used in 9493ff48bf5SDavid du Colombierplace of a string with a very few operators. 9503ff48bf5SDavid du Colombier</dl> 9513ff48bf5SDavid du Colombier 9523ff48bf5SDavid du Colombier<dl> 9533ff48bf5SDavid du Colombier<dt><b><tt><name> .namestring <string></tt></b> 9543ff48bf5SDavid du Colombier<dd>Returns the (read-only) string for a name. 9553ff48bf5SDavid du Colombier</dl> 9563ff48bf5SDavid du Colombier 9573ff48bf5SDavid du Colombier<dl> 958*593dc095SDavid du Colombier<dt><b><tt><string> <charstring> .stringbreak <index|null></tt></b> 959*593dc095SDavid du Colombier<dd>Searches for a character in <b><tt>string</tt></b> that appears 960*593dc095SDavid du Colombiersomewhere in <b><tt>charstring</tt></b>. If such a character is found, 961*593dc095SDavid du Colombierreturns the index of the first such character; if no such character is 962*593dc095SDavid du Colombierfound, returns <b><tt>null</tt></b>. 963*593dc095SDavid du Colombier</dl> 964*593dc095SDavid du Colombier 965*593dc095SDavid du Colombier<dl> 9663ff48bf5SDavid du Colombier<dt><b><tt><obj> <pattern> .stringmatch <bool></tt></b> 9673ff48bf5SDavid du Colombier<dd>Matches <b><tt>obj</tt></b> against a pattern in which '*' matches 0 or 9683ff48bf5SDavid du Colombiermore characters and '?' matches any single character. If 9693ff48bf5SDavid du Colombier<b><tt>obj</tt></b> is a string or a name, matches its characters against 9703ff48bf5SDavid du Colombierthe pattern; if <b><tt>obj</tt></b> is of any other type, the result is 9713ff48bf5SDavid du Colombier<b><tt>true</tt></b> if the pattern is the single character "*" and 9723ff48bf5SDavid du Colombier<b><tt>false</tt></b> otherwise. 9733ff48bf5SDavid du Colombier</dl> 9747dd7cddfSDavid du Colombier 9757dd7cddfSDavid du Colombier<dl> 9767dd7cddfSDavid du Colombier<dt><b><tt><state> <fromString> <toString> .type1encrypt <newState> <toSubstring></tt></b> 9777dd7cddfSDavid du Colombier<dd>Encrypts <b><tt>fromString</tt></b> according to the algorithm for 9787dd7cddfSDavid du ColombierAdobe Type 1 fonts, writing the result into <b><tt>toString</tt></b>. 9797dd7cddfSDavid du Colombier<b><tt>toString</tt></b> must be at least as long as 9807dd7cddfSDavid du Colombier<b><tt>fromString</tt></b>, or a rangecheck error occurs. 9817dd7cddfSDavid du Colombier<b><tt>state</tt></b> is the initial state of the encryption algorithm (a 9827dd7cddfSDavid du Colombier16-bit non-negative integer); <b><tt>newState</tt></b> is the new state of 9837dd7cddfSDavid du Colombierthe algorithm. 9847dd7cddfSDavid du Colombier</dl> 9857dd7cddfSDavid du Colombier 9867dd7cddfSDavid du Colombier<dl> 9877dd7cddfSDavid du Colombier<dt><b><tt><state> <fromString> <toString> .type1decrypt <newState> <toSubstring></tt></b> 9887dd7cddfSDavid du Colombier<dd>Decrypts <b><tt>fromString</tt></b> according to the algorithm for 9897dd7cddfSDavid du ColombierAdobe Type 1 fonts, writing the result into <b><tt>toString</tt></b>. 9907dd7cddfSDavid du ColombierOther specifications are as for <b><tt>type1encrypt</tt></b>. 9917dd7cddfSDavid du Colombier</dl> 9927dd7cddfSDavid du Colombier 9933ff48bf5SDavid du Colombier<h4><a name="Relational"></a>Relational operators</h4> 9947dd7cddfSDavid du Colombier 9957dd7cddfSDavid du Colombier<dl> 9967dd7cddfSDavid du Colombier<dt><b><tt><number|string> <number|string> max <number|string></tt></b> 9977dd7cddfSDavid du Colombier<dd>Returns the larger of two numbers or strings. 9987dd7cddfSDavid du Colombier</dl> 9997dd7cddfSDavid du Colombier 10007dd7cddfSDavid du Colombier<dl> 10017dd7cddfSDavid du Colombier<dt><b><tt><number|string> <number|string> min <number|string></tt></b> 10027dd7cddfSDavid du Colombier<dd>Returns the smaller of two numbers or strings. 10037dd7cddfSDavid du Colombier</dl> 10047dd7cddfSDavid du Colombier 10053ff48bf5SDavid du Colombier<h4><a name="File"></a>File operators</h4> 10063ff48bf5SDavid du Colombier 10073ff48bf5SDavid du Colombier<dl> 10083ff48bf5SDavid du Colombier<dt><b><tt><file> .filename <string> true</tt></b> 10093ff48bf5SDavid du Colombier<dt><b><tt><file> .filename false</tt></b> 10103ff48bf5SDavid du Colombier<dd>If the file was opened by the <b><tt>file</tt></b> or 10113ff48bf5SDavid du Colombier<b><tt>.tempfile</tt></b> operator, returns the file name and 10123ff48bf5SDavid du Colombier<b><tt>true</tt></b>; if the file is a filter, returns 10133ff48bf5SDavid du Colombier<b><tt>false</tt></b>. 10143ff48bf5SDavid du Colombier</dl> 10153ff48bf5SDavid du Colombier 10163ff48bf5SDavid du Colombier<dl> 10173ff48bf5SDavid du Colombier<dt><b><tt><file> .fileposition <integer> true</tt></b> 10183ff48bf5SDavid du Colombier<dd>Returns the position of <b><tt>file</tt></b>. Unlike the standard 10193ff48bf5SDavid du Colombier<b><tt>fileposition</tt></b> operator, which causes an error if the file is 10203ff48bf5SDavid du Colombiernot positionable, <b><tt>.fileposition</tt></b> works on all files, 10213ff48bf5SDavid du Colombierincluding filters: for non-positionable files, it returns the total number 10223ff48bf5SDavid du Colombierof bytes read or written since the file was opened. 10233ff48bf5SDavid du Colombier</dl> 10247dd7cddfSDavid du Colombier 10257dd7cddfSDavid du Colombier<dl> 10267dd7cddfSDavid du Colombier<dt><b><tt><string> findlibfile <foundstring> <file> true</tt></b> 10277dd7cddfSDavid du Colombier<dt><b><tt><string> findlibfile <string> false</tt></b> 10287dd7cddfSDavid du Colombier<dd>Opens the file of the given name for reading, searching through 10297dd7cddfSDavid du Colombierdirectories <a href="Use.htm#Finding_files">as described in the usage 10307dd7cddfSDavid du Colombierdocumentation</a>. If the search fails, <b><tt>findlibfile</tt></b> simply 10317dd7cddfSDavid du Colombierpushes false on the stack and returns, rather than causing an error. 10327dd7cddfSDavid du Colombier</dl> 10337dd7cddfSDavid du Colombier 10347dd7cddfSDavid du Colombier<dl> 10353ff48bf5SDavid du Colombier<dt><b><tt><file> <string> .peekstring <substring> <filled_bool></tt></b> 10363ff48bf5SDavid du Colombier<dd>Reads bytes from a file like <b><tt>readstring</tt></b>, but also leaves 10373ff48bf5SDavid du Colombierthe bytes in the file buffer so they will be read again by a subsequent read 10383ff48bf5SDavid du Colombieroperation. Currently gives a <b><tt>rangecheck</tt></b> error if 10393ff48bf5SDavid du Colombier<b><tt>string</tt></b> is larger than the file's buffer. 10403ff48bf5SDavid du Colombier</dl> 10413ff48bf5SDavid du Colombier 10423ff48bf5SDavid du Colombier<a name=Tempfile></a> 10433ff48bf5SDavid du Colombier<dl> 10443ff48bf5SDavid du Colombier<dt><b><tt><prefix_string|null> <access_string> .tempfile 10453ff48bf5SDavid du Colombier<string> <file></tt></b> 10463ff48bf5SDavid du Colombier<dd>Creates and opens a temporary file 10473ff48bf5SDavid du Colombierlike the <b><tt>file</tt></b> operator, also returning the file name. There 10483ff48bf5SDavid du Colombierare three cases for the <b><tt><prefix_string|null></tt></b> operand: 10493ff48bf5SDavid du Colombier 10503ff48bf5SDavid du Colombier<ul> 10513ff48bf5SDavid du Colombier<p> 10523ff48bf5SDavid du Colombier<li><b><tt>null</tt></b>: create the file in the same directory and with the 10533ff48bf5SDavid du Colombiersame name conventions as other temporary files created by the Ghostscript 10543ff48bf5SDavid du Colombierimplementation on this platform. E.g., the temporary file might be named 10553ff48bf5SDavid du Colombier<b><tt>/tmp/gs_a1234</tt></b>. 10563ff48bf5SDavid du Colombier<p> 1057*593dc095SDavid du Colombier<li>A string that contains only alphanumeric characters, underline, 1058*593dc095SDavid du Colombierand dash: create the file in the standard temporary directory, but use 1059*593dc095SDavid du Colombierthe 10603ff48bf5SDavid du Colombier<b><tt><prefix_string></tt></b> as the first part of the file name. 10613ff48bf5SDavid du ColombierE.g., if <b><tt><prefix_string></tt></b> is <b><tt>xx</tt></b>, the 10623ff48bf5SDavid du Colombiertemporary file might be named <b><tt>/tmp/xxa1234</tt></b>. 10633ff48bf5SDavid du Colombier<p> 10643ff48bf5SDavid du Colombier<li>A string that is the beginning of an absolute file name: use the 10653ff48bf5SDavid du Colombier<b><tt><prefix_string></tt></b> as the first part of the file name. 10663ff48bf5SDavid du ColombierE.g., if <b><tt><prefix_string></tt></b> is 10673ff48bf5SDavid du Colombier<b><tt>/my/tmpdir/zz</tt></b>, the temporary file might be named 10683ff48bf5SDavid du Colombier<b><tt>/my/tmpdir/zza1234</tt></b>. 10693ff48bf5SDavid du Colombier<p> 10703ff48bf5SDavid du ColombierWhen running in <b><tt>SAFER</tt></b> mode, the absolute path must 10713ff48bf5SDavid du Colombierbe one of the strings on the list given by the <b><tt>PermitFileWriting</tt></b> 10723ff48bf5SDavid du Colombieruserparameter. Temporary files created with <b><tt>.tempfile</tt></b> can 10733ff48bf5SDavid du Colombierbe deleted when in SAFER mode, and can be renamed to one of the paths 10743ff48bf5SDavid du Colombierthat is on <b>both</b> the PermitFileControl and PermitFileWriting 10753ff48bf5SDavid du Colombierpaths. 10763ff48bf5SDavid du Colombier</ul> 10773ff48bf5SDavid du Colombier 10783ff48bf5SDavid du Colombier</dl> 10793ff48bf5SDavid du Colombier 10803ff48bf5SDavid du Colombier<dl> 10813ff48bf5SDavid du Colombier<dt><b><tt><file> <integer> .unread -</tt></b> 10827dd7cddfSDavid du Colombier<dd>Pushes back the last-read character onto the front of the file. If the 10837dd7cddfSDavid du Colombierfile is open only for writing, or if the integer argument is not the same 10847dd7cddfSDavid du Colombieras the last character read from the file, causes an <b><tt>ioerror</tt></b> 10857dd7cddfSDavid du Colombiererror. May also cause an <b><tt>ioerror</tt></b> if the last operation on 10863ff48bf5SDavid du Colombierthe file was not a reading operation. This operator is now deprecated: 10873ff48bf5SDavid du Colombieruse <b><tt>.peekstring</tt></b> in new code. 10889a747e4fSDavid du Colombier</dl> 10899a747e4fSDavid du Colombier 10907dd7cddfSDavid du Colombier<p> 10917dd7cddfSDavid du ColombierGhostscript also supports the following <b><tt>IODevice</tt></b> in 10927dd7cddfSDavid du Colombieraddition to a subset of those defined in the Adobe documentation: 1093*593dc095SDavid du Colombier<ul> 1094*593dc095SDavid du Colombier<li> 10957dd7cddfSDavid du Colombier<b><tt>%pipe%command</tt></b>, which opens a pipe on the given command. 10967dd7cddfSDavid du ColombierThis is supported only on operating systems that provide 10977dd7cddfSDavid du Colombier<b><tt>popen</tt></b> (primarily Unix systems, and not all of those). 1098*593dc095SDavid du Colombier<p> 1099*593dc095SDavid du Colombier<li> 1100*593dc095SDavid du Colombier<b><tt>%disk#%</tt></b>, which emulates the %disk0 1101*593dc095SDavid du Colombierthrough %disk9 devices on some Adobe PostScript printers. This pseudo 1102*593dc095SDavid du Colombierdevice provides a flat filenaming system with a user definable location 1103*593dc095SDavid du Colombierfor the files (/Root). These devices will only be present if the 1104*593dc095SDavid du Colombierdiskn.dev feature is specified during the build. 1105*593dc095SDavid du Colombier<p> 1106*593dc095SDavid du ColombierThis feature is intended to allow compatibility with font downloaders 1107*593dc095SDavid du Colombierthat expect to store fonts on the %disk device of the printer. 1108*593dc095SDavid du Colombier<p> 1109*593dc095SDavid du ColombierUse of the %disk#% devices requires that the location of files be given 1110*593dc095SDavid du Colombierby the user setting the /Root device parameter. The syntax for setting 1111*593dc095SDavid du Colombierthe /Root parameter is:<pre> 1112*593dc095SDavid du Colombier mark /Root (directory_specification) (%disk#) .putdevparams 1113*593dc095SDavid du Colombier</pre> 1114*593dc095SDavid du ColombierFor example, to store the files of the %disk0 device on the directory 1115*593dc095SDavid du Colombier/tmp/disk0, use:<pre> 1116*593dc095SDavid du Colombier mark /Root (/tmp/disk0/) (%disk0) .putdevparams 1117*593dc095SDavid du Colombier</pre> 1118*593dc095SDavid du ColombierThe files will be stored in the specified directory with arbitrary names. 1119*593dc095SDavid du ColombierA mapping file is used to store the association between the file 1120*593dc095SDavid du Colombiernames given for the file operations on the %diskn# device and the file 1121*593dc095SDavid du Colombierthat resides in the /Root directory. 1122*593dc095SDavid du Colombier</ul> 11237dd7cddfSDavid du Colombier 11243ff48bf5SDavid du Colombier<h4><a name="Virtual_memory"></a>Virtual memory operators</h4> 11257dd7cddfSDavid du Colombier 11267dd7cddfSDavid du Colombier<dl> 11277dd7cddfSDavid du Colombier<dt><b><tt><save> .forgetsave -</tt></b> 11287dd7cddfSDavid du Colombier<dd>Cancels the effect of a save, making it as though the save never 11297dd7cddfSDavid du Colombierhappened. 11307dd7cddfSDavid du Colombier</dl> 11317dd7cddfSDavid du Colombier 11323ff48bf5SDavid du Colombier<h4><a name="Miscellaneous"></a>Miscellaneous operators</h4> 11333ff48bf5SDavid du Colombier 11343ff48bf5SDavid du Colombier<dl> 1135*593dc095SDavid du Colombier<dt><b><tt><array> bind <array></tt></b> 1136*593dc095SDavid du Colombier<dd>Depending on the command line parameters <b><tt>bind</tt></b> is redefined as: 1137*593dc095SDavid du Colombier</dl> 1138*593dc095SDavid du Colombier 1139*593dc095SDavid du Colombier<blockquote><table cellpadding=0 cellspacing=0> 1140*593dc095SDavid du Colombier<tr valign=bottom> 1141*593dc095SDavid du Colombier <th valign=bottom align=left>Flag 1142*593dc095SDavid du Colombier <td> 1143*593dc095SDavid du Colombier <th valign=bottom align=left>Definition 1144*593dc095SDavid du Colombier<tr> <td colspan=3><hr> 1145*593dc095SDavid du Colombier<tr valign=top> <td>NOBIND 1146*593dc095SDavid du Colombier <td> 1147*593dc095SDavid du Colombier <td>/bind {} def ; 1148*593dc095SDavid du Colombier no operation, returns the argument 1149*593dc095SDavid du Colombier<tr valign=top> <td>DELAYBIND 1150*593dc095SDavid du Colombier <td> 1151*593dc095SDavid du Colombier <td>returns the argument, stores the argument for later use by <b><tt>.bindnow</b></tt> 1152*593dc095SDavid du Colombier</table></blockquote> 1153*593dc095SDavid du Colombier 1154*593dc095SDavid du Colombier 1155*593dc095SDavid du Colombier<dl> 1156*593dc095SDavid du Colombier<dt><b><tt><array> .bind <array></tt></b> 1157*593dc095SDavid du Colombier<dd>Performs standard <b><tt>bind</tt></b> operation as defined in PLRM regardless of 1158*593dc095SDavid du ColombierNOBIND or DELAYBIND flags. 1159*593dc095SDavid du Colombier</dl> 1160*593dc095SDavid du Colombier 1161*593dc095SDavid du Colombier<a name="bindnow"></a> 1162*593dc095SDavid du Colombier<dl> 1163*593dc095SDavid du Colombier<dt><b><tt>- .bindnow -</tt></b> 1164*593dc095SDavid du Colombier<dd>Applies <b><tt>bind</tt></b> operator to all savad procedures after binding has been 1165*593dc095SDavid du Colombierdeferred through -dDELAYBIND. Note that idiom recognition has no effect for the deferred 1166*593dc095SDavid du Colombierbinding because the value returned from <b><tt>bind</tt></b> is discarded. 1167*593dc095SDavid du Colombier<p> 1168*593dc095SDavid du ColombierSince v. 8.12 <b><tt>.bindnow</tt></b> undefines itself and restores standard definition of 1169*593dc095SDavid du Colombier<b><tt>bind</tt></b> operator. In earlier versions after calling <b><tt>.bindnow</tt></b>, 1170*593dc095SDavid du Colombierthe postscript <b><tt>bind</tt></b> operator needs to be rebound to the internal implementation 1171*593dc095SDavid du Colombier<b><tt>.bind</tt></b>, as in this fragment from the ps2ascii script: 1172*593dc095SDavid du Colombier<blockquote><pre><tt>DELAYBIND { 1173*593dc095SDavid du Colombier .bindnow 1174*593dc095SDavid du Colombier /bind /.bind load def 1175*593dc095SDavid du Colombier} if 1176*593dc095SDavid du Colombier</tt></pre></blockquote> 1177*593dc095SDavid du ColombierThis is necessary for correct behavior with later code that uses the <b><tt>bind</tt></b> operator. 1178*593dc095SDavid du Colombier</dl> 1179*593dc095SDavid du Colombier 1180*593dc095SDavid du Colombier<dl> 11813ff48bf5SDavid du Colombier<dt><b><tt><obj1> <obj2> ... <objn> <n> .execn ...</tt></b> 11823ff48bf5SDavid du Colombier<dd>This executes <b><tt>obj1</tt></b> through <b><tt>objn</tt></b> in that 11833ff48bf5SDavid du Colombierorder, essentially equivalent to 11843ff48bf5SDavid du Colombier 11853ff48bf5SDavid du Colombier<blockquote><pre> 11863ff48bf5SDavid du Colombier<obj1> <obj2> ... <objn> <n> array astore {exec} forall 11873ff48bf5SDavid du Colombier</pre></blockquote> 11883ff48bf5SDavid du Colombier 11893ff48bf5SDavid du Colombier<p> 11903ff48bf5SDavid du Colombierexcept that it doesn't actually create the array. 11913ff48bf5SDavid du Colombier</dl> 11927dd7cddfSDavid du Colombier 11937dd7cddfSDavid du Colombier<dl> 11947dd7cddfSDavid du Colombier<dt><b><tt><string> getenv <string> true</tt></b> 11957dd7cddfSDavid du Colombier<dt><b><tt><string> getenv false</tt></b> 11967dd7cddfSDavid du Colombier<dd>Looks up a name in the shell environment. If the name is found, 11977dd7cddfSDavid du Colombierreturns the corresponding value and true; if the name is not found, returns 11987dd7cddfSDavid du Colombierfalse. 11997dd7cddfSDavid du Colombier</dl> 12007dd7cddfSDavid du Colombier 12017dd7cddfSDavid du Colombier<dl> 12027dd7cddfSDavid du Colombier<dt><b><tt><name> <array> .makeoperator <operator></tt></b> 12037dd7cddfSDavid du Colombier<dd>Constructs and returns a new operator that is actually the given 12047dd7cddfSDavid du Colombierprocedure in disguise. The name is only used for printing. The operator 12057dd7cddfSDavid du Colombierhas the executable attribute. 12067dd7cddfSDavid du Colombier 12077dd7cddfSDavid du Colombier<p> 12087dd7cddfSDavid du ColombierOperators defined in this way do one other thing besides running the 12097dd7cddfSDavid du Colombierprocedure: if an error occurs during the execution of the procedure, and 12107dd7cddfSDavid du Colombierthere has been no net reduction in operand or dictionary stack depth, the 12117dd7cddfSDavid du Colombieroperand or dictionary stack pointer respectively is reset to its position 12127dd7cddfSDavid du Colombierat the beginning of the procedure. 12137dd7cddfSDavid du Colombier</dl> 12147dd7cddfSDavid du Colombier 12157dd7cddfSDavid du Colombier<dl> 12167dd7cddfSDavid du Colombier<dt><b><tt><string> <boolean> .setdebug -</tt></b> 12177dd7cddfSDavid du Colombier<dd>If the Ghostscript interpreter was built with the <b><tt>DEBUG</tt></b> 12187dd7cddfSDavid du Colombierflag set, sets or resets any subset of the debugging flags normally 12197dd7cddfSDavid du Colombiercontrolled by <b><tt>-Z</tt></b> in the command line. Has no effect 12207dd7cddfSDavid du Colombierotherwise. 12217dd7cddfSDavid du Colombier</dl> 12227dd7cddfSDavid du Colombier 12237dd7cddfSDavid du Colombier<dl> 12247dd7cddfSDavid du Colombier<dt><b><tt>- .oserrno <errno></tt></b> 12257dd7cddfSDavid du Colombier<dd>Returns the error code for the most recent operating system error. 12267dd7cddfSDavid du Colombier</dl> 12277dd7cddfSDavid du Colombier 12287dd7cddfSDavid du Colombier<dl> 12293ff48bf5SDavid du Colombier<dt><b><tt>- .oserrorstring <string></tt></b> 12307dd7cddfSDavid du Colombier<dd>Returns the error string for the most recent operating system error. 12317dd7cddfSDavid du Colombier</dl> 12327dd7cddfSDavid du Colombier 12333ff48bf5SDavid du Colombier<a name="Runandhide"></a> 12343ff48bf5SDavid du Colombier<dl> 12353ff48bf5SDavid du Colombier<dt><b><tt><array> <procedure> .runandhide ... <array></tt></b> 12363ff48bf5SDavid du Colombier<dd>Runs the <i><tt><procedure></tt></i> after removing the 12373ff48bf5SDavid du Colombier<i><tt><array></tt></i> from the stack. As long as <i><tt><array></tt></i> 12383ff48bf5SDavid du Colombieris not contained in any readable dictionaries or elsewhere on stacks, it 12393ff48bf5SDavid du Colombierwill not be accessible to <i><tt><procedure></tt></i>. 12403ff48bf5SDavid du Colombier<p> 12413ff48bf5SDavid du ColombierThis operator is intended to allow hiding a <i><tt><save></tt></i> object 12423ff48bf5SDavid du Colombierduring execution of procedures or files that run in <b>SAFER</b> mode. 12433ff48bf5SDavid du ColombierIf a <b><tt>save</tt></b> is performed prior to entering <b>SAFER</b> mode 12443ff48bf5SDavid du Colombierwith <b><tt>.setsafe</tt></b>, using the save object as the operand to 12453ff48bf5SDavid du Colombier<b><tt>restore</tt></b> will return to <b>NOSAFER</b> mode. In order to 12463ff48bf5SDavid du Colombierprevent the procedures running in <b>SAFER</b> mode from being able to 12473ff48bf5SDavid du Colombierreturn to <b>NOSAFER</b> mode, this operator should be used. 12483ff48bf5SDavid du ColombierUpon return from the file or procedure <b><tt>restore</tt></b> can be used 12493ff48bf5SDavid du Colombierto return to <b>NOSAFER</b> mode. 12503ff48bf5SDavid du Colombier<p> 12513ff48bf5SDavid du Colombier<b>Note:</b> The array operand hidden during the execution of the file or 12523ff48bf5SDavid du Colombierprocedure will be placed at the top of the operand stack which may be on 12533ff48bf5SDavid du Colombiertop of objects that the file or procedure leaves on top of the stack. 12543ff48bf5SDavid du ColombierThus removing objects below the array may be needed to prevent an 12553ff48bf5SDavid du Colombier<b><tt>invalidrestore</tt></b> error. 12563ff48bf5SDavid du Colombier<p> 12573ff48bf5SDavid du ColombierFor example, in order for a script or job server to execute a file 12583ff48bf5SDavid du Colombier<tt>somefile.ps</tt> with the <b>SAFER</b> mode restrictions in place, returning 12593ff48bf5SDavid du Colombierto unrestricted <b>NOSAFER</b> mode when the procedure exits is as follows: 12603ff48bf5SDavid du Colombier<pre> 12613ff48bf5SDavid du Colombier Start Ghostscript with <b>-dNOSAFER</b> 12623ff48bf5SDavid du Colombier 12633ff48bf5SDavid du Colombier ... % perform any device set up w/o restrictions 12643ff48bf5SDavid du Colombier [ save ] % create a save object before SAFER 12653ff48bf5SDavid du Colombier (somefile.ps) (r) file cvx % open the file to process 12663ff48bf5SDavid du Colombier .setsafe % enter SAFER mode 12673ff48bf5SDavid du Colombier .runandhide % run the file hiding the save object 12683ff48bf5SDavid du Colombier count 1 roll % place array below anything left over 12693ff48bf5SDavid du Colombier count 1 sub { pop } repeat % pop left over stuff 12703ff48bf5SDavid du Colombier cleardictstack % prevent invalidrestore from dicts 12713ff48bf5SDavid du Colombier 0 get restore % go back to NOSAFER mode 12723ff48bf5SDavid du Colombier</pre> 12733ff48bf5SDavid du ColombierAnother refinement on the above would be to execute <b><tt>.runandhide</tt></b> 12743ff48bf5SDavid du Colombierusing <b><tt>stopped</tt></b> in order to report errors but continue processing. 12753ff48bf5SDavid du Colombier</dl> 12763ff48bf5SDavid du Colombier 12773ff48bf5SDavid du Colombier<dl> 12783ff48bf5SDavid du Colombier<dt><b><tt>- .setsafe -</tt></b> 12793ff48bf5SDavid du Colombier<dd>If Ghostscript is started with <b><tt>-dNOSAFER</tt></b> or 12803ff48bf5SDavid du Colombier<b><tt>-dDELAYSAFER</tt></b>, this operator can be used to enter <b>SAFER</b> 12813ff48bf5SDavid du Colombiermode (see <a href="Use.htm#Safer"><b>-dSAFER</b></a>) 12823ff48bf5SDavid du Colombier<p> 12833ff48bf5SDavid du ColombierSince <b>SAFER</b> mode is implemented with userparameters and device parameters, 12843ff48bf5SDavid du Colombierit is possible to use <b><tt>save</tt></b> and <b><tt>restore</tt></b> before 12853ff48bf5SDavid du Colombierand after <b><tt>.setsafe</tt></b> to return to <b>NOSAFER</b> mode, but care 12863ff48bf5SDavid du Colombiershould be taken to ensure that the <i><tt>save</tt></i> object is not 12873ff48bf5SDavid du Colombieraccessible to any procedures or file run in <b>SAFER</b> mode (see 12883ff48bf5SDavid du Colombier<a href="#Runandhide"><b>.runandhide</b></a> above). 1289*593dc095SDavid du Colombier<p> 1290*593dc095SDavid du Colombier<b>Note: This uses setpagedevice to change .LockSafetyParams, so the page 1291*593dc095SDavid du Colombierwill be erased as a side effect of this operator</b> 12923ff48bf5SDavid du Colombier</dl> 12933ff48bf5SDavid du Colombier 12943ff48bf5SDavid du Colombier<dl> 12953ff48bf5SDavid du Colombier<dt><b><tt>- .locksafe -</tt></b> 12963ff48bf5SDavid du Colombier<dd> 12973ff48bf5SDavid du ColombierThis operator sets the current device's <b><tt>.LockSafetyParams</tt></b> 12983ff48bf5SDavid du Colombierand the <b><tt>LockFilePermissions</tt></b> userparameter true as well as 12993ff48bf5SDavid du Colombieradding the paths on LIBPATH and FONTPATH and the paths given by the 13003ff48bf5SDavid du Colombiersystem params /GenericResourceDir and /FontResourceDir to the current 13013ff48bf5SDavid du ColombierPermitFileReading list of paths. 13023ff48bf5SDavid du Colombier<p> 13033ff48bf5SDavid du ColombierIf Ghostscript is started with <b><tt>-dNOSAFER</tt></b> or 13043ff48bf5SDavid du Colombier<b><tt>-dDELAYSAFER</tt></b>, this operator can be used to enter <b>SAFER</b> 13053ff48bf5SDavid du Colombiermode with the current set of <b><tt>PermitFile...</tt></b> user parameters 1306*593dc095SDavid du Colombierin effect. Since <b><tt>.setsafe</tt></b> sets the <b><tt>PermitFile...</tt></b> 1307*593dc095SDavid du Colombieruser parameters to empty arrays, a script or job server that needs to 1308*593dc095SDavid du Colombierenable certain paths for file Reading, Writing and/or Control can use this 1309*593dc095SDavid du Colombieroperator to perform the locking needed to enter <b>SAFER</b> mode. 1310*593dc095SDavid du Colombier<p> 1311*593dc095SDavid du ColombierFor example, to enable reading everywhere, but disallow writing and file 1312*593dc095SDavid du Colombiercontrol (deleting and renaming files), the following can be used: 1313*593dc095SDavid du Colombier<pre> 1314*593dc095SDavid du Colombier { << /PermitFileReading [ (*) ] 1315*593dc095SDavid du Colombier /PermitFileWriting [ ] 1316*593dc095SDavid du Colombier /PermitFileControl [ ] 1317*593dc095SDavid du Colombier >> setuserparams 1318*593dc095SDavid du Colombier .locksafe 1319*593dc095SDavid du Colombier } stopped pop 1320*593dc095SDavid du Colombier</pre> 1321*593dc095SDavid du ColombierIn the above example, use of stopped will allow the use of this sequence on 1322*593dc095SDavid du Colombierolder versions of Ghostscript where <b><tt>.locksafe</tt></b> was not an operator. 1323*593dc095SDavid du Colombier<p> 1324*593dc095SDavid du Colombier<b>Note: This uses setpagedevice to change .LockSafetyParams, so the page 1325*593dc095SDavid du Colombierwill be erased as a side effect of this operator</b> 13263ff48bf5SDavid du Colombier<p> 13273ff48bf5SDavid du ColombierSee also <a href="#LockSafetyParams">.LockSafetyParams</a> and 13283ff48bf5SDavid du Colombier<a href="#User_parameters">User Parameters</a>. 13293ff48bf5SDavid du Colombier<p> 13303ff48bf5SDavid du Colombier</dl> 13313ff48bf5SDavid du Colombier 1332*593dc095SDavid du Colombier<dl><a name=".setpdfwrite"></a> 1333*593dc095SDavid du Colombier<dt><b><tt>.setpdfwrite</tt></b></dt> 1334*593dc095SDavid du Colombier<dd>This operator conditions the environment for the <tt>pdfwrite</tt> output device. 1335*593dc095SDavid du ColombierIt is a shorthand for setting parameters that have been deemed benificial. While not strictly necessary, it is usually helpful to set call this when using the pdfwrite device. 1336*593dc095SDavid du ColombierFor example, this is how the ps2pdf script calls Ghostscript: 1337*593dc095SDavid du Colombier<blockquote><b><tt> 1338*593dc095SDavid du Colombiergs -q -dSAFER -dNOPAUSE -dBATCH -sOutputFile=file.pdf </tt></b><em>[more options]</em><b><tt> \<br> 1339*593dc095SDavid du Colombier -sDEVICE=pdfwrite -c .setpdfwrite -f </b></tt><em>source1.ps [more files]</em> 1340*593dc095SDavid du Colombier</blockquote> 1341*593dc095SDavid du Colombier<p>Currently, the operator just sets a minimum 3 MB vmthreshold to allow for 1342*593dc095SDavid du Colombieraccumulating shared object data and to reduce the incidence of garbage 1343*593dc095SDavid du Colombiercollection as a performance improvement. Additional settings may be added in the future. 1344*593dc095SDavid du Colombier</dl> 1345*593dc095SDavid du Colombier 1346*593dc095SDavid du Colombier<dl> 1347*593dc095SDavid du Colombier<dt><b><tt>.color_test</tt></b> and <b><tt>.color_test_all</tt></b></dt> 1348*593dc095SDavid du Colombier<dd>These operators are used for the verification of device encode_color and 1349*593dc095SDavid du Colombierdecode_color routines. They are for internal use only. Their function 1350*593dc095SDavid du Colombiercan, and probably will, change as Artifex's requirements change. 1351*593dc095SDavid du Colombier<p> 1352*593dc095SDavid du Colombier<dd>Currently these operators loop through a set of possible values for the inputs 1353*593dc095SDavid du Colombierto the encode_color routine and then veify that the decode_color routines produce 1354*593dc095SDavid du Colombiervalues that match the input set to within a tolerance which is based upon the number 1355*593dc095SDavid du Colombierof bits used to encode a pixel. The operators also verify that if the device 1356*593dc095SDavid du Colombieris 'separable' then that the values produced by gx_default_encode_color and 1357*593dc095SDavid du Colombiergx_default_decode_color (the default encode/decode color handlers for a separable 1358*593dc095SDavid du Colombierdevice) are consistent to within the same tolerance. 1359*593dc095SDavid du Colombier</dl> 1360*593dc095SDavid du Colombier 13613ff48bf5SDavid du Colombier<h4><a name="Device"></a>Device operators</h4> 13627dd7cddfSDavid du Colombier 13637dd7cddfSDavid du Colombier<dl> 13647dd7cddfSDavid du Colombier<dt><b><tt><device> copydevice <device></tt></b> 13653ff48bf5SDavid du Colombier<dd>Copies a device. The copy is writable and installable. The copy is 13663ff48bf5SDavid du Colombiercreated in the current VM (local or global), usually local VM for executing 13673ff48bf5SDavid du Colombierordinary PostScript files. 13683ff48bf5SDavid du Colombier</dl> 13693ff48bf5SDavid du Colombier 13703ff48bf5SDavid du Colombier<dl> 13713ff48bf5SDavid du Colombier<dt><b><tt><devicename> finddevice <device></tt></b> 13723ff48bf5SDavid du Colombier<dd>Creates a default instance of a device specified by name. The instance 13733ff48bf5SDavid du Colombieris created in global VM. If <b><tt>finddevice</tt></b> is called more than 13743ff48bf5SDavid du Colombieronce with the same device name, it creates the default instance the first 13753ff48bf5SDavid du Colombiertime, and returns the same instance thereafter. 13763ff48bf5SDavid du Colombier</dl> 13773ff48bf5SDavid du Colombier 13783ff48bf5SDavid du Colombier<dl> 13793ff48bf5SDavid du Colombier<dt><b><tt><devicename> findprotodevice <device></tt></b> 13803ff48bf5SDavid du Colombier<dd>Finds the prototype of a device specified by name. A prototype can be 13813ff48bf5SDavid du Colombierused with <b><tt>.getdeviceparams</tt></b> or other parameter-reading 13823ff48bf5SDavid du Colombieroperators, but it is read-only and cannot be set with 13833ff48bf5SDavid du Colombier<b><tt>setdevice</tt></b>: it must be copied first. 13843ff48bf5SDavid du Colombier</dl> 13853ff48bf5SDavid du Colombier 13863ff48bf5SDavid du Colombier<dl> 13873ff48bf5SDavid du Colombier<dt><b><tt><device> <x> <y> <width> <max_height> <alpha?> <std_depth|null> <string> .getbitsrect <height> <substring></tt></b> 13883ff48bf5SDavid du Colombier<dd>Reads a rectangle of rendered bits back from a device. This is only 13893ff48bf5SDavid du Colombierguaranteed to be implemented for image devices (see below). 13903ff48bf5SDavid du Colombier<b><tt>alpha?</tt></b> is 0 for no alpha, -1 for alpha first, 1 for alpha 13913ff48bf5SDavid du Colombierlast. <b><tt>std_depth</tt></b> is null for native pixels, number of bits 13923ff48bf5SDavid du Colombierper component for a standard color space. 13937dd7cddfSDavid du Colombier</dl> 13947dd7cddfSDavid du Colombier 13957dd7cddfSDavid du Colombier<dl> 13967dd7cddfSDavid du Colombier<dt><b><tt><index> .getdevice <device></tt></b> 13977dd7cddfSDavid du Colombier<dd>Returns a device from the set of devices known to the system. The 13987dd7cddfSDavid du Colombierfirst device, which is the default, is numbered 0. If the 13997dd7cddfSDavid du Colombier<b><tt>index</tt></b> is out of range, causes a <b><tt>rangecheck</tt></b> 14007dd7cddfSDavid du Colombiererror. This device is actually a prototype, not a directly usable device, 14017dd7cddfSDavid du Colombierand is marked read-only; it cannot have its parameters changed or be 14027dd7cddfSDavid du Colombierinstalled as the current device. 14037dd7cddfSDavid du Colombier</dl> 14047dd7cddfSDavid du Colombier 14057dd7cddfSDavid du Colombier<dl> 14067dd7cddfSDavid du Colombier<dt><b><tt><matrix> <width> <height> <palette> makeimagedevice <device></tt></b> 14077dd7cddfSDavid du Colombier<dd>Makes a new device that accumulates an image in memory. <b><tt> 14087dd7cddfSDavid du Colombiermatrix</tt></b> is the initial transformation matrix: it must be orthogonal 14097dd7cddfSDavid du Colombier(that is, [a 0 0 b x y] or 14107dd7cddfSDavid du Colombier[0 a b 0 x y]). <b><tt>palette</tt></b> is a 14117dd7cddfSDavid du Colombierstring of 2^<small><sup><b>N</b></sup></small> or 14127dd7cddfSDavid du Colombier3 × 2^<small><sup><b>N</b></sup></small> elements, 14137dd7cddfSDavid du Colombierspecifying how the 2^<small><sup><b>N</b></sup></small> possible pixel 14147dd7cddfSDavid du Colombiervalues will be interpreted. Each element is interpreted as a gray value, 14157dd7cddfSDavid du Colombieror as RGB values, multiplied by 255. For example, if you want a monochrome 14167dd7cddfSDavid du Colombierimage for which 0=white and 1=black, the palette should be 14177dd7cddfSDavid du Colombier<b><tt><ff 00></tt></b>; if you want a 3-bit deep image with 14187dd7cddfSDavid du Colombierjust the primary colors and their complements (ignoring the fact that 3-bit 14197dd7cddfSDavid du Colombierimages are not supported), the palette might be <b><tt><000000 0000ff 14207dd7cddfSDavid du Colombier00ff00 00ffff ff0000 ff00ff ffff00 ffffff></tt></b>. At present, the 14217dd7cddfSDavid du Colombierpalette must contain exactly 2, 4, 16, or 256 entries, and must contain an 14227dd7cddfSDavid du Colombierentry for black and an entry for white; if it contains any entries that 14237dd7cddfSDavid du Colombieraren't black, white, or gray, it must contain at least the six primary 14247dd7cddfSDavid du Colombiercolors (red, green, blue, and their complements cyan, magenta, and yellow); 14257dd7cddfSDavid du Colombieraside from this, its contents are arbitrary. 14267dd7cddfSDavid du Colombier 14277dd7cddfSDavid du Colombier<p> 14287dd7cddfSDavid du ColombierAlternatively, palette can be 16, 24, 32, or null (equivalent to 24). 14297dd7cddfSDavid du ColombierThese are interpreted as: 14307dd7cddfSDavid du Colombier 14317dd7cddfSDavid du Colombier<blockquote><table cellpadding=0 cellspacing=0> 14327dd7cddfSDavid du Colombier<tr valign=bottom> 14337dd7cddfSDavid du Colombier <th valign=bottom align=left>Palette 14347dd7cddfSDavid du Colombier <td> 14357dd7cddfSDavid du Colombier <th valign=bottom align=left>Bits allocated per color 14367dd7cddfSDavid du Colombier<tr> <td colspan=3><hr> 14377dd7cddfSDavid du Colombier<tr valign=top> <td>16 14387dd7cddfSDavid du Colombier <td> 14397dd7cddfSDavid du Colombier <td>5 red, 6 green, 5 blue 14407dd7cddfSDavid du Colombier<tr valign=top> <td>24 14417dd7cddfSDavid du Colombier <td> 14427dd7cddfSDavid du Colombier <td>8 red, 8 green, 8 blue 14437dd7cddfSDavid du Colombier<tr valign=top> <td>32 14447dd7cddfSDavid du Colombier <td> 14457dd7cddfSDavid du Colombier <td>8C, 8M, 8Y, 8K 14467dd7cddfSDavid du Colombier</table></blockquote> 14477dd7cddfSDavid du Colombier 14487dd7cddfSDavid du Colombier<p> 14497dd7cddfSDavid du ColombierNote that one can also make an image device (with the same palette as an 14507dd7cddfSDavid du Colombierexisting image device) by copying a device using the 14517dd7cddfSDavid du Colombier<b><tt>copydevice</tt></b> operator. 14527dd7cddfSDavid du Colombier</dl> 14537dd7cddfSDavid du Colombier 14547dd7cddfSDavid du Colombier<dl> 14557dd7cddfSDavid du Colombier<dt><b><tt><matrix> <width> <height> <palette> <word?> makewordimagedevice <device></tt></b> 14567dd7cddfSDavid du Colombier<dd>Makes an image device as described above. <b><tt>word?</tt></b> is a 14577dd7cddfSDavid du ColombierBoolean value indicating whether the data should be stored in a 14587dd7cddfSDavid du Colombierword-oriented format internally. No ordinary PostScript programs should 14597dd7cddfSDavid du Colombieruse this operator. 14607dd7cddfSDavid du Colombier</dl> 14617dd7cddfSDavid du Colombier 14627dd7cddfSDavid du Colombier<dl> 14637dd7cddfSDavid du Colombier<dt><b><tt><device> <index> <string> copyscanlines <substring></tt></b> 14647dd7cddfSDavid du Colombier<dd>Copies one or more scan lines from an image device into a string, 14657dd7cddfSDavid du Colombierstarting at a given scan line in the image. The data is in the same format 14667dd7cddfSDavid du Colombieras for the <b><tt>image</tt></b> operator. It is an error if the device is 14677dd7cddfSDavid du Colombiernot an image device or if the string is too small to hold at least one 14687dd7cddfSDavid du Colombiercomplete scan line. Always copies an integral number of scan lines. 14697dd7cddfSDavid du Colombier</dl> 14707dd7cddfSDavid du Colombier 14717dd7cddfSDavid du Colombier<dl> 14727dd7cddfSDavid du Colombier<dt><b><tt><device> setdevice -</tt></b> 1473*593dc095SDavid du Colombier<dd> 1474*593dc095SDavid du Colombier<p> 1475*593dc095SDavid du ColombierSets the current device to the specified device. Also resets the 14767dd7cddfSDavid du Colombiertransformation and clipping path to the initial values for the device. 14777dd7cddfSDavid du ColombierSignals an <b><tt>invalidaccess</tt></b> error if the device is a 14783ff48bf5SDavid du Colombierprototype or if <a href="Language.htm#LockSafetyParams">.LockSafetyParams</a> 14793ff48bf5SDavid du Colombieris true for the current device. 1480*593dc095SDavid du Colombier<p> 1481*593dc095SDavid du ColombierSome device properties may need to be set with <tt>putdeviceprops</tt> before 1482*593dc095SDavid du Colombier<b><tt>setdevice</tt></b> is called. For example, the pdfwrite device will try 1483*593dc095SDavid du Colombierto open its output file, causing an <tt>undefinedfilename</tt> error if 1484*593dc095SDavid du Colombier<tt>OutputFile</tt> hasn't been set to a valid filename. Another method in such 1485*593dc095SDavid du Colombiercases is to use the level 2 operator instead: 1486*593dc095SDavid du Colombier 1487*593dc095SDavid du Colombier <tt><< /OutputDevice /pdfwrite /OutputFile (MyPDF.pdf) >> <b>setpagedevice</b></tt>. 1488*593dc095SDavid du Colombier 14897dd7cddfSDavid du Colombier</dl> 14907dd7cddfSDavid du Colombier 14917dd7cddfSDavid du Colombier<dl> 14927dd7cddfSDavid du Colombier<dt><b><tt>- currentdevice <device></tt></b> 14937dd7cddfSDavid du Colombier<dd>Gets the current device from the graphics state. 14947dd7cddfSDavid du Colombier</dl> 14957dd7cddfSDavid du Colombier 14967dd7cddfSDavid du Colombier<dl> 14977dd7cddfSDavid du Colombier<dt><b><tt><device> getdeviceprops <mark> <name1> <value1> ... <namen> <valuen></tt></b> 14987dd7cddfSDavid du Colombier<dd>Gets the properties of a device. See the section on 14997dd7cddfSDavid du Colombier<a href="#Device_parameters">device parameters</a> below for details. 15007dd7cddfSDavid du Colombier</dl> 15017dd7cddfSDavid du Colombier 15027dd7cddfSDavid du Colombier<dl> 15037dd7cddfSDavid du Colombier<dt><b><tt><mark> <name1> <value1> ... <namen> <valuen> <device> putdeviceprops <device></tt></b> 15047dd7cddfSDavid du Colombier<dd>Sets properties of a device. May cause <b><tt>undefined</tt></b>, 15053ff48bf5SDavid du Colombier<b><tt>invalidaccess</tt></b>, <b><tt>typecheck</tt></b>, <b><tt>rangecheck</tt></b>, or 15067dd7cddfSDavid du Colombier<b><tt>limitcheck</tt></b> errors. 15077dd7cddfSDavid du Colombier</dl> 15087dd7cddfSDavid du Colombier 15097dd7cddfSDavid du Colombier<dl> 15107dd7cddfSDavid du Colombier<dt><b><tt>- flushpage -</tt></b> 15117dd7cddfSDavid du Colombier<dd>On displays, flushes any buffered output, so that it is guaranteed to 15127dd7cddfSDavid du Colombiershow up on the screen; on printers, has no effect. 15137dd7cddfSDavid du Colombier</dl> 15147dd7cddfSDavid du Colombier 15157dd7cddfSDavid du Colombier<hr> 15167dd7cddfSDavid du Colombier 15173ff48bf5SDavid du Colombier<h2><a name="Filters"></a>Filters</h2> 15183ff48bf5SDavid du Colombier 15193ff48bf5SDavid du Colombier<h3><a name="Standard_filters"></a>Standard filters</h3> 15203ff48bf5SDavid du Colombier 15213ff48bf5SDavid du Colombier<p> 15223ff48bf5SDavid du ColombierIn its usual configuration, Ghostscript supports all the standard PostScript 15233ff48bf5SDavid du ColombierLanguageLevel 3 filters, both encoding and decoding, except that it does not 15243ff48bf5SDavid du Colombiercurrently support: 15253ff48bf5SDavid du Colombier 15263ff48bf5SDavid du Colombier<ul> 15273ff48bf5SDavid du Colombier 15283ff48bf5SDavid du Colombier<li>the <b><tt>EarlyChange</tt></b> key in the <b><tt>LZWEncode</tt></b> 15293ff48bf5SDavid du Colombierfilter. 15303ff48bf5SDavid du Colombier 15313ff48bf5SDavid du Colombier</ul> 15323ff48bf5SDavid du Colombier 15333ff48bf5SDavid du Colombier<p> 15343ff48bf5SDavid du ColombierGhostscript also supports additional keys in the optional dictionary 15353ff48bf5SDavid du Colombieroperands for some filters. For the <b><tt>LZWDecode</tt></b> filter: 15363ff48bf5SDavid du Colombier 15373ff48bf5SDavid du Colombier<dl> 15383ff48bf5SDavid du Colombier<dt><b><tt>InitialCodeLength <integer></tt></b> (default 8) 15393ff48bf5SDavid du Colombier<dd>An integer between 2 and 11 specifying the initial number of data bits 15403ff48bf5SDavid du Colombierper code. Note that the actual initial code length is 1 greater than this, 15413ff48bf5SDavid du Colombierto allow for the reset and end-of-data code values. 15423ff48bf5SDavid du Colombier</dl> 15433ff48bf5SDavid du Colombier 15443ff48bf5SDavid du Colombier<dl> 15453ff48bf5SDavid du Colombier<dt><b><tt>FirstBitLowOrder <boolean></tt></b> (default false) 15463ff48bf5SDavid du Colombier<dd>If true, codes appear with their low-order bit first. 15473ff48bf5SDavid du Colombier</dl> 15483ff48bf5SDavid du Colombier 15493ff48bf5SDavid du Colombier<dl> 15503ff48bf5SDavid du Colombier<dt><b><tt>BlockData <boolean></tt></b> (default false) 15513ff48bf5SDavid du Colombier<dd>If true, the data is broken into blocks in the manner specified for the 15523ff48bf5SDavid du ColombierGIF file format. 15533ff48bf5SDavid du Colombier</dl> 15543ff48bf5SDavid du Colombier 15553ff48bf5SDavid du Colombier<p> 15563ff48bf5SDavid du ColombierFor the <b><tt>CCITTFaxEncode</tt></b> and <b><tt>CCITTFaxDecode</tt></b> 15573ff48bf5SDavid du Colombierfilters: 15583ff48bf5SDavid du Colombier 15593ff48bf5SDavid du Colombier<dl> 15603ff48bf5SDavid du Colombier<dt><b><tt>DecodedByteAlign <integer></tt></b> (default 1) 15613ff48bf5SDavid du Colombier<dd>An integer <b>N</b> with the value 1, 2, 4, 8, or 16, specifying that 15623ff48bf5SDavid du Colombierdecoded data scan lines are always a multiple of <b>N</b> bytes. The 15633ff48bf5SDavid du Colombierencoding filter skips data in each scan line from Columns to the next 15643ff48bf5SDavid du Colombiermultiple of <b>N</b> bytes; the decoding filter pads each scan line to a 15653ff48bf5SDavid du Colombiermultiple of <b>N</b> bytes. 15663ff48bf5SDavid du Colombier</dl> 15673ff48bf5SDavid du Colombier 15683ff48bf5SDavid du Colombier<h3><a name="Non_standard_filters"></a>Non-standard filters</h3> 15693ff48bf5SDavid du Colombier 15703ff48bf5SDavid du Colombier<p> 15713ff48bf5SDavid du ColombierIn addition to the standard PostScript LanguageLevel 3 filters, Ghostscript 15723ff48bf5SDavid du Colombiersupports the following non-standard filters. Many of these filters are used 15733ff48bf5SDavid du Colombierinternally to implement standard filters or facilities; they are almost 15743ff48bf5SDavid du Colombiercertain to remain, in their present form or a backward-compatible one, in 15753ff48bf5SDavid du Colombierfuture Ghostscript releases. 15763ff48bf5SDavid du Colombier 15773ff48bf5SDavid du Colombier<dl> 15783ff48bf5SDavid du Colombier<dt><b><tt><target> /BCPEncode filter <file></tt></b> 15793ff48bf5SDavid du Colombier<dt><b><tt><source> /BCPDecode filter <file></tt></b> 15803ff48bf5SDavid du Colombier<dd>Create filters that implement the Adobe Binary Communications Protocol. 15813ff48bf5SDavid du ColombierSee Adobe documentation for details. 15823ff48bf5SDavid du Colombier</dl> 15833ff48bf5SDavid du Colombier 15843ff48bf5SDavid du Colombier<dl> 15853ff48bf5SDavid du Colombier<dt><b><tt><target> <seed_integer> /eexecEncode filter <file></tt></b> 15863ff48bf5SDavid du Colombier<dd>Creates a filter for encrypting data into the encrypted format described 15873ff48bf5SDavid du Colombierin the Adobe Type 1 Font Format documentation. The 15883ff48bf5SDavid du Colombier<b><tt>seed_integer</tt></b> must be 55665 for the <b><tt>eexec</tt></b> 15893ff48bf5SDavid du Colombiersection of a font, or 4330 for a <b><tt>CharString</tt></b>. Note that for 15903ff48bf5SDavid du Colombierthe <b><tt>eexec</tt></b> section of a font, this filter produces binary 15913ff48bf5SDavid du Colombieroutput and does not include the initial 4 (or <b><tt>lenIV</tt></b>) garbage 15923ff48bf5SDavid du Colombierbytes. 15933ff48bf5SDavid du Colombier</dl> 15943ff48bf5SDavid du Colombier 15953ff48bf5SDavid du Colombier<dl> 15963ff48bf5SDavid du Colombier<dt><b><tt><source> <seed_integer> /eexecDecode filter <file></tt></b> 15973ff48bf5SDavid du Colombier<dt><b><tt><source> <dict> /eexecDecode filter <file></tt></b> 15983ff48bf5SDavid du Colombier<dd>Creates a filter for decrypting data encrypted as described in the Adobe 15993ff48bf5SDavid du ColombierType 1 Font Format documentation. The <b><tt>seed_integer</tt></b> must be 16003ff48bf5SDavid du Colombier55665 or 4330 as described just above. Recognized dictionary keys are: 16013ff48bf5SDavid du Colombier 16023ff48bf5SDavid du Colombier<blockquote> 16033ff48bf5SDavid du Colombier<b><tt>seed <16-bit integer></tt></b> (required)<br> 1604*593dc095SDavid du Colombier<b><tt>lenIV <non-negative integer></tt></b> (default=4)<br> 1605*593dc095SDavid du Colombier<b><tt>eexec <bool></tt></b> (default=<b><tt>false</b></tt>) 16063ff48bf5SDavid du Colombier</blockquote> 16073ff48bf5SDavid du Colombier</dl> 16083ff48bf5SDavid du Colombier 16093ff48bf5SDavid du Colombier<dl> 16103ff48bf5SDavid du Colombier<dt><b><tt><target> /MD5Encode filter <file></tt></b> 16113ff48bf5SDavid du Colombier<dd>Creates a filter that produces the 16-byte MD5 digest of the input. 16123ff48bf5SDavid du ColombierNote that no output is produced until the filter is closed. 16133ff48bf5SDavid du Colombier</dl> 16143ff48bf5SDavid du Colombier 16153ff48bf5SDavid du Colombier<dl> 16163ff48bf5SDavid du Colombier<dt><b><tt><source> <hex_boolean> /PFBDecode filter <file></tt></b> 16173ff48bf5SDavid du Colombier<dd>Creates a filter that decodes data in <b><tt>.PFB</tt></b> format, the 16183ff48bf5SDavid du Colombierusual semi-binary representation for Type 1 font files on IBM PC and 16193ff48bf5SDavid du Colombiercompatible systems. If <b><tt>hex_boolean</tt></b> is true, binary packets 16203ff48bf5SDavid du Colombierare converted to hex; if false, binary packets are not converted. 16213ff48bf5SDavid du Colombier</dl> 16223ff48bf5SDavid du Colombier 16233ff48bf5SDavid du Colombier<dl> 16243ff48bf5SDavid du Colombier<dt><b><tt><target> <dict> /PixelDifferenceEncode filter <file></tt></b> 16253ff48bf5SDavid du Colombier<dt><b><tt><source> <dict> /PixelDifferenceDecode filter <file></tt></b> 16263ff48bf5SDavid du Colombier<dd>Implements the Predictor=2 pixel-differencing option of the LZW 16273ff48bf5SDavid du Colombierfilters. Recognized keys are: 16283ff48bf5SDavid du Colombier 16293ff48bf5SDavid du Colombier<blockquote> 16303ff48bf5SDavid du Colombier<b><tt>Colors <integer></tt></b> (1 to 4, default=1)<br> 16313ff48bf5SDavid du Colombier<b><tt>BitsPerComponent <integer></tt></b> (1, 2, 4, or 8, default=8)<br> 16323ff48bf5SDavid du Colombier<b><tt>Columns <integer></tt></b> (>= 0, required) 16333ff48bf5SDavid du Colombier</blockquote> 16343ff48bf5SDavid du Colombier 16353ff48bf5SDavid du Colombier<p> 16363ff48bf5SDavid du ColombierSee the Adobe <a 16373ff48bf5SDavid du Colombierhref="http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf"><em>Portable 16383ff48bf5SDavid du ColombierDocument Format Reference Manual</em></a> for details. 16393ff48bf5SDavid du Colombier</dl> 16403ff48bf5SDavid du Colombier 16413ff48bf5SDavid du Colombier<dl> 16423ff48bf5SDavid du Colombier<dt><b><tt><target> <dict> /PNGPredictorEncode filter <file></tt></b> 16433ff48bf5SDavid du Colombier<dt><b><tt><source> <dict> /PNGPredictorDecode filter <file></tt></b> 16443ff48bf5SDavid du Colombier<dd>Implements the "filter" algorithms of the 16453ff48bf5SDavid du Colombier<a href="http://www.libpng.org/pub/png/">Portable Network Graphics (PNG) 16463ff48bf5SDavid du Colombiergraphics format</a>. Recognized keys are: 16473ff48bf5SDavid du Colombier 16483ff48bf5SDavid du Colombier<blockquote><table cellpadding=0 cellspacing=0> 16493ff48bf5SDavid du Colombier<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Keys recognized in PNG filter algorithms</font><hr> 16503ff48bf5SDavid du Colombier<tr valign=bottom> 16513ff48bf5SDavid du Colombier <th align=left>Key 16523ff48bf5SDavid du Colombier <td> 16533ff48bf5SDavid du Colombier <th align=left>Range 16543ff48bf5SDavid du Colombier <td> 16553ff48bf5SDavid du Colombier <th align=left>Default 16563ff48bf5SDavid du Colombier<tr> <td colspan=5><hr> 16573ff48bf5SDavid du Colombier<tr valign=top> <td><b><tt>Colors <integer></tt></b> 16583ff48bf5SDavid du Colombier <td> 16593ff48bf5SDavid du Colombier <td>1 to 16 16603ff48bf5SDavid du Colombier <td> 16613ff48bf5SDavid du Colombier <td>16 16623ff48bf5SDavid du Colombier<tr valign=top> <td><b><tt>BitsPerComponent <integer></tt></b> 16633ff48bf5SDavid du Colombier <td> 16643ff48bf5SDavid du Colombier <td>1, 2, 4, 8, or 16 16653ff48bf5SDavid du Colombier <td> 16663ff48bf5SDavid du Colombier <td>8 16673ff48bf5SDavid du Colombier<tr valign=top> <td><b><tt>Columns <integer></tt></b> 16683ff48bf5SDavid du Colombier <td> 16693ff48bf5SDavid du Colombier <td>>= 0 16703ff48bf5SDavid du Colombier <td> 16713ff48bf5SDavid du Colombier <td>1 16723ff48bf5SDavid du Colombier<tr valign=top> <td><b><tt>Predictor <integer></tt></b> 16733ff48bf5SDavid du Colombier <td> 16743ff48bf5SDavid du Colombier <td>10 to 15 16753ff48bf5SDavid du Colombier <td> 16763ff48bf5SDavid du Colombier <td>15 16773ff48bf5SDavid du Colombier</table></blockquote> 16783ff48bf5SDavid du Colombier 16793ff48bf5SDavid du Colombier<p> 16803ff48bf5SDavid du ColombierThe <b><tt>Predictor</tt></b> is the PNG algorithm number + 10 for the 16813ff48bf5SDavid du Colombier<b><tt>Encoding</tt></b> filter; the <b><tt>Decoding</tt></b> filter 16823ff48bf5SDavid du Colombierignores <b><tt>Predictor</tt></b>. 15 means the encoder attempts to 16833ff48bf5SDavid du Colombieroptimize the choice of algorithm. For more details see the PNG 16843ff48bf5SDavid du Colombierspecification 16853ff48bf5SDavid du Colombier 16863ff48bf5SDavid du Colombier<blockquote> 16873ff48bf5SDavid du Colombier<a href="http://www.w3.org/TR/WD-png-960128.html">http://www.w3.org/TR/WD-png-960128.html</a> 16883ff48bf5SDavid du Colombier</blockquote> 16893ff48bf5SDavid du Colombier</dl> 16903ff48bf5SDavid du Colombier 16913ff48bf5SDavid du Colombier<dl> 16923ff48bf5SDavid du Colombier<dt><b><tt><target> /TBCPEncode filter <file></tt></b> 16933ff48bf5SDavid du Colombier<dt><b><tt><source> /TBCPDecode filter <file></tt></b> 16943ff48bf5SDavid du Colombier<dd>Create filters that implement the Adobe Tagged Binary Communications 16953ff48bf5SDavid du ColombierProtocol. See Adobe documentation for details. 16963ff48bf5SDavid du Colombier</dl> 16973ff48bf5SDavid du Colombier 16983ff48bf5SDavid du Colombier<dl> 16993ff48bf5SDavid du Colombier<dt><b><tt><target> /zlibEncode filter <file></tt></b> 17003ff48bf5SDavid du Colombier<dt><b><tt><source> /zlibDecode filter <file></tt></b> 17013ff48bf5SDavid du Colombier<dd>Creates filters that use the data compression method variously known as 17023ff48bf5SDavid du Colombier'zlib' (the name of a popular library that implements it), 'Deflate' (as in 17033ff48bf5SDavid du Colombier<a href="http://www.ietf.org/rfc/rfc1951.txt">RFC 1951</a>, which is a 17043ff48bf5SDavid du Colombierdetailed specification for the method), 'gzip' (the name of a popular 17053ff48bf5SDavid du Colombiercompression application that uses it), or 'Flate' (Adobe's name). Note that 17063ff48bf5SDavid du Colombierthe PostScript <b><tt>Flate</tt></b> filters are actually a combination of 17073ff48bf5SDavid du Colombierthis filter with an optional predictor filter. 17083ff48bf5SDavid du Colombier</dl> 17093ff48bf5SDavid du Colombier 17103ff48bf5SDavid du Colombier<h3><a name="Unstable_filters"></a>Unstable filters</h3> 17113ff48bf5SDavid du Colombier 17123ff48bf5SDavid du Colombier<p> 17133ff48bf5SDavid du ColombierSome versions of Ghostscript may also support other non-standard filters for 17143ff48bf5SDavid du Colombierexperimental purposes. The current version includes the following such 17153ff48bf5SDavid du Colombierfilters, which are not documented further. No code should assume that these 17163ff48bf5SDavid du Colombierfilters will exist in compatible form, or at all, in future versions. 17173ff48bf5SDavid du Colombier 17183ff48bf5SDavid du Colombier<dl> 17193ff48bf5SDavid du Colombier<dt><b><tt><target/source> <string> ByteTranslateEncode/Decode filter <file></tt></b> 17203ff48bf5SDavid du Colombier<dd><b><tt>string</tt></b> must be a string of exactly 256 bytes. Creates a 17213ff48bf5SDavid du Colombierfilter that converts each input byte <em>b</em> to 17223ff48bf5SDavid du Colombier<b><tt>string</tt></b>[<em>b</em>]. Note that the <b><tt>Encode</tt></b> 17233ff48bf5SDavid du Colombierand <b><tt>Decode</tt></b> filters operate identically: the client must 17243ff48bf5SDavid du Colombierprovide a <b><tt>string</tt></b> for the <b><tt>Decode</tt></b> filter that 17253ff48bf5SDavid du Colombieris the inverse mapping of the <b><tt>string</tt></b> for the 17263ff48bf5SDavid du Colombier<b><tt>Encode</tt></b> filter. 17273ff48bf5SDavid du Colombier</dl> 17283ff48bf5SDavid du Colombier 17293ff48bf5SDavid du Colombier<dl> 17303ff48bf5SDavid du Colombier<dt><b><tt><target/source> <dict> BoundedHuffmanEncode/Decode filter <file></tt></b> 17313ff48bf5SDavid du Colombier<dd>These filters encode and decode data using Huffman codes. Since these 17323ff48bf5SDavid du Colombierfilters aren't used anywhere, we don't document them further, except to note 17333ff48bf5SDavid du Colombierthe recognized dictionary keys, which must be set identically for encoding 17343ff48bf5SDavid du Colombierand decoding: 17353ff48bf5SDavid du Colombier 17363ff48bf5SDavid du Colombier<blockquote> 17373ff48bf5SDavid du Colombier<b><tt>FirstBitLowOrder <bool></tt></b> (default=false)<br> 17383ff48bf5SDavid du Colombier<b><tt>MaxCodeLength <int></tt></b> (default=16)<br> 17393ff48bf5SDavid du Colombier<b><tt>EndOfData <bool></tt></b> (default=true)<br> 17403ff48bf5SDavid du Colombier<b><tt>EncodeZeroRuns <int></tt></b> (default=256)<br> 17413ff48bf5SDavid du Colombier<b><tt>Tables <int_array></tt></b> 17423ff48bf5SDavid du Colombier</blockquote> 17433ff48bf5SDavid du Colombier</dl> 17443ff48bf5SDavid du Colombier 17453ff48bf5SDavid du Colombier<dl> 17463ff48bf5SDavid du Colombier<dt><b><tt><target/source> <dict> BWBlockSortEncode/Decode filter <file></tt></b> 17473ff48bf5SDavid du Colombier<dd>This filter implements the Burroughs-Wheeler block sorting compression 17483ff48bf5SDavid du Colombiermethod, which we've heard is also used in the popular <b><tt>bzip2</tt></b> 17493ff48bf5SDavid du Colombiercompression application. See <a 17503ff48bf5SDavid du Colombierhref="http://sources.redhat.com/bzip2/">http://sources.redhat.com/bzip2/</a> 17513ff48bf5SDavid du Colombierfor more information. The only recognized dictionary key is: 17523ff48bf5SDavid du Colombier 17533ff48bf5SDavid du Colombier<blockquote> 17543ff48bf5SDavid du Colombier<b><tt>BlockSize <integer></tt></b> (default=16384) 17553ff48bf5SDavid du Colombier</blockquote> 17563ff48bf5SDavid du Colombier</dl> 17573ff48bf5SDavid du Colombier 17583ff48bf5SDavid du Colombier<dl> 17593ff48bf5SDavid du Colombier<dt><b><tt><target/source> MoveToFrontEncode/Decode filter <file></tt></b> 17603ff48bf5SDavid du Colombier 17613ff48bf5SDavid du Colombier<dd>The <b><tt>Encode</tt></b> filter starts by initializing an internal 17623ff48bf5SDavid du Colombier256-byte array <b><tt>a</tt></b> to the values 0 .. 255. This array will 17633ff48bf5SDavid du Colombieralways hold a permutation of these values. Then for each input byte 17643ff48bf5SDavid du Colombier<em>b</em>, the filter outputs the index <em>i</em> such that 17653ff48bf5SDavid du Colombier<b><tt>a</tt></b>[<em>i</em>] = <em>b</em>, and moves that element to the 17663ff48bf5SDavid du Colombierfront (element 0) of <b><tt>a</tt></b>, moving elements 0 .. <em>i-1</em> to 17673ff48bf5SDavid du Colombierpositions 1 .. <em>i</em>. The <b><tt>Decode</tt></b> filter inverts this 17683ff48bf5SDavid du Colombierprocess. 17693ff48bf5SDavid du Colombier</dl> 17703ff48bf5SDavid du Colombier 17713ff48bf5SDavid du Colombier<hr> 17723ff48bf5SDavid du Colombier 17733ff48bf5SDavid du Colombier<h2><a name="Device_parameters"></a>Device parameters</h2> 17747dd7cddfSDavid du Colombier 17757dd7cddfSDavid du ColombierGhostscript supports the concept of device parameters for all devices, not 17767dd7cddfSDavid du Colombierjust page devices. (For non-page devices, these are accessible through 17777dd7cddfSDavid du Colombier<b><tt>getdeviceprops</tt></b> and <b><tt>putdeviceprops</tt></b>, as 17787dd7cddfSDavid du Colombierindicated above.) Here are the currently defined parameters for all 17797dd7cddfSDavid du Colombierdevices: 17807dd7cddfSDavid du Colombier 17817dd7cddfSDavid du Colombier<dl> 17823ff48bf5SDavid du Colombier<a name="LockSafetyParams"></a> 17833ff48bf5SDavid du Colombier<dt><b><tt>.LockSafetyParams <boolean></tt></b> 17843ff48bf5SDavid du Colombier<dd>This parameter allows for improved system security by preventing 17853ff48bf5SDavid du ColombierPostScript programs from being able to change potentially dangerous 17863ff48bf5SDavid du Colombierdevice paramters such as OutputFile. This parameter cannot be set false 17873ff48bf5SDavid du Colombierif it is already true. 17883ff48bf5SDavid du Colombier<p> 17893ff48bf5SDavid du ColombierIf this parameter is true for the current device, attempt to set a new 17903ff48bf5SDavid du Colombierdevice that has <b><tt>.LockSafetyParams</tt></b> false will signal an 17913ff48bf5SDavid du Colombier<tt><b> invalidaccess</b></tt> error. 17923ff48bf5SDavid du Colombier</dl> 17933ff48bf5SDavid du Colombier 17943ff48bf5SDavid du Colombier<dl> 17957dd7cddfSDavid du Colombier<dt><b><tt>BitsPerPixel <integer> (usually read-only)</tt></b> 17967dd7cddfSDavid du Colombier<dd>Number of bits per pixel. 17977dd7cddfSDavid du Colombier</dl> 17987dd7cddfSDavid du Colombier 17997dd7cddfSDavid du Colombier<dl> 18007dd7cddfSDavid du Colombier<dt><b><tt>.HWMargins [<four floats>]</tt></b> 18017dd7cddfSDavid du Colombier<dd>Size of non-imageable regions around the edges of the page, in points 18027dd7cddfSDavid du Colombier(units of 1/72in; see the <a href="Devices.htm#Measurements">notes on 18037dd7cddfSDavid du Colombiermeasurements</a> in the documentation on devices). 18047dd7cddfSDavid du Colombier</dl> 18057dd7cddfSDavid du Colombier 18067dd7cddfSDavid du Colombier<dl> 18077dd7cddfSDavid du Colombier<dt><b><tt>HWSize [<integer> <integer>]</tt></b> 18087dd7cddfSDavid du Colombier<dd>X and Y size in pixels. 18097dd7cddfSDavid du Colombier</dl> 18107dd7cddfSDavid du Colombier 18117dd7cddfSDavid du Colombier<dl> 18127dd7cddfSDavid du Colombier<dt><b><tt>Name <string> (read-only)</tt></b> 18137dd7cddfSDavid du Colombier<dd>The device name. Currently the same as <b><tt>OutputDevice</tt></b>. 18147dd7cddfSDavid du Colombier</dl> 18157dd7cddfSDavid du Colombier 18167dd7cddfSDavid du Colombier<dl> 18177dd7cddfSDavid du Colombier<dt><b><tt>Colors, GrayValues, RedValues, GreenValues, BlueValues, ColorValues (usually read-only)</tt></b> 18187dd7cddfSDavid du Colombier<dd>As for the <b><tt>deviceinfo</tt></b> operator of Display PostScript. 18197dd7cddfSDavid du Colombier<b><tt>Red</tt></b>, <b><tt>Green</tt></b>, <b><tt>Blue</tt></b>, and 18207dd7cddfSDavid du Colombier<b><tt>ColorValues</tt></b> are only defined if 18217dd7cddfSDavid du Colombier<b><tt>Colors</tt></b> > 1. 18227dd7cddfSDavid du Colombier</dl> 18237dd7cddfSDavid du Colombier 18247dd7cddfSDavid du Colombier<dl> 18257dd7cddfSDavid du Colombier<dt><b><tt>TextAlphaBits, GraphicsAlphaBits (usually read-only)</tt></b> 18267dd7cddfSDavid du Colombier<dd>The number of bits of anti-aliasing information for text or graphics 18277dd7cddfSDavid du Colombierrespectively. Legal values are 1 (no anti-aliasing, the default for most 18287dd7cddfSDavid du Colombierdevices), 2, or 4. 18297dd7cddfSDavid du Colombier</dl> 18307dd7cddfSDavid du Colombier 18317dd7cddfSDavid du Colombier<p> 1832*593dc095SDavid du ColombierGhostscript also supports the following read-only parameter that is not a 1833*593dc095SDavid du Colombiertrue device parameter: 1834*593dc095SDavid du Colombier 1835*593dc095SDavid du Colombier<dl> 1836*593dc095SDavid du Colombier<dt><b><tt>.EmbedFontObjects <integer></tt></b> 1837*593dc095SDavid du Colombier<dd>If non-zero, indicates that the device may embed font objects (as 1838*593dc095SDavid du Colombieropposed to bitmaps for individual characters) in the output. The purpose of 1839*593dc095SDavid du Colombierthis parameter is to disable third-party font renderers for such devices. 1840*593dc095SDavid du Colombier(This is zero for almost all devices.) 1841*593dc095SDavid du Colombier</dl> 1842*593dc095SDavid du Colombier 1843*593dc095SDavid du Colombier<p> 18447dd7cddfSDavid du ColombierIn addition, the following are defined per Adobe's documentation for the 18457dd7cddfSDavid du Colombier<b><tt>setpagedevice</tt></b> operator: 18467dd7cddfSDavid du Colombier 18477dd7cddfSDavid du Colombier<blockquote> 18487dd7cddfSDavid du Colombier<b><tt>Duplex</tt></b> (if supported)<br> 18497dd7cddfSDavid du Colombier<b><tt>HWResolution</tt></b><br> 18507dd7cddfSDavid du Colombier<b><tt>ImagingBBox</tt></b><br> 18517dd7cddfSDavid du Colombier<b><tt>Margins</tt></b><br> 18527dd7cddfSDavid du Colombier<b><tt>NumCopies</tt></b> (for printers only)<br> 18537dd7cddfSDavid du Colombier<b><tt>Orientation</tt></b> (if supported)<br> 18547dd7cddfSDavid du Colombier<b><tt>OutputDevice</tt></b><br> 18557dd7cddfSDavid du Colombier<b><tt>PageOffset</tt></b> (write-only)<br> 18567dd7cddfSDavid du Colombier<b><tt>PageSize</tt></b><br> 18577dd7cddfSDavid du Colombier<b><tt>ProcessColorModel</tt></b> (usually read-only)<br> 18587dd7cddfSDavid du Colombier</blockquote> 18597dd7cddfSDavid du Colombier 18607dd7cddfSDavid du Colombier<p> 18617dd7cddfSDavid du ColombierSome devices may only allow certain values for <b><tt>HWResolution</tt></b> 18627dd7cddfSDavid du Colombierand <b><tt>PageSize</tt></b>. The null device ignores attempts to set 18637dd7cddfSDavid du Colombier<b><tt>PageSize</tt></b>; its size is always <b><tt>[0 0]</tt></b>. 18647dd7cddfSDavid du Colombier 18657dd7cddfSDavid du Colombier<p> 1866*593dc095SDavid du ColombierIt should be noted that calling <tt>setpagedevice</tt> with one of the above keys may reset the effects of any <b><tt>pdfmark</tt></b> commands up to that point. In particular this is true of HWResolution, a behavior that differs from Adobe Distiller. 1867*593dc095SDavid du Colombier 1868*593dc095SDavid du Colombier<p> 18697dd7cddfSDavid du ColombierFor printers these are also defined: 18707dd7cddfSDavid du Colombier 18717dd7cddfSDavid du Colombier<dl> 18727dd7cddfSDavid du Colombier<dt><b><tt>BufferSpace <integer></tt></b> 18737dd7cddfSDavid du Colombier<dd>Buffer space for band lists, if the bitmap is too big to fit in memory. 18747dd7cddfSDavid du Colombier</dl> 18757dd7cddfSDavid du Colombier 18767dd7cddfSDavid du Colombier<dl> 18777dd7cddfSDavid du Colombier<dt><b><tt>MaxBitmap <integer></tt></b> 18787dd7cddfSDavid du Colombier<dd>Maximum space for a full bitmap in memory. 18797dd7cddfSDavid du Colombier</dl> 18807dd7cddfSDavid du Colombier 18817dd7cddfSDavid du Colombier<dl> 18827dd7cddfSDavid du Colombier<dt><b><tt>OutputFile <string></tt></b> 18837dd7cddfSDavid du Colombier 18847dd7cddfSDavid du Colombier<dd>An empty string means "send to printer directly", otherwise specifies 1885*593dc095SDavid du Colombierthe file name for output; <b><tt>%d</tt></b> is replaced by the page number 1886*593dc095SDavid du Colombierfor page-oriented output devices; 18877dd7cddfSDavid du Colombieron Unix systems <b><tt>%pipe%</tt></b><em>command</em> writes to a pipe. 18887dd7cddfSDavid du Colombier(<b><tt>|</tt></b><em>command</em> also writes to a pipe, but is now 18897dd7cddfSDavid du Colombierdeprecated.) 18903ff48bf5SDavid du Colombier<p> 18913ff48bf5SDavid du ColombierAttempts to set this parameter if <tt><b>.LockSafetyParams</b></tt> is true 18923ff48bf5SDavid du Colombierwill signal an <tt><b>invalidaccess</b></tt> error. 18937dd7cddfSDavid du Colombier</dl> 18947dd7cddfSDavid du Colombier 18957dd7cddfSDavid du Colombier<dl> 18967dd7cddfSDavid du Colombier<dt><b><tt>OpenOutputFile <boolean></tt></b> 18977dd7cddfSDavid du Colombier<dd>If true, open the device's output file when the device is opened, 18987dd7cddfSDavid du Colombierrather than waiting until the first page is ready to print. 18997dd7cddfSDavid du Colombier</dl> 19007dd7cddfSDavid du Colombier 19017dd7cddfSDavid du Colombier<dl> 19027dd7cddfSDavid du Colombier<dt><b><tt>PageCount <integer> (read-only)</tt></b> 19037dd7cddfSDavid du Colombier<dd>Counts the number of pages printed on the device. 19047dd7cddfSDavid du Colombier</dl> 19057dd7cddfSDavid du Colombier 19067dd7cddfSDavid du Colombier<p> 19077dd7cddfSDavid du ColombierThe following parameters are for use only by very specialized applications 19087dd7cddfSDavid du Colombierthat separate band construction from band rasterization. Improper use may 19097dd7cddfSDavid du Colombiercause unpredictable errors. In particular, if you only want to allocate 19107dd7cddfSDavid du Colombiermore memory for banding, to increase band size and improve performance, use 19117dd7cddfSDavid du Colombierthe <b><tt>BufferSpace</tt></b> parameter, not 19127dd7cddfSDavid du Colombier<b><tt>BandBufferSpace</tt></b>. 19137dd7cddfSDavid du Colombier 19147dd7cddfSDavid du Colombier<dl> 19157dd7cddfSDavid du Colombier<dt><b><tt>BandHeight <integer></tt></b> 19167dd7cddfSDavid du Colombier<dd>The height of bands when banding. 0 means use the largest band height 19177dd7cddfSDavid du Colombierthat will fit within the BandBufferSpace (or BufferSpace, if 19187dd7cddfSDavid du ColombierBandBufferSpace is not specified). 19197dd7cddfSDavid du Colombier</dl> 19207dd7cddfSDavid du Colombier 19217dd7cddfSDavid du Colombier<dl> 19227dd7cddfSDavid du Colombier<dt><b><tt>BandWidth <integer></tt></b> 19237dd7cddfSDavid du Colombier<dd>The width of bands in the rasterizing pass, in pixels. 0 means use the 19247dd7cddfSDavid du Colombieractual page width. 19257dd7cddfSDavid du Colombier</dl> 19267dd7cddfSDavid du Colombier 19277dd7cddfSDavid du Colombier<dl> 19287dd7cddfSDavid du Colombier<dt><b><tt>BandBufferSpace <integer></tt></b> 19297dd7cddfSDavid du Colombier<dd>The size of the band buffer in the rasterizing pass, in bytes. 0 means 19307dd7cddfSDavid du Colombieruse the same buffer size as for the interpretation pass. 19317dd7cddfSDavid du Colombier</dl> 19327dd7cddfSDavid du Colombier 19337dd7cddfSDavid du Colombier<p> 19343ff48bf5SDavid du ColombierGhostscript supports the following parameter for 19357dd7cddfSDavid du Colombier<b><tt>setpagedevice</tt></b> and <b><tt>currentpagedevice</tt></b> that is 19363ff48bf5SDavid du Colombiernot a device parameter per se: 19377dd7cddfSDavid du Colombier 19387dd7cddfSDavid du Colombier<dl> 19397dd7cddfSDavid du Colombier<dt><b><tt>ViewerPreProcess <procedure></tt></b> 19407dd7cddfSDavid du Colombier<dd>Specifies a procedure to be applied to the page device dictionary 19417dd7cddfSDavid du Colombierbefore any other processing is done. The procedure may not alter the 19427dd7cddfSDavid du Colombierdictionary, but it may return a modified copy. This "hook" is provided for 19437dd7cddfSDavid du Colombieruse by viewing programs such as GSview. 19447dd7cddfSDavid du Colombier</dl> 19457dd7cddfSDavid du Colombier 19467dd7cddfSDavid du Colombier<hr> 19477dd7cddfSDavid du Colombier 19483ff48bf5SDavid du Colombier<h2><a name="User_parameters"></a>User parameters</h2> 19493ff48bf5SDavid du Colombier 19503ff48bf5SDavid du ColombierGhostscript supports the following non-standard user parameters: 19513ff48bf5SDavid du Colombier 19523ff48bf5SDavid du Colombier<dl> 19533ff48bf5SDavid du Colombier<dt><b><tt>ProcessDSCComment <procedure|null></tt></b> 19543ff48bf5SDavid du Colombier<dd>If not null, this procedure is called whenever the scanner detects a DSC 19553ff48bf5SDavid du Colombiercomment (comment beginning with <b><tt>%%</tt></b> or <b><tt>%!</tt></b>). 19563ff48bf5SDavid du ColombierThere are two operands, the file and the comment (minus any terminating 19573ff48bf5SDavid du ColombierEOL), which the procedure must consume. 19583ff48bf5SDavid du Colombier</dl> 19593ff48bf5SDavid du Colombier 19603ff48bf5SDavid du Colombier<dl> 19613ff48bf5SDavid du Colombier<dt><b><tt>ProcessComment <procedure|null></tt></b> 19623ff48bf5SDavid du Colombier<dd>If not null, this procedure is called whenever the scanner detects a 19633ff48bf5SDavid du Colombiercomment (or, if <b><tt>ProcessDSCComment</tt></b> is also not null, a 19643ff48bf5SDavid du Colombiercomment other than a DSC comment). The operands are the same as for 19653ff48bf5SDavid du Colombier<b><tt>ProcessDSCComment</tt></b>. 19663ff48bf5SDavid du Colombier</dl> 19673ff48bf5SDavid du Colombier 19683ff48bf5SDavid du Colombier<dl> 19693ff48bf5SDavid du Colombier<dt><b><tt>LockFilePermissions <boolean></tt></b> 19703ff48bf5SDavid du Colombier<dd>If <tt>true</tt>, this parameter and the three <tt>PermitFile...</tt> 19713ff48bf5SDavid du Colombierparameters cannot be changed. Attempts to change any of the values 19723ff48bf5SDavid du Colombierwhen LockFilePermissions is <tt>true</tt> will signal <b><tt>invalidaccess</tt></b>. 19733ff48bf5SDavid du ColombierAlso, when this value is <tt>true</tt>, the <b><tt>file</tt></b> operator 19743ff48bf5SDavid du Colombierwill give <b><tt>invalidaccess</tt></b> when attempting to open files 19753ff48bf5SDavid du Colombier(processes) using the <b><tt>%pipe</tt></b> device. 19763ff48bf5SDavid du Colombier<p> 19773ff48bf5SDavid du ColombierAlso when <b><tt>LockFilePermissions</tt></b> is <tt>true</tt>, strings 19783ff48bf5SDavid du Colombiercannot reference the parent directory (platform specific). For example 19793ff48bf5SDavid du Colombier<b><tt>(../../xyz)</tt></b> is illegal on unix, Windows 19803ff48bf5SDavid du Colombierand Macintosh, and <b><tt>([.#.#.XYZ])</tt></b> is illegal on VMS. 19813ff48bf5SDavid du Colombier<p> 19823ff48bf5SDavid du ColombierThis parameter is set <tt>true</tt> by the <b><tt>.setsafe</tt></b> and 19833ff48bf5SDavid du Colombier<b><tt>.locksafe</tt></b> operators. 19843ff48bf5SDavid du Colombier</dl> 19853ff48bf5SDavid du Colombier 19863ff48bf5SDavid du Colombier<dl> 19873ff48bf5SDavid du Colombier<dt><b><tt>PermitFileReading <array of strings></tt></b> 19883ff48bf5SDavid du Colombier<dt><b><tt>PermitFileWriting <array of strings></tt></b> 19893ff48bf5SDavid du Colombier<dt><b><tt>PermitFileControl <array of strings></tt></b> 19903ff48bf5SDavid du Colombier<dd>These parameters specify paths where file reading, writing and the 19913ff48bf5SDavid du Colombier'control' operations are permitted, respectively. File control 19923ff48bf5SDavid du Colombieroperations are <b><tt>deletefile</tt></b> and <b><tt>renamefile</tt></b>. 19933ff48bf5SDavid du ColombierFor <b><tt>renamefile</tt></b>, the filename for the current filename 19943ff48bf5SDavid du Colombiermust match one of the paths on the PermitFileControl list, and the 19953ff48bf5SDavid du Colombiernew filename must be on <b>both</b> the PermitFileControl and the 19963ff48bf5SDavid du ColombierPermitFileWriting lists of paths. 19973ff48bf5SDavid du Colombier<p> 19983ff48bf5SDavid du ColombierThe strings can contain wildcard characters as for the <b><tt>filenameforall</tt></b> 19993ff48bf5SDavid du Colombieroperator and unless specifying a single file, will end with a <b>*</b> 20003ff48bf5SDavid du Colombierfor directories (folders) to allow access to all files and sub-directories 20013ff48bf5SDavid du Colombierin that directory. 20023ff48bf5SDavid du Colombier<p> 20033ff48bf5SDavid du Colombier<b>Note:</b> The strings are used for stringmatch operations similar 20043ff48bf5SDavid du Colombierto <b><tt>filenameforall</tt></b>, thus on MS Windows platforms, use the '/' 20053ff48bf5SDavid du Colombiercharacter to separate directories and filenames or use '\\\\' to 20063ff48bf5SDavid du Colombierhave the string contain '\\' which will match a single '\' in the 20073ff48bf5SDavid du Colombiertarget filename (use of '/' is strongly recommended). 20083ff48bf5SDavid du Colombier<p> 20093ff48bf5SDavid du ColombierThe <a href=Use.htm#Safer><b>SAFER</b></a> mode and the 20103ff48bf5SDavid du Colombier<b><tt>.setsafe</tt></b> operator set all three lists to empty arrays, 20113ff48bf5SDavid du Colombierthus the only files that can be read are the <b><tt>%stdin</tt></b> device and 20123ff48bf5SDavid du Colombieron LIBPATH or FONTPATH or the Resource paths specified by the /FontResourceDir 20133ff48bf5SDavid du Colombieror /GenericResourceDir system params. Files cannot be opened for writing 20143ff48bf5SDavid du Colombieranywhere and cannot be deleted or renamed except for files created with the 20153ff48bf5SDavid du Colombier<a href=#Tempfile><b>.tempfile</b></a> operator). 2016*593dc095SDavid du Colombier<p> 2017*593dc095SDavid du Colombier<b>Note: </b>Limiting file reading as above is <b>NOT</b> compatible with 2018*593dc095SDavid du ColombierSAFER mode in release versions before 7.11 and corresponds to the use of 2019*593dc095SDavid du Colombier<b><tt>-dPARANOIDSAFER</tt></b> in version 7.04 (up to and not including 2020*593dc095SDavid du Colombierversion 7.10) and GPL versions 6.53 (up to and not including 6.60). 2021*593dc095SDavid du Colombier</dl> 2022*593dc095SDavid du Colombier 2023*593dc095SDavid du Colombier<dl> 2024*593dc095SDavid du Colombier<dt><b><tt>AlignToPixels <integer></tt></b> 2025*593dc095SDavid du Colombier<dd>Control sub-pixel positioning of character glyphs (where 2026*593dc095SDavid du Colombierapplicable). A value of 1 specifies alignment of text characters to 2027*593dc095SDavid du Colombierpixels boundaries. A value of 0 to subpixels where the division factor 2028*593dc095SDavid du Colombieris set by the device parameter <b><tt>TextAlphaBits</tt></b>. If the 2029*593dc095SDavid du Colombierlatter is 1, the same rendering results regardless of the value of 2030*593dc095SDavid du Colombier<b><tt>AlignToPixels</tt></b>. The initial value defaults to 1, but this 2031*593dc095SDavid du Colombiermay be overridden by the command line argument 2032*593dc095SDavid du Colombier<b><tt>-dAlignToPixels</tt></b>. 2033*593dc095SDavid du Colombier</dl> 2034*593dc095SDavid du Colombier 2035*593dc095SDavid du Colombier 2036*593dc095SDavid du Colombier<dl> 2037*593dc095SDavid du Colombier<a name="GridFitTT"></a> 2038*593dc095SDavid du Colombier<dt><b><tt>GridFitTT <integer></tt></b> 2039*593dc095SDavid du Colombier<dd>Control the use of True Type grid fitting. 2040*593dc095SDavid du ColombierGhostscript implements a reduced True Type bytecode interpreter, 2041*593dc095SDavid du Colombierwhich can interpret the subset of True Type glyph instructions 2042*593dc095SDavid du Colombiernot covered by Apple's patents. This allows proper rasterization 2043*593dc095SDavid du Colombierof the Dynalab fonts. 2044*593dc095SDavid du Colombier<p> 2045*593dc095SDavid du ColombierThe reduced interpreter can't properly grid fit 2046*593dc095SDavid du Colombierfonts with patented instructions. Therefore Ghostscript implements 2047*593dc095SDavid du Colombieranother grid fitting method for True Type fonts, based on a spot topology analysis. 2048*593dc095SDavid du Colombier<p> 2049*593dc095SDavid du ColombierThis parameter controls the action of the reduced interpreter and the grid fitter: 2050*593dc095SDavid du Colombier<ul> 2051*593dc095SDavid du Colombier<li> 2052*593dc095SDavid du ColombierA value of 0 disables grid fitting for all True Type fonts. This is a backward compatibility mode. 2053*593dc095SDavid du Colombier</li> 2054*593dc095SDavid du Colombier 2055*593dc095SDavid du Colombier<li> 2056*593dc095SDavid du ColombierA value of 1 enables the grid fitting for glyphs that don't involve 2057*593dc095SDavid du Colombierpatented instructions, using the reduced True Type bytecode interpreter. 2058*593dc095SDavid du ColombierWhen a patented instruction is encountered, a warning is printed to stderr, 2059*593dc095SDavid du Colombierand the glyph is rendered ignoring the entire grid fitting program. 2060*593dc095SDavid du Colombier</li> 2061*593dc095SDavid du Colombier 2062*593dc095SDavid du Colombier<li> 2063*593dc095SDavid du ColombierA value of 2 invokes the topological grid fitter. This value is recommended 2064*593dc095SDavid du Colombierfor common use. 2065*593dc095SDavid du Colombier</li> 2066*593dc095SDavid du Colombier 2067*593dc095SDavid du Colombier<li> 2068*593dc095SDavid du ColombierA value of 3 specifies that the bytecode interpreter to be used 2069*593dc095SDavid du Colombierto grid fit glyphs that have no patented instructions, 2070*593dc095SDavid du Colombierand other glyphs are grid fitted topologically. This mode may 2071*593dc095SDavid du Colombierimprove the rendering of some fonts, but in general the best result 2072*593dc095SDavid du Colombieris not guaranteed. 2073*593dc095SDavid du Colombier</li> 2074*593dc095SDavid du Colombier</ul> 2075*593dc095SDavid du Colombier<p> 2076*593dc095SDavid du ColombierThis parameter defaults to 2, but this 2077*593dc095SDavid du Colombiermay be overridden on the command line with 2078*593dc095SDavid du Colombier<b><tt>-dGridFitTT=n</tt></b>. 2079*593dc095SDavid du Colombier<p> 2080*593dc095SDavid du ColombierThe reduced bytecode interpreter is based in part of the work of the 2081*593dc095SDavid du Colombier<a href="http://freetype.org/">FreeType</a> Team. 2082*593dc095SDavid du ColombierThe topological grid fitting is a new original Ghostscript method. 2083*593dc095SDavid du Colombier</dl> 2084*593dc095SDavid du Colombier 2085*593dc095SDavid du Colombier<dl> 2086*593dc095SDavid du Colombier<dt><b><tt>UseWTS <boolean></tt></b> 2087*593dc095SDavid du Colombier<dd>If <tt>true</tt>, and if AccurateScreens are specified (either as 2088*593dc095SDavid du Colombiera user parameter, or as a type 1 halftone dictionary parameter), then 2089*593dc095SDavid du Colombierthe Well Tempered Screening algorithm is used for 2090*593dc095SDavid du Colombierhalftoning. Otherwise, a rational tangent algorithm is chosen, which 2091*593dc095SDavid du Colombierwill typically result in significant differences between the screen 2092*593dc095SDavid du Colombierangle and ruling requested, and actually rendered. Currently, the 2093*593dc095SDavid du Colombierperformance of WTS is reasonably good when rendering to a full page 2094*593dc095SDavid du Colombierbuffer, but not optimized for banded mode. Thus, when using WTS, 2095*593dc095SDavid du Colombierdisable banding (setting 2096*593dc095SDavid du Colombier<b><tt>-dMaxBitmap=500000000</tt></b> should work). In a future 2097*593dc095SDavid du Colombierversion, WTS will be optimized for banded mode, and 2098*593dc095SDavid du Colombier<b><tt>UseWTS</tt></b> will be <tt>true</tt> by default. 2099*593dc095SDavid du Colombier 2100*593dc095SDavid du Colombier<p> 2101*593dc095SDavid du Colombier<b>Note:</b> Currently, <b><tt>UseWTS</tt></b> can only be set using 2102*593dc095SDavid du Colombierthe PostScript user parameters mechanism, not on the command line with 2103*593dc095SDavid du Colombiera <b><tt>-d</tt></b> switch. Use this code to enable it: 2104*593dc095SDavid du Colombier 2105*593dc095SDavid du Colombier<blockquote><pre> 2106*593dc095SDavid du Colombier<< /UseWTS true >> setuserparams 2107*593dc095SDavid du Colombier</pre></blockquote> 21083ff48bf5SDavid du Colombier</dl> 21093ff48bf5SDavid du Colombier 21103ff48bf5SDavid du Colombier<hr> 21113ff48bf5SDavid du Colombier 21123ff48bf5SDavid du Colombier<h2><a name="Miscellaneous_additions"></a>Miscellaneous additions</h2> 21137dd7cddfSDavid du Colombier 2114*593dc095SDavid du Colombier<h3><a name="Extended_semantics_of_run"></a>Extended semantics of 'run'</h3> 2115*593dc095SDavid du Colombier 2116*593dc095SDavid du Colombier<p> 2117*593dc095SDavid du ColombierThe operator <b><tt>run</tt></b> can take either a string or a file as its argument. In 21187dd7cddfSDavid du Colombierthe latter case, it just runs the file, closing it at the end, and trapping 21197dd7cddfSDavid du Colombiererrors just as for the string case. 21207dd7cddfSDavid du Colombier 2121*593dc095SDavid du Colombier<h3><a name="DecodingResources"></a>Decoding resources</h3> 2122*593dc095SDavid du Colombier 2123*593dc095SDavid du Colombier<p> 2124*593dc095SDavid du Colombier<b><tt>Decoding</tt></b> is a Ghostscript-specific resource category. It contains 2125*593dc095SDavid du Colombiervarious resources for emulating PostScript fonts with other font technologies. 2126*593dc095SDavid du ColombierInstances of the <tt>Decoding</tt> category are tables which map PostScript glyph 2127*593dc095SDavid du Colombiernames to character codes used with TrueType, Intellifont, Microtype and other font formats. 2128*593dc095SDavid du Colombier 2129*593dc095SDavid du Colombier<p> 2130*593dc095SDavid du ColombierCurrently Ghostscript is capable of PostScript font emulation in 2 ways : 2131*593dc095SDavid du Colombier<li> 2132*593dc095SDavid du Colombier1. Through <a href="./Use.htm#FAPI_run">FAPI</a> plugins, and 2133*593dc095SDavid du Colombier</li> 2134*593dc095SDavid du Colombier<li> 2135*593dc095SDavid du Colombier2. With TrueType font files, using the native font renderer, by 2136*593dc095SDavid du Colombierspecifying TrueType font names or files in <a href="../lib/Fontmap">lib/Fontmap</a>. 2137*593dc095SDavid du Colombier</li> 2138*593dc095SDavid du Colombier<p> 2139*593dc095SDavid du Colombier<b><tt>Decoding</tt></b> resources are not current used by the native font renderer. 2140*593dc095SDavid du Colombier 2141*593dc095SDavid du Colombier<p> 2142*593dc095SDavid du ColombierAn instance of the <b><tt>Decoding</tt></b> resource category is 2143*593dc095SDavid du Colombiera dictionary. The dictionary keys are PostScript glyph names and the 2144*593dc095SDavid du Colombiervalues are character codes. The name of the resource instance should 2145*593dc095SDavid du Colombierreflect the character set for which it maps. For example, 2146*593dc095SDavid du Colombier<b><tt>/Unicode</tt></b> <b><tt>/Decoding</tt></b> resource maps to 2147*593dc095SDavid du ColombierUnicode UTF-16. 2148*593dc095SDavid du Colombier 2149*593dc095SDavid du Colombier<p> 2150*593dc095SDavid du ColombierThe rules for using <b><tt>Decoding</tt></b> resources in particular 2151*593dc095SDavid du Colombiercases are specified in the configuration file 2152*593dc095SDavid du Colombier<a href="../lib/xlatmap">lib/xlatmap</a>. See the file itself for more 2153*593dc095SDavid du Colombierinformation. 2154*593dc095SDavid du Colombier 2155*593dc095SDavid du Colombier<p> 2156*593dc095SDavid du ColombierThe file format for <b><tt>Decoding</tt></b> resource files is 2157*593dc095SDavid du Colombiergeneric PostScript. 2158*593dc095SDavid du ColombierUsers may want to define custom <b><tt>Decoding</tt></b> resources. 2159*593dc095SDavid du ColombierThe <b><tt>ParseDecoding</tt></b> procset defined in 2160*593dc095SDavid du Colombier<a href="../lib/gs_ciddc.ps">lib/gs_ciddc.ps</a> allows representation 2161*593dc095SDavid du Colombierof the table in a comfortable form. 2162*593dc095SDavid du Colombier 2163*593dc095SDavid du Colombier 2164*593dc095SDavid du Colombier<h3><a name="CIDDecodingResources"></a>CIDDecoding resources</h3> 2165*593dc095SDavid du Colombier 2166*593dc095SDavid du Colombier<p> 2167*593dc095SDavid du Colombier<b><tt>CIDDecoding</tt></b> resources are similar to <b><tt>Decoding</tt></b> 2168*593dc095SDavid du Colombierresources, except they map Charaacter Identifiers (CIDs) rather than glyph names. 2169*593dc095SDavid du ColombierAnother difference is that the native Ghostscript font renderer already uses 2170*593dc095SDavid du Colombier<b><tt>CIDDecoding</tt></b> resources while emulate CID fonts with TrueType. 2171*593dc095SDavid du Colombier 2172*593dc095SDavid du Colombier<p> 2173*593dc095SDavid du ColombierAn instance of the <b><tt>CIDDecoding</tt></b> resource category is 2174*593dc095SDavid du Colombiera dictionary of strings. Keys in the dictionary are integers, 2175*593dc095SDavid du Colombierwhich correspond to high order byte of a CID. Values are 2176*593dc095SDavid du Colombier512-bytes strings. Each string represents 256 character codes, 2177*593dc095SDavid du Colombiercorresponding various values of the lower byte of CID. 2178*593dc095SDavid du ColombierEach character code ocupies 2 bytes, high order byte first. 2179*593dc095SDavid du ColombierTwo zero bytes represent mapping to the default character. 2180*593dc095SDavid du Colombier 2181*593dc095SDavid du Colombier<p> 2182*593dc095SDavid du ColombierThe Ghostscript library is capable of generating some <b><tt>CIDDecoding</tt></b> 2183*593dc095SDavid du Colombierinstances automatically, using the appropriate <b><tt>CMap</tt></b> (character map) 2184*593dc095SDavid du Colombierresources. This covers most of practical cases if the neccessary <b><tt>CMap</tt></b> 2185*593dc095SDavid du Colombierresources are provided. See the table <b><tt>.CMapChooser</tt></b> in 2186*593dc095SDavid du Colombier<a href="../lib/gs_ciddc.ps">lib/gs_ciddc.ps</a> 2187*593dc095SDavid du Colombierfor the names of automatically gerenated resources and associated <b><tt>CMap</tt></b>s. 2188*593dc095SDavid du ColombierThey allow to mapping CNS1, GB1, Japan1, Japan2 and Korea1 CID sets to TrueType 2189*593dc095SDavid du Colombiercharacter sets known as Unicode (exactly UTF-16), Big5, 2190*593dc095SDavid du ColombierGB1213, ShiftJIS, Johab and Wansung. 2191*593dc095SDavid du Colombier 2192*593dc095SDavid du Colombier<p> 2193*593dc095SDavid du ColombierThe file format for <b><tt>CIDDecoding</tt></b> resource file is 2194*593dc095SDavid du Colombiergeneric PostScript. 2195*593dc095SDavid du ColombierUsers may want to define custom resources to <b><tt>CIDDecoding</tt></b> 2196*593dc095SDavid du Colombierresource category. 2197*593dc095SDavid du Colombier 2198*593dc095SDavid du Colombier<h3><a name="GlyphNames2Unicode"></a>GlyphNames2Unicode</h3> 2199*593dc095SDavid du Colombier<p> 2200*593dc095SDavid du Colombier<b><tt>GlyphNames2Unicode</tt></b> is an undocumented dictionary which Adobe 2201*593dc095SDavid du ColombierPostScript printer driver uses to communicate with Adobe Distiller. 2202*593dc095SDavid du ColombierIn this dictionary the keys are glyph names, the values are Unicode UTF-16 codes for them. 2203*593dc095SDavid du ColombierThe dictionaly is stored in the <b><tt>FontInfo</tt></b> dictionary under 2204*593dc095SDavid du Colombierthe key <b><tt>GlyphNames2Unicode</tt></b>. Ghostscript recognises it and uses 2205*593dc095SDavid du Colombierto generate <b><tt>ToUnicode</tt></b> CMaps with pdfwrite. 2206*593dc095SDavid du Colombier<p> 2207*593dc095SDavid du Colombier 2208*593dc095SDavid du Colombier<h3><a name="MultipleResourceDirectories"></a>Multiple Resource directories</h3> 2209*593dc095SDavid du Colombier 2210*593dc095SDavid du Colombier<p> 2211*593dc095SDavid du ColombierSince 8.10 release Ghostscript maintains multiple resource directories. 2212*593dc095SDavid du Colombier 2213*593dc095SDavid du Colombier<p> 2214*593dc095SDavid du ColombierGhostscript does not distinguish <b><tt>lib</b></tt> and <b><tt>Resource</b></tt> directories. 2215*593dc095SDavid du ColombierThere is no file name conflicts because 2216*593dc095SDavid du Colombier<b><tt>lib</b></tt> does not contain subdirectories, but <b><tt>Resource</b></tt> 2217*593dc095SDavid du Colombieralways store files in subdirectories. 2218*593dc095SDavid du Colombier 2219*593dc095SDavid du Colombier<p> 2220*593dc095SDavid du ColombierThe search method with multiple resource directories 2221*593dc095SDavid du Colombierappears not fully conforming to PLRM. We cannot unconditionally call 2222*593dc095SDavid du Colombier<b><tt>ResourceFileName</b></tt> while executing <b><tt>findresource</b></tt> 2223*593dc095SDavid du Colombieror <b><tt>resourcestatus</b></tt>, <b><tt>resourceforall</b></tt>, because per PLRM it always 2224*593dc095SDavid du Colombierreturns a single path. Therefore Ghostscript implements 2225*593dc095SDavid du Colombieran extended search method in <b><tt>findresource</b></tt>, 2226*593dc095SDavid du Colombier<b><tt>resourcestatus</b></tt> and <b><tt>resourceforall</b></tt>, which first calls 2227*593dc095SDavid du Colombier<b><tt>ResourceFileName</b></tt> and checks whether the returned path 2228*593dc095SDavid du Colombierpoints to an existing file. If yes, the file is used, 2229*593dc095SDavid du Colombierothervise Ghostscript searches all directories specified in 2230*593dc095SDavid du Colombier<b><tt>LIB_PATH</tt></b>. With a single resource directory 2231*593dc095SDavid du Colombierit appears conforming to PLRM and equivalent to Adobe implementations. 2232*593dc095SDavid du Colombier 2233*593dc095SDavid du Colombier<p> 2234*593dc095SDavid du Colombier<b><tt>ResourceFileName</b></tt> may be used for obtaining a path 2235*593dc095SDavid du Colombierwhere a resource file to be installed. In this case 2236*593dc095SDavid du ColombierGhostscript to be invoked with <b><tt>-sGenericResourceDir=path</b></tt>, 2237*593dc095SDavid du Colombierspecifying an absolute path. The default value for 2238*593dc095SDavid du Colombier<b><tt>GenericResourceDir</b></tt> is a relative path. Therefore 2239*593dc095SDavid du Colombiera default invocation with a PostScript installer 2240*593dc095SDavid du Colombierwill install resource files into <b><tt>/gs/Resource</tt></b>. 2241*593dc095SDavid du Colombier 2242*593dc095SDavid du Colombier<p> 2243*593dc095SDavid du Colombier 22447dd7cddfSDavid du Colombier<!-- [2.0 end contents] ==================================================== --> 22457dd7cddfSDavid du Colombier 22467dd7cddfSDavid du Colombier<!-- [3.0 begin visible trailer] =========================================== --> 22477dd7cddfSDavid du Colombier<hr> 22487dd7cddfSDavid du Colombier 22493ff48bf5SDavid du Colombier<p> 2250*593dc095SDavid du Colombier<small>Copyright © 1996-2005 artofcode LLC. All rights 22513ff48bf5SDavid du Colombierreserved.</small> 22527dd7cddfSDavid du Colombier 22537dd7cddfSDavid du Colombier<p> 2254*593dc095SDavid du ColombierThis software is provided AS-IS with no warranty, either express or 2255*593dc095SDavid du Colombierimplied. 2256*593dc095SDavid du Colombier 2257*593dc095SDavid du ColombierThis software is distributed under license and may not be copied, 2258*593dc095SDavid du Colombiermodified or distributed except as expressly authorized under the terms 2259*593dc095SDavid du Colombierof the license contained in the file LICENSE in this distribution. 2260*593dc095SDavid du Colombier 2261*593dc095SDavid du ColombierFor more information about licensing, please refer to 2262*593dc095SDavid du Colombierhttp://www.ghostscript.com/licensing/. For information on 2263*593dc095SDavid du Colombiercommercial licensing, go to http://www.artifex.com/licensing/ or 2264*593dc095SDavid du Colombiercontact Artifex Software, Inc., 101 Lucas Valley Road #110, 2265*593dc095SDavid du ColombierSan Rafael, CA 94903, U.S.A., +1(415)492-9861. 22667dd7cddfSDavid du Colombier 22673ff48bf5SDavid du Colombier<p> 2268*593dc095SDavid du Colombier<small>Ghostscript version 8.53, 20 October 2005 22697dd7cddfSDavid du Colombier 22707dd7cddfSDavid du Colombier<!-- [3.0 end visible trailer] ============================================= --> 22717dd7cddfSDavid du Colombier 22727dd7cddfSDavid du Colombier</body> 22737dd7cddfSDavid du Colombier</html> 2274