summaryrefslogtreecommitdiff
path: root/doc/language-bindings/java-gsjavajar.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/language-bindings/java-gsjavajar.html')
-rw-r--r--doc/language-bindings/java-gsjavajar.html783
1 files changed, 0 insertions, 783 deletions
diff --git a/doc/language-bindings/java-gsjavajar.html b/doc/language-bindings/java-gsjavajar.html
deleted file mode 100644
index baeda74a8..000000000
--- a/doc/language-bindings/java-gsjavajar.html
+++ /dev/null
@@ -1,783 +0,0 @@
-<html lang="en">
- <head>
- <title>Ghostscript language bindings</title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <link href="css/default.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="js/default.js"></script>
- </head>
-
- <body>
-
- <header><h1></h1><div class="menu-icon" onclick="javascript:showMenu();"></div></header>
-
- <div id="burger-menu">
- <div class="navigation">
- <div class="title first">Introduction</div>
- <div class="link"><a href="index.html">About our APIs</a></div>
- <div class="link"><a href="demo-code.html">Demo code</a></div>
-
- <div class="title">C#</div>
- <div class="link"><a href="c-sharp-intro.html">Overview</a></div>
- <div class="link"><a href="c-sharp-ghost-api.html">GhostAPI</a></div>
- <div class="link"><a href="c-sharp-ghost-net.html">GhostNET</a></div>
- <div class="link"><a href="c-sharp-ghost-mono.html">GhostMono</a></div>
-
- <div class="title">Java</div>
- <div class="link"><a href="java-intro.html">Overview</a></div>
- <div class="link selected"><a href="java-gsjavajar.html">gsjava.jar</a></div>
-
- <div class="title">Python</div>
- <div class="link"><a href="python-intro.html">Overview</a></div>
- <div class="link"><a href="python-gsapi.html">gsapi.py</a></div>
- </div>
- </div>
- <div class="main">
-
- <div class="left">
- <div class="title first">Introduction</div>
- <div class="link"><a href="index.html">About our APIs</a></div>
- <div class="link"><a href="demo-code.html">Demo code</a></div>
-
- <div class="title">C#</div>
- <div class="link"><a href="c-sharp-intro.html">Overview</a></div>
- <div class="link"><a href="c-sharp-ghost-api.html">GhostAPI</a></div>
- <div class="link"><a href="c-sharp-ghost-net.html">GhostNET</a></div>
- <div class="link"><a href="c-sharp-ghost-mono.html">GhostMono</a></div>
-
- <div class="title">Java</div>
- <div class="link"><a href="java-intro.html">Overview</a></div>
- <div class="link selected"><a href="java-gsjavajar.html">gsjava.jar</a></div>
-
- <div class="title">Python</div>
- <div class="link"><a href="python-intro.html">Overview</a></div>
- <div class="link"><a href="python-gsapi.html">gsapi.py</a></div>
- </div>
-
- <div class="middle">
-
-<!-- note: don't tab indent <article> as it has <pre> code which will have its layout adversly affected -->
-<article class="markdown-body entry-content"><h1 id="gsjava-jar">gsjava.jar</h1>
-<div class="banner">
-<div class="java-text"></div>
-<div class="vendor-logo java-logo"></div>
-</div>
-
-
-<h2 id="about">About</h2>
-<p><code>gsjava.jar</code> is the Java library which contains classes and interfaces which enable API calls required to use Ghostscript.</p>
-<p>Assuming that the JAR for your project has been <a href="java-intro.html#building-the-jar">built</a> and <a href="java-intro.html#linking-the-jar">properly linked</a> with your own project then the Ghostscript API should be available by importing the required classes within your project's <code>.java</code> files.</p>
-<h3 id="gsapi-gsinstance">GSAPI &amp; GSInstance</h3>
-<ul>
-<li><a href="#gsapi">GSAPI</a> is the main Ghostscript API class which bridges into the Ghostscript C library.</li>
-<li><a href="#gsinstance">GSInstance</a> is a wrapper class for <a href="#gsapi">GSAPI</a> which encapsulates an instance of Ghostscript and allows for simpler API calls.</li>
-</ul>
-<div class="tag sampleCode java"></div>
-
-
-<pre><code class="language-clike">// to use GSAPI
-import static com.artifex.gsjava.GSAPI.*;
-
-// to use GSInstance
-import com.artifex.gsjava.GSInstance;</code></pre>
-<h2 id="gsapi">GSAPI</h2>
-<h3 id="gsapi_revision">gsapi_revision</h3>
-<p>This method returns the revision numbers and strings of the Ghostscript interpreter library; you should call it before any other interpreter library functions to make sure that the correct version of the Ghostscript interpreter has been loaded.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_revision(GSAPI.Revision revision,
- int len);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>The method should write to a reference variable which conforms to the class <a href="#gsapi-revision">GSAPI.Revision</a>.</p>
-</blockquote>
-<h4 id="gsapi-revision">GSAPI.Revision</h4>
-<p>This class is used to store information about Ghostscript and provides handy getters for the product and the copyright information.</p>
-<div class="tag classDefinition java"></div>
-
-<pre><code class="language-clike">public static class Revision {
- public volatile byte[] product;
- public volatile byte[] copyright;
- public volatile long revision;
- public volatile long revisionDate;
-
- public Revision() {
- this.product = null;
- this.copyright = null;
- this.revision = 0L;
- this.revisionDate = 0L;
- }
-
- /**
- * Returns the product information as a String.
- *
- * @return The product information.
- */
- public String getProduct() {
- return new String(product);
- }
-
- /**
- * Returns the copyright information as a String.
- *
- * @return The copyright information.
- */
- public String getCopyright() {
- return new String(copyright);
- }
-}</code></pre>
-<h3 id="gsapi_new_instance">gsapi_new_instance</h3>
-<p>Creates a new instance of Ghostscript. This instance is passed to most other <a href="#gsapi">GSAPI</a> methods. Unless Ghostscript has been compiled with the <code>GS_THREADSAFE</code> define, only one instance at a time is supported.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_new_instance(Reference&lt;Long&gt; instance,
- long callerHandle);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>The method returns a reference which represents your instance of Ghostscript.</p>
-</blockquote>
-<h3 id="gsapi_delete_instance">gsapi_delete_instance</h3>
-<p>Destroy an instance of Ghostscript. Before you call this, Ghostscript must have finished. If Ghostscript has been initialised, you should call <a href="#gsapi_exit">gsapi_exit</a> beforehand.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native void gsapi_delete_instance(long instance);</code></pre>
-<h3 id="gsapi_set_stdio_with_handle">gsapi_set_stdio_with_handle</h3>
-<p>Set the callback functions for <code>stdio</code>, together with the handle to use in the callback functions. The <code>stdin</code> callback function should return the number of characters read, 0 for EOF, or -1 for error. The <code>stdout</code> and <code>stderr</code> callback functions should return the number of characters written.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_set_stdio_with_handle(long instance,
- IStdInFunction stdin,
- IStdOutFunction stdout,
- IStdErrFunction stderr,
- long callerHandle);</code></pre>
-<h3 id="gsapi_set_stdio">gsapi_set_stdio</h3>
-<p>Set the callback functions for <code>stdio</code>. The handle used in the callbacks will be taken from the value passed to <a href="#gsapi_new_instance">gsapi_new_instance</a>. Otherwise the behaviour of this function matches <a href="#gsapi_set_stdio_with_handle">gsapi_set_stdio_with_handle</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_set_stdio(long instance,
- IStdInFunction stdin,
- IStdOutFunction stdout,
- IStdErrFunction stderr);</code></pre>
-<h3 id="gsapi_set_poll_with_handle">gsapi_set_poll_with_handle</h3>
-<p>Set the callback function for polling, together with the handle to pass to the callback function. This function will only be called if the Ghostscript interpreter was compiled with <code>CHECK_INTERRUPTS</code> as described in <code>gpcheck.h</code>.</p>
-<p>The polling function should return zero if all is well, and return negative if it wants ghostscript to abort. This is often used for checking for a user cancel. This can also be used for handling window events or cooperative multitasking.</p>
-<p>The polling function is called very frequently during interpretation and rendering so it must be fast. If the function is slow, then using a counter to <code>return 0</code> immediately some number of times can be used to reduce the performance impact.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_set_poll_with_handle(long instance,
- IPollFunction pollfun,
- long callerHandle);</code></pre>
-<h3 id="gsapi_set_poll">gsapi_set_poll</h3>
-<p>Set the callback function for polling. The handle passed to the callback function will be taken from the handle passed to <a href="#gsapi_new_instance">gsapi_new_instance</a>. Otherwise the behaviour of this function matches <a href="#gsapi_set_poll_with_handle">gsapi_set_poll_with_handle</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_set_poll(long instance,
- IPollFunction pollfun);</code></pre>
-<h3 id="gsapi_set_display_callback">gsapi_set_display_callback</h3>
-<p>This call is deprecated; please use <a href="#gsapi_register_callout">gsapi_register_callout</a> to register a <a href="#callback-callout-interfaces">callout handler</a> for the display device in preference.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_set_display_callback(long instance,
- DisplayCallback displayCallback);</code></pre>
-<h3 id="gsapi_register_callout">gsapi_register_callout</h3>
-<p>This call registers a <a href="#callback-callout-interfaces">callout handler</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_register_callout(long instance,
- ICalloutFunction callout,
- long calloutHandle);</code></pre>
-<h3 id="gsapi_deregister_callout">gsapi_deregister_callout</h3>
-<p>This call deregisters a <a href="#callback-callout-interfaces">callout handler</a> previously registered with <a href="#gsapi_register_callout">gsapi_register_callout</a>. All three arguments must match exactly for the <a href="#callback-callout-interfaces">callout handler</a> to be deregistered.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native void gsapi_deregister_callout(long instance,
- ICalloutFunction callout,
- long calloutHandle);</code></pre>
-<h3 id="gsapi_set_arg_encoding">gsapi_set_arg_encoding</h3>
-<p>Set the encoding used for the interpretation of all subsequent arguments supplied via the <code>GSAPI</code> interface on this instance. By default we expect args to be in encoding <code>0</code> (the 'local' encoding for this OS). On Windows this means "the currently selected codepage". This means that omitting to call this function will leave Ghostscript running exactly as it always has. Please note that use of the 'local' encoding is now deprecated and should be avoided in new code. This must be called after <a href="#gsapi_new_instance">gsapi_new_instance</a> and before <a href="#gsapi_init_with_args">gsapi_init_with_args</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_set_arg_encoding(long instance,
- int encoding);</code></pre>
-<h3 id="gsapi_set_default_device_list">gsapi_set_default_device_list</h3>
-<p>Set the string containing the list of default device names, for example "display x11alpha x11 bbox". Allows the calling application to influence which device(s) Ghostscript will try, in order, in its selection of the default device. This must be called after <a href="#gsapi_new_instance">gsapi_new_instance</a> and before <a href="#gsapi_init_with_args">gsapi_init_with_args</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_set_default_device_list(long instance,
- byte[] list,
- int listlen);</code></pre>
-<h3 id="gsapi_get_default_device_list">gsapi_get_default_device_list</h3>
-<p>Returns a pointer to the current default device string. This must be called after <a href="#gsapi_new_instance">gsapi_new_instance</a> and before <a href="#gsapi_init_with_args">gsapi_init_with_args</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_get_default_device_list(long instance,
- Reference&lt;byte[]&gt; list,
- Reference&lt;Integer&gt; listlen);</code></pre>
-<h3 id="gsapi_init_with_args">gsapi_init_with_args</h3>
-<p>To initialise the interpreter, pass your <code>instance</code> of Ghostscript, your argument count: <code>argc</code>, and your argument variables: <code>argv</code>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_init_with_args(long instance,
- int argc,
- byte[][] argv);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>There are also simpler utility methods which eliminates the need to send through your argument count and allows for simpler <code>String</code> passing for your argument array.</p>
-</blockquote>
-<p>Utility methods:</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static int gsapi_init_with_args(long instance,
- String[] argv);</code></pre>
-<pre><code class="language-clike">public static int gsapi_init_with_args(long instance,
- List&lt;String&gt; argv);</code></pre>
-<h3 id="gsapi_run_-">gsapi_run_*</h3>
-<p>If these functions return <code>&lt;= -100</code>, either quit or a fatal error has occured. You must call <a href="#gsapi_exit">gsapi_exit</a> next. The only exception is <a href="#gsapi_run_string_continue">gsapi_run_string_continue</a> which will return <code>gs_error_NeedInput</code> if all is well.</p>
-<p>There is a 64 KB length limit on any buffer submitted to a <code>gsapi_run_*</code> function for processing. If you have more than 65535 bytes of input then you must split it into smaller pieces and submit each in a separate <a href="#gsapi_run_string_continue">gsapi_run_string_continue</a> call.</p>
-<h3 id="gsapi_run_string_begin">gsapi_run_string_begin</h3>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_run_string_begin(long instance,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="gsapi_run_string_continue">gsapi_run_string_continue</h3>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_run_string_continue(long instance,
- byte[] str,
- int length,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>There is a simpler utility method which allows for simpler <code>String</code> passing for the <code>str</code> argument.</p>
-</blockquote>
-<p>Utility method:</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static int gsapi_run_string_continue(long instance,
- String str,
- int length,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="gsapi_run_string_with_length">gsapi_run_string_with_length</h3>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_run_string_with_length(long instance,
- byte[] str,
- int length,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>There is a simpler utility method which allows for simpler <code>String</code> passing for the <code>str</code> argument.</p>
-</blockquote>
-<p>Utility method:</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static int gsapi_run_string_with_length(long instance,
- String str,
- int length,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="gsapi_run_string">gsapi_run_string</h3>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_run_string(long instance,
- byte[] str,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>There is a simpler utility method which allows for simpler <code>String</code> passing for the <code>str</code> argument.</p>
-</blockquote>
-<p>Utility method:</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static int gsapi_run_string(long instance,
- String str,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="gsapi_run_string_end">gsapi_run_string_end</h3>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_run_string_end(long instance,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="gsapi_run_file">gsapi_run_file</h3>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_run_file(long instance,
- byte[] fileName,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>There is a simpler utility method which allows for simpler <code>String</code> passing for the <code>fileName</code> argument.</p>
-</blockquote>
-<p>Utility method:</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static int gsapi_run_file(long instance,
- String fileName,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="gsapi_exit">gsapi_exit</h3>
-<p>Exit the interpreter. This must be called on shutdown if <a href="#gsapi_init_with_args">gsapi_init_with_args</a> has been called, and just before <a href="#gsapi_delete_instance">gsapi_delete_instance</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_exit(long instance);</code></pre>
-<h3 id="gsapi_set_param">gsapi_set_param</h3>
-<p>Sets a parameter. Broadly, this is equivalent to setting a parameter using -d, -s or -p on the command line. This call cannot be made during a <a href="#gsapi_run_string">gsapi_run_string</a> operation.</p>
-<p>Parameters in this context are not the same as 'arguments' as processed by <a href="#gsapi_init_with_args">gsapi_init_with_args</a>, but often the same thing can be achieved. For example, with <a href="#gsapi_init_with_args">gsapi_init_with_args</a>, we can pass "-r200" to change the resolution. Broadly the same thing can be achieved by using <a href="#gsapi_set_param">gsapi_set_param</a> to set a parsed value of "&lt;&lt;/HWResolution [ 200.0 200.0 ]&gt;&gt;".</p>
-<p>Internally, when we set a parameter, we perform an <code>initgraphics</code> operation. This means that using <a href="#gsapi_set_param">gsapi_set_param</a> other than at the start of a page is likely to give unexpected results.</p>
-<p>Attempting to set a parameter that the device does not recognise will be silently ignored, and that parameter will not be found in subsequent <a href="#gsapi_get_param">gsapi_get_param</a> calls.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_set_param(long instance,
- byte[] param,
- Object value,
- int paramType);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>The <code>type</code> argument, as a <a href="#gs_set_param_type">gs_set_param_type</a>, dictates the kind of object that the <code>value</code> argument points to.</p>
-</blockquote>
-<blockquote>
-<p><strong>NOTE</strong><br>For more on the C implementation of parameters see: <a href="https://www.ghostscript.com/doc/current/Use.htm#Parameters">Ghostscript parameters in C</a>.</p>
-</blockquote>
-<blockquote>
-<p><strong>NOTE</strong><br>There are also simpler utility methods which allows for simpler <code>String</code> passing for your arguments.</p>
-</blockquote>
-<p>Utility methods:</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static int gsapi_set_param(long instance,
- String param,
- String value,
- int paramType);</code></pre>
-<pre><code class="language-clike">public static int gsapi_set_param(long instance,
- String param,
- Object value,
- int paramType);</code></pre>
-<h3 id="gsapi_get_param">gsapi_get_param</h3>
-<p>Retrieve the current value of a parameter.</p>
-<p>If an error occurs, the return value is negative. Otherwise the return value is the number of bytes required for storage of the value. Call once with value <code>NULL</code> to get the number of bytes required, then call again with value pointing to at least the required number of bytes where the value will be copied out. Note that the caller is required to know the type of value in order to get it. For all types other than <a href="#gs_set_param_type">gs_spt_string</a>, <a href="#gs_set_param_type">gs_spt_name</a>, and <a href="#gs_set_param_type">gs_spt_parsed</a> knowing the type means you already know the size required.</p>
-<p>This call retrieves parameters/values that have made it to the device. Thus, any values set using <a href="#gs_set_param_type">gs_spt_more_to_come</a> without a following call omitting that flag will not be retrieved. Similarly, attempting to get a parameter before <a href="#gsapi_init_with_args">gsapi_init_with_args</a> has been called will not list any, even if <a href="#gsapi_set_param">gsapi_set_param</a> has been used.</p>
-<p>Attempting to read a parameter that is not set will return <code>gs_error_undefined</code> (-21). Note that calling <a href="#gsapi_set_param">gsapi_set_param</a> followed by <a href="#gsapi_get_param">gsapi_get_param</a> may not find the value, if the device did not recognise the key as being one of its configuration keys.</p>
-<p>For the C documentation please refer to <a href="https://www.ghostscript.com/doc/current/API.htm#get_param">Ghostscript get_param</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_get_param(long instance,
- byte[] param,
- long value,
- int paramType);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>There is a simpler utility method which allows for simpler <code>String</code> passing for the <code>param</code> argument.</p>
-</blockquote>
-<p>Utility method:</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static int gsapi_get_param(long instance,
- String param,
- long value,
- int paramType);</code></pre>
-<h3 id="gsapi_enumerate_params">gsapi_enumerate_params</h3>
-<p>Enumerate the current parameters. Call repeatedly to list out the current parameters.</p>
-<p>The first call should have <code>iter</code> = NULL. Subsequent calls should pass the same pointer in so the iterator can be updated. Negative return codes indicate error, 0 success, and 1 indicates that there are no more keys to read. On success, key will be updated to point to a null terminated string with the key name that is guaranteed to be valid until the next call to <a href="#gsapi_enumerate_params">gsapi_enumerate_params</a>. If <code>type</code> is non NULL then the pointer <code>type</code> will be updated to have the <code>type</code> of the parameter.</p>
-<blockquote>
-<p><strong>NOTE</strong><br>Only one enumeration can happen at a time. Starting a second enumeration will reset the first.</p>
-</blockquote>
-<p>The enumeration only returns parameters/values that have made it to the device. Thus, any values set using the <a href="#gs_set_param_type">gs_spt_more_to_come</a> without a following call omitting that flag will not be retrieved. Similarly, attempting to enumerate parameters before <a href="#gsapi_init_with_args">gsapi_init_with_args</a> has been called will not list any, even if <a href="#gsapi_set_param">gsapi_set_param</a> has been used.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_enumerate_params(long instance,
- Reference&lt;Long&gt; iter,
- Reference&lt;byte[]&gt; key,
- Reference&lt;Integer&gt; paramType);</code></pre>
-<h3 id="gsapi_add_control_path">gsapi_add_control_path</h3>
-<p>Add a (case sensitive) path to one of the lists of <a href="https://ghostscript.com/doc/current/Use.htm#Safer">permitted paths</a> for file access.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_add_control_path(long instance,
- int type,
- byte[] path);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>There is a simpler utility method which allows for simpler <code>String</code> passing for the <code>path</code> argument.</p>
-</blockquote>
-<p>Utility method:</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static int gsapi_add_control_path(long instance,
- int type,
- String path);</code></pre>
-<h3 id="gsapi_remove_control_path">gsapi_remove_control_path</h3>
-<p>Remove a (case sensitive) path from one of the lists of <a href="https://ghostscript.com/doc/current/Use.htm#Safer">permitted paths</a> for file access.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native int gsapi_remove_control_path(long instance,
- int type,
- byte[] path);</code></pre>
-<blockquote>
-<p><strong>NOTE</strong><br>There is a simpler utility method which allows for simpler <code>String</code> passing for the <code>path</code> argument.</p>
-</blockquote>
-<p>Utility method:</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static int gsapi_remove_control_path(long instance,
- int type,
- String path);</code></pre>
-<h3 id="gsapi_purge_control_paths">gsapi_purge_control_paths</h3>
-<p>Clear all the paths from one of the lists of <a href="https://ghostscript.com/doc/current/Use.htm#Safer">permitted paths</a> for file access.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native void gsapi_purge_control_paths(long instance,
- int type);</code></pre>
-<h3 id="gsapi_activate_path_control">gsapi_activate_path_control</h3>
-<p>Enable/Disable path control (i.e. whether paths are checked against <a href="https://ghostscript.com/doc/current/Use.htm#Safer">permitted paths</a> before access is granted).</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public static native void gsapi_activate_path_control(long instance,
- boolean enable);</code></pre>
-<h3 id="gsapi_is_path_control_active">gsapi_is_path_control_active</h3>
-<p>Query whether path control is activated or not.</p>
-<div class="tag methodDefinition java"></div>
-
-
-<pre><code class="language-clike">public static native boolean gsapi_is_path_control_active(long instance);</code></pre>
-<h2 id="callback-callout-interfaces">Callback &amp; Callout interfaces</h2>
-<p><code>gsjava.jar</code> also defines some functional interfaces for callbacks &amp; callouts with <code>package com.artifex.gsjava.callback</code> which are defined as follows.</p>
-<h3 id="istdinfunction">IStdInFunction</h3>
-<div class="tag functionalInterface java"></div>
-
-<pre><code class="language-clike">public interface IStdInFunction {
- /**
- * @param callerHandle The caller handle.
- * @param buf A string represented by a byte array.
- * @param len The number of bytes to read.
- * @return The number of bytes read, must be &lt;code&gt;len&lt;/code&gt;/
- */
- public int onStdIn(long callerHandle,
- byte[] buf,
- int len);
-}</code></pre>
-<h3 id="istdoutfunction">IStdOutFunction</h3>
-<div class="tag functionalInterface java"></div>
-
-<pre><code class="language-clike">public interface IStdOutFunction {
- /**
- * Called when something should be written to the standard
- * output stream.
- *
- * @param callerHandle The caller handle.
- * @param str The string represented by a byte array to write.
- * @param len The number of bytes to write.
- * @return The number of bytes written, must be &lt;code&gt;len&lt;/code&gt;.
- */
- public int onStdOut(long callerHandle,
- byte[] str,
- int len);
-}</code></pre>
-<h3 id="istderrfunction">IStdErrFunction</h3>
-<div class="tag functionalInterface java"></div>
-
-<pre><code class="language-clike">public interface IStdErrFunction {
- /**
- * Called when something should be written to the standard error stream.
- *
- * @param callerHandle The caller handle.
- * @param str The string represented by a byte array to write.
- * @param len The length of bytes to be written.
- * @return The amount of bytes written, must be &lt;code&gt;len&lt;/code&gt;.
- */
- public int onStdErr(long callerHandle,
- byte[] str,
- int len);
-}</code></pre>
-<h3 id="ipollfunction">IPollFunction</h3>
-<div class="tag functionalInterface java"></div>
-
-<pre><code class="language-clike">public interface IPollFunction {
- public int onPoll(long callerHandle);
-}</code></pre>
-<h3 id="icalloutfunction">ICalloutFunction</h3>
-<div class="tag functionalInterface java"></div>
-
-<pre><code class="language-clike">public interface ICalloutFunction {
- public int onCallout(long instance,
- long calloutHandle,
- byte[] deviceName,
- int id,
- int size,
- long data);
-}</code></pre>
-<h2 id="gsinstance">GSInstance</h2>
-<p>This is a utility class which makes Ghostscript calls easier by storing a Ghostscript instance and, optionally, a caller handle. Essentially the class acts as a handy wrapper for the standard <a href="#gsapi">GSAPI</a> methods.</p>
-<h3 id="constructors">Constructors</h3>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public GSInstance() throws IllegalStateException;</code></pre>
-<pre><code class="language-clike">public GSInstance(long callerHandle) throws IllegalStateException;</code></pre>
-<h3 id="delete_instance">delete_instance</h3>
-<p>Wraps <a href="#gsapi_delete_instance">gsapi_delete_instance</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public void delete_instance();</code></pre>
-<h3 id="set_stdio">set_stdio</h3>
-<p>Wraps <a href="#gsapi_set_stdio">gsapi_set_stdio</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int set_stdio(IStdInFunction stdin,
- IStdOutFunction stdout,
- IStdErrFunction stderr);</code></pre>
-<h3 id="set_poll">set_poll</h3>
-<p>Wraps <a href="#gsapi_set_poll">gsapi_set_poll</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int set_poll(IPollFunction pollfun);</code></pre>
-<h3 id="set_display_callback">set_display_callback</h3>
-<p>Wraps <a href="#gsapi_set_display_callback">gsapi_set_display_callback</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int set_display_callback(DisplayCallback displaycallback);</code></pre>
-<h3 id="register_callout">register_callout</h3>
-<p>Wraps <a href="#gsapi_register_callout">gsapi_register_callout</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int register_callout(ICalloutFunction callout);</code></pre>
-<h3 id="deregister_callout">deregister_callout</h3>
-<p>Wraps <a href="#gsapi_deregister_callout">gsapi_deregister_callout</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public void deregister_callout(ICalloutFunction callout);</code></pre>
-<h3 id="set_arg_encoding">set_arg_encoding</h3>
-<p>Wraps <a href="#gsapi_set_arg_encoding">gsapi_set_arg_encoding</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int set_arg_encoding(int encoding);</code></pre>
-<h3 id="set_default_device_list">set_default_device_list</h3>
-<p>Wraps <a href="#gsapi_set_default_device_list">gsapi_set_default_device_list</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int set_default_device_list(byte[] list,
- int listlen);</code></pre>
-<h3 id="get_default_device_list">get_default_device_list</h3>
-<p>Wraps <a href="#gsapi_get_default_device_list">gsapi_get_default_device_list</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int get_default_device_list(Reference&lt;byte[]&gt; list,
- Reference&lt;Integer&gt; listlen);</code></pre>
-<h3 id="init_with_args">init_with_args</h3>
-<p>Wraps <a href="#gsapi_init_with_args">gsapi_init_with_args</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int init_with_args(int argc,
- byte[][] argv);</code></pre>
-<pre><code class="language-clike">public int init_with_args(String[] argv);</code></pre>
-<pre><code class="language-clike">public int init_with_args(List&lt;String&gt; argv);</code></pre>
-<h3 id="run_string_begin">run_string_begin</h3>
-<p>Wraps <a href="#gsapi_run_string_begin">gsapi_run_string_begin</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int run_string_begin(int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="run_string_continue">run_string_continue</h3>
-<p>Wraps <a href="#gsapi_run_string_continue">gsapi_run_string_continue</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int run_string_continue(byte[] str,
- int length,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<pre><code class="language-clike">public int run_string_continue(String str,
- int length,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="run_string">run_string</h3>
-<p>Wraps <a href="#gsapi_run_string">gsapi_run_string</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int run_string(byte[] str,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<pre><code class="language-clike">public int run_string(String str,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="run_file">run_file</h3>
-<p>Wraps <a href="#gsapi_run_file">gsapi_run_file</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int run_file(byte[] fileName,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<pre><code class="language-clike">public int run_file(String filename,
- int userErrors,
- Reference&lt;Integer&gt; pExitCode);</code></pre>
-<h3 id="exit">exit</h3>
-<p>Wraps <a href="#gsapi_exit">gsapi_exit</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int exit();</code></pre>
-<h3 id="set_param">set_param</h3>
-<p>Wraps <a href="#gsapi_set_param">gsapi_set_param</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int set_param(byte[] param,
- Object value,
- int paramType);</code></pre>
-<pre><code class="language-clike">public int set_param(String param,
- String value,
- int paramType);</code></pre>
-<pre><code class="language-clike">public int set_param(String param,
- Object value,
- int paramType);</code></pre>
-<h3 id="get_param">get_param</h3>
-<p>Wraps <a href="#gsapi_get_param">gsapi_get_param</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int get_param(byte[] param,
- long value,
- int paramType);</code></pre>
-<pre><code class="language-clike">public int get_param(String param,
- long value,
- int paramType);</code></pre>
-<h3 id="enumerate_params">enumerate_params</h3>
-<p>Wraps <a href="#gsapi_enumerate_params">gsapi_enumerate_params</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int enumerate_params(Reference&lt;Long&gt; iter,
- Reference&lt;byte[]&gt; key,
- Reference&lt;Integer&gt; paramType);</code></pre>
-<h3 id="add_control_path">add_control_path</h3>
-<p>Wraps <a href="#gsapi_add_control_path">gsapi_add_control_path</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int add_control_path(int type,
- byte[] path);</code></pre>
-<pre><code class="language-clike">public int add_control_path(int type,
- String path);</code></pre>
-<h3 id="remove_control_path">remove_control_path</h3>
-<p>Wraps <a href="#gsapi_remove_control_path">gsapi_remove_control_path</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public int remove_control_path(int type,
- byte[] path);</code></pre>
-<pre><code class="language-clike">public int remove_control_path(int type,
- String path);</code></pre>
-<h3 id="purge_control_paths">purge_control_paths</h3>
-<p>Wraps <a href="#gsapi_purge_control_paths">gsapi_purge_control_paths</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public void purge_control_paths(int type);</code></pre>
-<h3 id="activate_path_control">activate_path_control</h3>
-<p>Wraps <a href="#gsapi_activate_path_control">gsapi_activate_path_control</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public void activate_path_control(boolean enable);</code></pre>
-<h3 id="is_path_control_active">is_path_control_active</h3>
-<p>Wraps <a href="#gsapi_is_path_control_active">gsapi_is_path_control_active</a>.</p>
-<div class="tag methodDefinition java"></div>
-
-<pre><code class="language-clike">public boolean is_path_control_active();</code></pre>
-<h2 id="utility-classes">Utility classes</h2>
-<p>The com.artifex.gsjava.util package contains a set of classes and interfaces which are used throughout the API.</p>
-<h3 id="com-artifex-gsjava-util-reference">com.artifex.gsjava.util.Reference</h3>
-<p><code>Reference&lt;T&gt;</code> is used in many of the Ghostscript calls, it stores a reference to a generic value of type <code>T</code>. This class exists to emulate pointers being passed to a native function. Its value can be fetched with <code>getValue()</code> and set with <code>setValue(T value)</code>.</p>
-<div class="tag classDefinition java"></div>
-
-<pre><code class="language-clike">public class Reference&lt;T&gt; {
-
- private volatile T value;
-
- public Reference() {
- this(null);
- }
-
- public Reference(T value) {
- this.value = value;
- }
-
- public void setValue(T value) {
- this.value = value;
- }
-
- public T getValue() {
- return value;
- }
- ...
-}</code></pre>
-</article>
-
- </div> <!-- /middle -->
-
- <div class="right">
-
- <div class="link"><a href="#about">About</a></div>
- <div class="sub-link"><a href="#gsapi-gsinstance">GSAPI & GSInstance</a></div>
- <div class="link"><a href="#gsapi">GSAPI</a></div>
- <div class="sub-link"><a href="#gsapi_revision">gsapi_revision</a></div>
- <div class="sub-link"><a href="#gsapi_new_instance">gsapi_new_instance</a></div>
- <div class="sub-link"><a href="#gsapi_delete_instance">gsapi_delete_instance</a></div>
- <div class="sub-link"><a href="#gsapi_set_stdio_with_handle">gsapi_set_stdio_with_handle</a></div>
- <div class="sub-link"><a href="#gsapi_set_stdio">gsapi_set_stdio</a></div>
- <div class="sub-link"><a href="#gsapi_set_poll_with_handle">gsapi_set_poll_with_handle</a></div>
- <div class="sub-link"><a href="#gsapi_set_poll">gsapi_set_poll</a></div>
- <div class="sub-link"><a href="#gsapi_set_display_callback">gsapi_set_display_callback</a></div>
- <div class="sub-link"><a href="#gsapi_register_callout">gsapi_register_callout</a></div>
- <div class="sub-link"><a href="#gsapi_deregister_callout">gsapi_deregister_callout</a></div>
- <div class="sub-link"><a href="#gsapi_set_arg_encoding">gsapi_set_arg_encoding</a></div>
- <div class="sub-link"><a href="#gsapi_set_default_device_list">gsapi_set_default_device_list</a></div>
- <div class="sub-link"><a href="#gsapi_get_default_device_list">gsapi_get_default_device_list</a></div>
- <div class="sub-link"><a href="#gsapi_init_with_args">gsapi_init_with_args</a></div>
- <div class="sub-link"><a href="#gsapi_run_-">gsapi_run_*</a></div>
- <div class="sub-link"><a href="#gsapi_run_string_begin">gsapi_run_string_begin</a></div>
- <div class="sub-link"><a href="#gsapi_run_string_continue">gsapi_run_string_continue</a></div>
- <div class="sub-link"><a href="#gsapi_run_string_with_length">gsapi_run_string_with_length</a></div>
- <div class="sub-link"><a href="#gsapi_run_string">gsapi_run_string</a></div>
- <div class="sub-link"><a href="#gsapi_run_string_end">gsapi_run_string_end</a></div>
- <div class="sub-link"><a href="#gsapi_run_file">gsapi_run_file</a></div>
- <div class="sub-link"><a href="#gsapi_exit">gsapi_exit</a></div>
- <div class="sub-link"><a href="#gsapi_set_param">gsapi_set_param</a></div>
- <div class="sub-link"><a href="#gsapi_get_param">gsapi_get_param</a></div>
- <div class="sub-link"><a href="#gsapi_enumerate_params">gsapi_enumerate_params</a></div>
- <div class="sub-link"><a href="#gsapi_add_control_path">gsapi_add_control_path</a></div>
- <div class="sub-link"><a href="#gsapi_remove_control_path">gsapi_remove_control_path</a></div>
- <div class="sub-link"><a href="#gsapi_purge_control_paths">gsapi_purge_control_paths</a></div>
- <div class="sub-link"><a href="#gsapi_activate_path_control">gsapi_activate_path_control</a></div>
- <div class="sub-link"><a href="#gsapi_is_path_control_active">gsapi_is_path_control_active</a></div>
- <div class="link"><a href="#callback-callout-interfaces">Callback & Callout interfaces</a></div>
- <div class="sub-link"><a href="#istdinfunction">IStdInFunction</a></div>
- <div class="sub-link"><a href="#istdoutfunction">IStdOutFunction</a></div>
- <div class="sub-link"><a href="#istderrfunction">IStdErrFunction</a></div>
- <div class="sub-link"><a href="#ipollfunction">IPollFunction</a></div>
- <div class="sub-link"><a href="#icalloutfunction">ICalloutFunction</a></div>
- <div class="link"><a href="#gsinstance">GSInstance</a></div>
- <div class="sub-link"><a href="#constructors">Constructors</a></div>
- <div class="sub-link"><a href="#delete_instance">delete_instance</a></div>
- <div class="sub-link"><a href="#set_stdio">set_stdio</a></div>
- <div class="sub-link"><a href="#set_poll">set_poll</a></div>
- <div class="sub-link"><a href="#set_display_callback">set_display_callback</a></div>
- <div class="sub-link"><a href="#register_callout">register_callout</a></div>
- <div class="sub-link"><a href="#deregister_callout">deregister_callout</a></div>
- <div class="sub-link"><a href="#set_arg_encoding">set_arg_encoding</a></div>
- <div class="sub-link"><a href="#set_default_device_list">set_default_device_list</a></div>
- <div class="sub-link"><a href="#get_default_device_list">get_default_device_list</a></div>
- <div class="sub-link"><a href="#init_with_args">init_with_args</a></div>
- <div class="sub-link"><a href="#run_string_begin">run_string_begin</a></div>
- <div class="sub-link"><a href="#run_string_continue">run_string_continue</a></div>
- <div class="sub-link"><a href="#run_string">run_string</a></div>
- <div class="sub-link"><a href="#run_file">run_file</a></div>
- <div class="sub-link"><a href="#exit">exit</a></div>
- <div class="sub-link"><a href="#set_param">set_param</a></div>
- <div class="sub-link"><a href="#get_param">get_param</a></div>
- <div class="sub-link"><a href="#enumerate_params">enumerate_params</a></div>
- <div class="sub-link"><a href="#add_control_path">add_control_path</a></div>
- <div class="sub-link"><a href="#remove_control_path">remove_control_path</a></div>
- <div class="sub-link"><a href="#purge_control_paths">purge_control_paths</a></div>
- <div class="sub-link"><a href="#activate_path_control">activate_path_control</a></div>
- <div class="sub-link"><a href="#is_path_control_active">is_path_control_active</a></div>
- <div class="link"><a href="#utility-classes">Utility classes</a></div>
- <div class="sub-link"><a href="#com-artifex-gsjava-util-reference">com.artifex.gsjava.util.Reference</a></div>
-
- </div>
-
- </div>
-
- <footer></footer>
-
- </body>
-
-</html>