diff options
Diffstat (limited to 'doc/Language.htm')
-rw-r--r-- | doc/Language.htm | 61 |
1 files changed, 56 insertions, 5 deletions
diff --git a/doc/Language.htm b/doc/Language.htm index 0b35e236..15f39e37 100644 --- a/doc/Language.htm +++ b/doc/Language.htm @@ -438,8 +438,15 @@ The garbage collector doesn't reclaim portions of arrays obtained with <h3><a name="Graphics_and_text"></a>Graphics and text operators</h3> -<h4><a name="Transparency"></a>Transparency</h4> - +<h4><u><a name="Transparency"></a>Transparency</u></h4> +<p><b><u>NOTE:</u></b> The following paragraphs describe non-standard operators +for accessing the PDF 1.4 and later transparent imaging model through Postscript. +If used incorrectly, they can have unexpected side effects and result in undefined +behavior. As a result, these operators are disabled when <a href="Use.htm#Safer"><b>SAFER</b></a> +is in force (as it is by default from version 9.50 onwards). To utilise these operators +you will either have to disable <code>SAFER</code> (<code>-dNOSAFER</code>) or use +the command line parameter <code>-dALLOWPSTRANSPARENCY</code>. The latter will make +the custom operators available, but leave the file access controls active. <p> Ghostscript provides a set of operators for implementing the transparency and compositing facilities of PDF 1.4. These are defined only if the @@ -456,10 +463,34 @@ Ghostscript's model generalizes that of PDF 1.4 in that Ghostscript maintains separate alpha and mask values for opacity and shape, rather than a single value with a Boolean that says whether it represents opacity or shape.</p> +<p> +What follows is a subset of all the custom operators related to transparency, but +covers the most useful, most common requirements. +</p> <h5><a name="Transparency_graphics_state_operators"></a>Graphics state operators</h5> +<p>Pushing the compositor device must be done before any other marking +operations are made on the current page, and must be done per page. +Popping the compositor should be done after the last marking operation +of the page, and before the call to <code>showpage</code>. Any marking +operations made after the compositor is popped will bypass the transparent +imaging model, and may produce unexpected output. + +<dl> +<dt><code><depth> .pushpdf14devicefilter -</code></dt> +<dd>Installs the transparency compositor device into the graphics state. At +present the <code>depth</code> parameter should always be zero (<b>Subject +To Change.</b>) +</dl> +<dl> +<dt><code>- .popdf14devicefilter -</code></dt> +<dd>Removes (or, more accuracately, disables) the transparency compositor in +graphics state. +</dl> + + <dl> <dt><code><modename> .setblendmode -</code></dt> <dd>Sets the blending mode in the graphics state. If the mode name is not @@ -468,23 +499,43 @@ the blending mode is <code>/Compatible</code>.</dd> </dl> <dl> +<dt><code>- .currentblendmode <modename></code></dt> +<dd>Returns the graphics state blend mode on the stack. +</dl> + +<dl> <dt><code><0..1> .setopacityalpha -</code></dt> <dd>Sets the opacity alpha value in the graphics state. The initial opacity alpha value is 1.</dd> </dl> <dl> +<dt><code>- .currentopacityalpha <0..1></code></dt> +<dd>Returns the graphics state opacity alpha on the stack.</dd> +</dl> + +<dl> <dt><code><0..1> .setshapealpha -</code></dt> <dd>Sets the shape alpha value in the graphics state. The initial shape alpha value is 1.</dd> </dl> <dl> +<dt><code>- .currentshapealpha <0..1></code></dt> +<dd>Returns the graphics state shape alpha on the stack.</dd> +</dl> + +<dl> <dt><code><bool> .settextknockout -</code></dt> <dd>Sets the text knockout flag in the graphics state. The initial value of the text knockout flag is <code>true</code>.</dd> </dl> +<dl> +<dt><code>- .currenttextknockout <bool></code></dt> +<dd>Returns the graphics state text knockout on the stack..</dd> +</dl> + <h5><a name="Transparency_rendering_stack_operators"></a>Rendering stack operators</h5> @@ -496,7 +547,7 @@ accumulate only a coverage value. Layers must be properly nested, i.e., the 'end' or 'discard' operator must match the corresponding 'begin' operator.</p> <p> -Beginning and ending layers must nest properly with respect to +Beginning and ending groups must nest properly with respect to <code>save</code> and <code>restore</code>: <code>save</code> and <code>restore</code> do not save and restore the layer stack. Currently, layers are not required to nest with respect to <code>gsave</code> and @@ -1969,12 +2020,12 @@ implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that -license. Refer to licensing information at http://www.artifex.com/ +license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a> or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information. <p> -<small>Ghostscript version 9.50, 15 October 2019 +<small>Ghostscript version 9.52, 19 March 2020 <!-- [3.0 end visible trailer] ============================================= --> |