Ghostscript.NET
Represents a base Ghostscript Display Device handler.
Initializes a new instance of the Ghostscript.NET.GhostscriptDisplayDeviceHandler class.
Represents a native Ghostscript library.
Initializes a new instance of the Ghostscript.NET.GhostscriptLibrary class
from the native library represented as the memory buffer.
Memory buffer representing native Ghostscript library.
Initializes a new instance of the Ghostscript.NET.GhostscriptLibrary class
from the GhostscriptVersionInfo object.
GhostscriptVersionInfo instance that tells which Ghostscript library to use.
Initializes a new instance of the Ghostscript.NET.GhostscriptLibrary class
from the GhostscriptVersionInfo object.
GhostscriptVersionInfo instance that tells which Ghostscript library to use.
Tells if the Ghostscript should be loaded from the memory or directly from the disk.
Releases all resources used by the Ghostscript.NET.GhostscriptLibrary instance.
Releases all resources used by the Ghostscript.NET.GhostscriptLibrary instance.
Get the native library symbols and map them to the appropriate functions/delegates.
Throws friendly gsdll incompatibility message.
Ghostscript license type.
Open source releases.
Old open source releases.
Commercially licensed release.
Class that helps us to get various information about the PDF file.
Returns Ink coverage for all pages.
The result is ink coverage for the CMYK inks, separately for each single page (for RGB colors, it does a silent conversion to CMYK color space internally).
This function is supported only in Ghostscript v9.05 or newer.
Stream representing PDF document.
A dictionary of a page numbers with the ink coverage.
Returns Ink coverage for all pages.
The result is ink coverage for the CMYK inks, separately for each single page (for RGB colors, it does a silent conversion to CMYK color space internally).
This function is supported only in Ghostscript v9.05 or newer.
Stream representing PDF document.
GhostscriptVersionInfo instance that tells which Ghostscript library to use.
A dictionary of a page numbers with the ink coverage.
Returns Ink coverage for specified page range.
The result is ink coverage for the CMYK inks, separately for each single page (for RGB colors, it does a silent conversion to CMYK color space internally).
This function is supported only in Ghostscript v9.05 or newer.
Stream representing PDF document.
Designated start page of the document. Pages of all documents in PDF collections are numbered sequentionally.
Designated end page of the document. Pages of all documents in PDF collections are numbered sequentionally.
Dictionary of page numbers with ink coverage.
Returns Ink coverage for specified page range.
The result is ink coverage for the CMYK inks, separately for each single page (for RGB colors, it does a silent conversion to CMYK color space internally).
This function is supported only in Ghostscript v9.05 or newer.
Stream representing PDF document.
Designated start page of the document. Pages of all documents in PDF collections are numbered sequentionally.
Designated end page of the document. Pages of all documents in PDF collections are numbered sequentionally.
GhostscriptVersionInfo instance that tells which Ghostscript library to use.
A dictionary of a page numbers with the ink coverage.
Returns Ink coverage for all pages.
The result is ink coverage for the CMYK inks, separately for each single page (for RGB colors, it does a silent conversion to CMYK color space internally).
This function is supported only in Ghostscript v9.05 or newer.
PDF file path.
A dictionary of a page numbers with the ink coverage.
Returns Ink coverage for all pages.
The result is ink coverage for the CMYK inks, separately for each single page (for RGB colors, it does a silent conversion to CMYK color space internally).
This function is supported only in Ghostscript v9.05 or newer.
GhostscriptVersionInfo instance that tells which Ghostscript library to use.
A dictionary of a page numbers with the ink coverage.
Returns Ink coverage for specified page range.
The result is ink coverage for the CMYK inks, separately for each single page (for RGB colors, it does a silent conversion to CMYK color space internally).
This function is supported only in Ghostscript v9.05 or newer.
PDF file path.
Designated start page of the document. Pages of all documents in PDF collections are numbered sequentionally.
Designated end page of the document. Pages of all documents in PDF collections are numbered sequentionally.
A dictionary of a page numbers with the ink coverage.
Returns Ink coverage for specified page range.
The result is ink coverage for the CMYK inks, separately for each single page (for RGB colors, it does a silent conversion to CMYK color space internally).
This function is supported only in Ghostscript v9.05 or newer.
PDF file path.
Designated start page of the document. Pages of all documents in PDF collections are numbered sequentionally.
Designated end page of the document. Pages of all documents in PDF collections are numbered sequentionally.
GhostscriptVersionInfo instance that tells which Ghostscript library to use.
A dictionary of a page numbers with the ink coverage.
Ink coverage.
Gets page number.
Gets percentage of Cyan color coverage.
Gets percentage of Magenta color coverage.
Gets percentage of Yellow color coverage.
Gets percentage of Black color coverage.
Gets if the ink coverage values are valid.
Represents a Ghostscript piped output.
Initializes a new instance of the Ghostscript.NET.GhostscriptPipedOutput class.
Releases all resources used by the Ghostscript.NET.GhostscriptPipedOutput instance.
Releases all resources used by the Ghostscript.NET.GhostscriptPipedOutput instance.
Gets pipes client handle as string.
Reads Ghostscript output.
Gets the Ghostscript output.
Stores a set of four float values that represent lower-left and upper-right corner of rectangle.
Initializes a new instance of the Ghostscript.NET.GhostscriptRectangle class.
Initializes a new instance of the Ghostscript.NET.GhostscriptRectangle class.
Lower-left x.
Lower-left y.
Upper-right x.
Upper-right y.
Gets lower-left x.
Gets lower-left y.
Gets upper-right x.
Gets upper-right y.
Represents a base Ghostscript standard input output handler.
Initializes a new instance of the Ghostscript.NET.GhostscriptStdIO class.
Whether or not to handle Ghostscript standard input.
Whether or not to handle Ghostscript standard output.
Whether or not to handle Ghostscript standard errors.
Standard input handler.
Standard input handle.
Pointer to a memroy block.
Number of bytes that standard input expects.
Number of bytes returned.
Handles standard output.
Standard output handle.
Pointer to a memroy block.
Number of bytes that standard output writes.
Number of bytes read.
Handles errors.
Errors handle.
Pointer to a memory block.
Number of bytes standard error writes.
Number of bytes read.
Abstract standard input method.
Input data.
Expected size of the input data.
Abstract standard output method.
Output data.
Abstract standard error method.
Error data.
Represents a GhostscriptSwitch attribute.
Initializes a new instance of the Ghostscript.NET.GhostscriptSwitchAttribute class.
The Switch name.
Gets the switch name.
Represents a GhostscriptSwitchValue attribute.
Initializes a new instance of the Ghostscript.NET.GhostscriptSwitchValueAttribute class.
Gets the switch value.
Internal code for a fatal error.
gs_interpret also returns this for a .quit with a positive exit code.
Internal code for the .quit operator.
The real quit code is an integer on the operand stack.
gs_interpret returns this only for a .quit with a zero exit code.
Internal code for a normal exit from the interpreter.
Do not use outside of interp.c.
Internal code that indicates that a procedure has been stored in the
remap_proc of the graphics state, and should be called before retrying
the current token. This is used for color remapping involving a call
back into the interpreter -- inelegant, but effective.
Internal code to indicate we have underflowed the top block
of the e-stack.
Internal code for the vmreclaim operator with a positive operand.
We need to handle this as an error because otherwise the interpreter
won't reload enough of its state when the operator returns.
Internal code for requesting more input from run_string.
Internal code for a normal exit when usage info is displayed.
This allows Window versions of Ghostscript to pause until
the message can be read.
Returns error name.
Return code from the Ghostscript.
Error name.
The Knuth-Morris-Pratt Pattern Matching Algorithm.
Class that helps us to get various information about native libraries.
Gets the image file machine type.
Native library path.
Image file machine type.
Gets the image file machine type.
Memory buffer representing native library.
Image file machine type.
Gets the image file machine type.
Stream representing native library.
Image file machine type.
Gets if native library is compiled as 64bit library.
Native library path.
True if native library is compiled as 64 bit library.
Gets if native library is compiled as 64bit library.
Memory buffer representing native library.
True if native library is compiled as 64 bit library.
Gets if machine value represents 64 bit machine.
IMAGE_FILE_HEADER->Machine value.
Represents a Ghostscript interpreter.
Initializes a new instance of the Ghostscript.NET.GhostscriptInterpreter class.
Initializes a new instance of the Ghostscript.NET.GhostscriptInterpreter class.
Memory buffer representing native Ghostscript library.
Initializes a new instance of the Ghostscript.NET.GhostscriptInterpreter class.
GhostscriptVersionInfo instance that tells which Ghostscript library to use.
Initializes a new instance of the Ghostscript.NET.GhostscriptInterpreter class.
GhostscriptVersionInfo instance that tells which Ghostscript library to use.
Tells if the Ghostscript should be loaded from the memory or directly from the disk.
Releases all resources used by the Ghostscript.NET.GhostscriptInterpreter instance.
Releases all resources used by the Ghostscript.NET.GhostscriptInterpreter instance.
Initializes a new instance of Ghostscript interpreter.
Sets the stdio and display device callback handlers.
Stdio callback handler.
DisplayDevice callback handler.
Initializes the interpreter.
Runs a string.
Runs a string.
Runs a PostScript file.
Produce color JPEG files.
Produce grayscale JPEG files.
(integer from 0 to 100, default 75)
Set the quality level value according to the widely used IJG quality scale, which balances the extent of compression
against the fidelity of the image when reconstituted. Lower values drop more information from the image to achieve
higher compression, and therefore have lower quality when reconstituted.
(float from 0.0 to 1.0).
Adobe's QFactor quality scale, which you may use in place of JPEGQ above. The QFactor scale is used by PostScript's
DCTEncode filter but is nearly unheard-of elsewhere.
Causes the media size to be fixed after initialization, forcing pages of other sizes or orientations
to be clipped. This may be useful when printing documents on a printer that can handle their requested
paper size but whose default is some other size. Note that -g automatically sets -dFIXEDMEDIA,
but -sPAPERSIZE= does not.
Causes the media resolution to be fixed similarly. -r automatically sets -dFIXEDRESOLUTION.
The page size from the PostScript file setpagedevice operator, or one of the older statusdict page size
operators (such as letter or a4) will be rotated, scaled and centered on the "best fit" page size from
those availiable in the InputAttributes list. The -dPSFitPage is most easily used to fit pages when used
with the -dFIXEDMEDIA option. This option is also set by the -dFitPage option.
Defines the meaning of the 0 and 1 orientation values for the setpage[params] compatibility operators.
The default value of ORIENT1 is true (set in gs_init.ps), which is the correct value for most files that
use setpage[params] at all, namely, files produced by badly designed applications that "know" that the
output will be printed on certain roll-media printers: these applications use 0 to mean landscape and 1
to mean portrait. -dORIENT1=false declares that 0 means portrait and 1 means landscape, which is the
convention used by a smaller number of files produced by properly written applications.
Sets the initial page width to desired value respectively, specified in 1/72" units.
Sets the initial page height to desired value respectively, specified in 1/72" units.
This value will be used to replace the device default papersize ONLY if the default papersize for the device
is 'letter' or 'a4' serving to insulate users of A4 or 8.5x11 from particular device defaults (the collection
of contributed drivers in Ghostscript vary as to the default size).
This is a "convenience" operator that sets the various options to perform page fitting for specific file types.
This option sets the -dEPSFitPage, -dPDFFitPage, and the -dFitPage options.
Begins interpreting on the designated page of the document. Pages of all documents in PDF collections are numbered sequentionally.
Stops interpreting after the designated page of the document. Pages of all documents in PDF collections are numbered sequentionally.
Causes Ghostscript to exit after processing all files named on the command line, rather than going into an
interactive loop reading PostScript commands. Equivalent to putting -c quit at the end of the command line.
Disables only the prompt, but not the pause, at the end of each page. This may be useful on PC displays that
get confused if a program attempts to write text to the console while the display is in a graphics mode.
Disables the prompt and pause at the end of each page. Normally one should use this (along with -dBATCH) when
producing output on a printer or to a file; it also may be desirable for applications where another program is
"driving" Ghostscript.
Disables the prompt printed by Ghostscript when it expects interactive input, as well as the end-of-page prompt
(-dNOPAGEPROMPT). This allows piping input directly into Ghostscript, as long as the data doesn't refer to currentfile.
Suppresses routine information comments on standard output. This is currently necessary when redirecting
device output to standard output.
Makes certain error and information messages more Adobe-compatible.
Causes bind to remember all its invocations, but not actually execute them until the .bindnow procedure is
called. Useful only for certain specialized packages like pstotext that redefine operators. See the documentation
for .bindnow for more information on using this feature.
Causes pdfmark to be called for bookmarks, annotations, links and cropbox when processing PDF files. Normally,
pdfmark is only called for these types for PostScript files or when the output device requests it (e.g. pdfwrite device).
Disables the bind operator. Useful only for debugging.
Disables character caching. Useful only for debugging.
Suppresses the initial automatic enabling of the garbage collector in Level 2 systems.
(The vmreclaim operator is not disabled.) Useful only for debugging.
Suppresses the initial save that is used for compatibility with Adobe PS Interpreters that ordinarily
run under a job server. If a job server is going to be used to set up the outermost save level, then
-dNOOUTERSAVE should be used so that the restore between jobs will restore global VM as expected.
(equivalent to -dDELAYSAFER).
This flag disables SAFER mode until the .setsafe procedure is run. This is intended for clients or scripts
that cannot operate in SAFER mode. If Ghostscript is started with -dNOSAFER or -dDELAYSAFER, PostScript
programs are allowed to read, write, rename or delete any files in the system that are not protected by
operating system permissions. This mode should be used with caution, and .setsafe should be run prior to
running any PostScript file with unknown contents.
Disables the deletefile and renamefile operators, and the ability to open piped commands (%pipe%cmd) at all.
Only %stdout and %stderr can be opened for writing. Disables reading of files other than %stdin, those given
as a command line argument, or those contained on one of the paths given by LIBPATH and FONTPATH and specified
by the system params /FontResourceDir and /GenericResourceDir.
This mode also sets the .LockSafetyParams parameter of the default device, or the device specified with the
-sDEVICE= switch to protect against programs that attempt to write to files using the OutputFile device parameter.
Note that since the device parameters specified on the command line (including OutputFile) are set prior to SAFER
mode, the -sOutputFile=... on the command line is unrestricted.
Disables as many Ghostscript extensions as feasible, to be more helpful in debugging applications that produce
output for Adobe and other RIPs.
Leaves systemdict writable. This is necessary when running special utility programs such as font2c and pcharstr,
which must bypass normal PostScript access protection.
1.
2.
4.
This option sets the resolution of the output file in dots per inch. The default value if you don't specify this options is usually 72 dpi.
This option sets the resolution of the output file in dots per inch. The default value if you don't specify this options is usually 72 dpi.
These option control the use of subsample antialiasing.
Their use is highly recommended for producing high quality rasterizations of the input files.
The size of the subsampling box n should be 4 for optimum output, but smaller values can be used for faster rendering.
Antialiasing is enabled separately for text and graphics content.
These option control the use of subsample antialiasing.
Their use is highly recommended for producing high quality rasterizations of the input files.
The size of the subsampling box n should be 4 for optimum output, but smaller values can be used for faster rendering.
Antialiasing is enabled separately for text and graphics content.
24bit RGB color.
Transparency support.
Grayscale output.
8-bit color.
4-bit color.
Black-and-white only.
Black-and-white, but the output is formed from an internal 8 bit grayscale rendering which is then error diffused and converted down to 1bpp.
Run Ghostscript.
Command arguments
StdIO callback, can be set to null if you dont want to handle it.
Define the color space alternatives.
Define whether alpha information, or an extra unused bytes is included
DISPLAY_ALPHA_FIRST and DISPLAY_ALPHA_LAST are not implemented
Define the depth per component for DISPLAY_COLORS_GRAY,
DISPLAY_COLORS_RGB and DISPLAY_COLORS_CMYK,
or the depth per pixel for DISPLAY_COLORS_NATIVE
DISPLAY_DEPTH_2 and DISPLAY_DEPTH_12 have not been tested.
Define whether Red/Cyan should come first,
or whether Blue/Black should come first
Define whether the raster starts at the top or bottom of the bitmap
Define whether packing RGB in 16-bits should use 555
or 565 (extra bit for green)
Define the row alignment, which must be equal to or greater than
the size of a pointer.
The default (DISPLAY_ROW_ALIGN_DEFAULT) is the size of a pointer,
4 bytes (DISPLAY_ROW_ALIGN_4) on 32-bit systems or 8 bytes
(DISPLAY_ROW_ALIGN_8) on 64-bit systems.
Display device callback structure.
Note that for Windows, the display callback functions are
cdecl, not stdcall. This differs from those in iapi.h.
Added in V3 */
If non NULL, then this gives the callback provider a chance to
a) be informed of and b) control the bandheight used by the
display device. If a call to allocate the page mode bitmap fails
(either an internal allocation or a display_memalloc call), then
Ghostscript will look for the presence of a
display_rectangle_request callback. If it exists, then it will
attempt to use retangle request mode.
As part of this, it will pick an appropriate bandheight. If
this callback exists, it will be called so the callback provider
can know (and, optionally, tweak) the bandheight to be used.
This is purely for performance. The callback should only ever
*reduce* the bandheight given here.
Return the adjusted bandheight (or 0 for no change).
Ask the callback for a rectangle to render (and a block to render
it in). Each subsequent call tells the caller that any previous
call has finished. To signal 'no more rectangles' return with
*w or *h = 0.
On entry: *raster and *plane_raster are set to the standard
values. All other values are undefined.
On return: *memory should point to a block of memory to use.
Pixel (*ox,*oy) is the first pixel represented in that block.
*raster = the number of bytes difference between the address of
component 0 of Pixel(*ox,*oy) and the address of component 0 of
Pixel(*ox,1+*oy).
*plane_raster = the number of bytes difference between the
address of component 0 of Pixel(*ox,*oy) and the address of
component 1 of Pixel(*ox,*oy), if in planar mode, 0 otherwise.
*x, *y, *w, *h = rectangle requested within that memory block.
Display device callback structure.
Note that for Windows, the display callback functions are
cdecl, not stdcall. This differs from those in iapi.h.
Size of this structure
Used for checking if we have been handed a valid structure
Major version of this structure
The major version number will change if this structure changes.
Minor version of this structure
The minor version number will change if new features are added
without changes to this structure. For example, a new color
format.
New device has been opened
This is the first event from this device.
Device is about to be closed.
Device will not be closed until this function returns.
Device has been closed.
This is the last event from this device.
Device is about to be resized.
Resize will only occur if this function returns 0.
raster is byte count of a row.
Device has been resized.
New pointer to raster returned in pimage
flushpage
showpage
If you want to pause on showpage, then don't return immediately
Notify the caller whenever a portion of the raster is updated.
This can be used for cooperative multitasking or for
progressive update of the display.
This function pointer may be set to NULL if not required.
Allocate memory for bitmap
This is provided in case you need to create memory in a special
way, e.g. shared. If this is NULL, the Ghostscript memory device
allocates the bitmap. This will only called to allocate the
image buffer. The first row will be placed at the address
returned by display_memalloc.
Free memory for bitmap
If this is NULL, the Ghostscript memory device will free the bitmap
Added in V2
When using separation color space (DISPLAY_COLORS_SEPARATION),
give a mapping for one separation component.
This is called for each new component found.
It may be called multiple times for each component.
It may be called at any time between display_size
and display_close.
The client uses this to map from the separations to CMYK
and hence to RGB for display.
GS must only use this callback if version_major >= 2.
The unsigned short c,m,y,k values are 65535 = 1.0.
This function pointer may be set to NULL if not required.
Represents a Ghostscript version information.
Initializes a new instance of the Ghostscript.NET.GhostscriptVersionInfo class.
Ghostscript version.
Ghostscript native library path.
Ghostscript lib path.
Ghostscript license type.
Gets Ghostscript version.
Gets Ghostscript native library path.
Gets Ghostscrip lib path.
Gets Ghostscript license type.
Returns GhostscriptVersionInfo string.
Gets installed Ghostscript versions list.
Gets installed Ghostscript versions list.
A GhostscriptVersionInfo list of the Ghostscript installations found on the local system.
Gets top installed Ghostscript version.
Gets top installed Ghostscript version.
Serch for the specific Ghostscript version based on the Ghostscript license.
If there are both license types installed, which one should have the prilorty.
GhostscriptVersionInfo object of the last installed Ghostscript version based on priority license.
Gets if the Ghostscript is installed on the local system.
Get version numbers and strings.
This is safe to call at any time.
You should call this first to make sure that the correct version
of the Ghostscript is being used.
pr is a pointer to a revision structure.
len is the size of this structure in bytes.
Returns 0 if OK, or if len too small (additional parameters
have been added to the structure) it will return the required
size of the structure.
Create a new instance of Ghostscript.
This instance is passed to most other API functions.
The caller_handle will be provided to callback functions.
Destroy an instance of Ghostscript
Before you call this, Ghostscript must have finished.
If Ghostscript has been initialised, you must call gsapi_exit()
before gsapi_delete_instance.
Set the callback functions for stdio
The stdin callback function should return the number of
characters read, 0 for EOF, or -1 for error.
The stdout and stderr callback functions should return
the number of characters written.
If a callback address is NULL, the real stdio will be used.
Set the callback function for polling.
This is used for handling window events or cooperative
multitasking. This function will only be called if
Ghostscript was compiled with CHECK_INTERRUPTS
as described in gpcheck.h.
Set the display device callback structure.
If the display device is used, this must be called
after gsapi_new_instance() and before gsapi_init_with_args().
See gdevdisp.h for more details.
Set the encoding used for the args. By default we assume
'local' encoding. For windows this equates to whatever the current
codepage is. For linux this is utf8.
Use of this API (gsapi) with 'local' encodings (and hence without calling
this function) is now deprecated!
Initialise the interpreter.
This calls gs_main_init_with_args() in imainarg.c
1. If quit or EOF occur during gsapi_init_with_args(),
the return value will be e_Quit. This is not an error.
You must call gsapi_exit() and must not call any other
gsapi_XXX functions.
2. If usage info should be displayed, the return value will be e_Info
which is not an error. Do not call gsapi_exit().
3. Under normal conditions this returns 0. You would then
call one or more gsapi_run_*() functions and then finish
with gsapi_exit().
Exit the interpreter.
This must be called on shutdown if gsapi_init_with_args()
has been called, and just before gsapi_delete_instance().
Callback function for stdio.
Callback function for gsapi_set_poll function.
Close the GhostscriptRasterizer.
Gets PDF page count.
Gets PDF page as System.Drawing.Image.
Desired dpi.
The page number.
PDF page represented as System.Drawing.Image.
Class that helps you to load and use native/unmanaged dynamic-link libraries dinamically.
It provides ability to load libraries from the memory or disk.
It's compatibile with x86 and x64 libraries.
Initializes a new instance of the NativeLibrary class from a native module stored on disk.
Native module file name.
Initializes a new instance of the NativeLibrary class from a native module byte array.
Native module byte array.
Loads the specified native module from a byte array into the address space of the calling process.
Native module byte array.
If the function succeeds, the return value is a handle to the module.
Copies sections from a native module file block to the new memory location.
Pointer to a native module byte array.
Pointer to a source native module headers.
Pointer to a memory module.
Adjusts base address of the imported data.
Pointer to a memory module.
Adjustment delta value.
Loads required dlls and adjust function table of the imports.
Pointer to a memory module.
If the function succeeds, the return value is true.
Marks memory pages depending on section headers and release sections that are marked as "discardable".
Pointer to a memory module.
Calls module entry point.
Pointer to a memory module.
If the function succeeds or if there is no entry point, the return value is true.
Deattach from the process and do a cleanup.
Pointer to a memory module.
Retrieves a delegate of an exported function or variable from loaded module.
The function or variable name.
The type of the delegate to be returned.
A function instance.
Retrieves a delegate of an exported function or variable from loaded module.
Delegate type.
The function or variable name.
A function instance.
Retrieves the address of an exported function or variable from loaded module.
The function or variable name.
If the function succeeds, the return value is the address of the exported function or variable.
If the function fails, the return value is IntPtr.Zero.
Copies bytes between buffers.
New buffer.
Buffer to copy from.
Number of characters to copy.
Sets buffers to a specified character.
Pointer to destination.
Character to set.
Number of characters.
Reallocate memory blocks.
Pointer to previously allocated memory block.
Previously allocated memory block size.
New size in bytes.