Ghostscript which includes the common api




















Jan 16, Feb 9, Jan 29, Aug 12, Aug 6, Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Warning Some features may not work without JavaScript. Please try enabling it if you encounter problems. Search PyPI Search. Latest version Released: Mar 6, Navigation Project description Release history Download files. Project links Homepage Download. The device may be opened and closed many times, sometimes without any output being produced. This function will be called when the display device is about to be closed.

The device will not actually be closed until this function returns. This function will be called once the display device has been closed. This function will be called when the display device is about to be resized. The device will only be resized if this function returns 0.

This function will be called when the display device is has been resized. The pointer to the raster image is pimage. This function is called on a "showpage" operation i. Operation will continue as soon as this function returns.

This function may get called repeatedly during rendering to indicate that an area of the output has been updated. Certain types of rendering will not see this function called back at all in particular files using transparency.

If this function pointer is sent as NULL, then the display device will handle all the memory allocations internally, and will always work in full page rendering mode. Otherwise, this function will be called to allocate the storage for the page to be rendered into. If a non-NULL value is returned, then the device will proceed to render the full page into it. If both of those conditions are true, then the device will continue in rectangle request mode.

Otherwise it will fail with an out of memory error. The supplied c , m , y and k values give the equivalent color for each spot. Each colorant value ranges from 0 for none to full. When running in "rectangle request mode" the device first renders the page to a display list internally. It can then be played back repeatedly so that different regions rectangles of the page can be extracted in sequence. A common use of this is to support "banded" operation, where the page is divided into multiple non-overlapping bands of a fixed height.

The display device itself will pick an appropriate band height for it to use. If this function pointer is left as NULL then this value will be used unchanged.

Otherwise, the proposed value will be offered to this function. This function can override the choice of bandheight, by returning the value that it would like to be used in preference. In general, this figure should as much as possible only be adjusted downwards. For example, a device targeting an inkjet printer with nozzles in the print head might like to extract bands that are a multiple of lines high.

If the function returns 0, then the existing value will be used unchanged. Any size rectangle can be chosen with any size bandheight, so ultimately the value chosen here will not matter much. It may make some small difference in speed in some cases.

If the display device chooses to use rectangle request mode, this function will be called repeatedly to request a rectangle to render. Ghostscript will render the rectangle, and call this function again. The implementer is expected to handle the rectangle that has just been rendered, and to return the details of another rectangle to render.

This will continue until a rectangle with zero height or width is returned, whereupon Ghostscript will continue operation. All the other pointers point to uninitialised values. On exit, the values should be updated appropriately. The implementor is expected to store the values returned so that the rendered output given can be correctly interpreted when control returns to this function. Any set of rectangles can be rendered with this method, so this can be used to drive Ghostscript in various ways.

Firstly, it is simple to request a set of non-overlapping "bands" that cover the page, to drive a printer. Alternatively, rectangles can be chosen to fill a given block of memory to implement a window panning around a larger page.

Either the whole image could be redrawn each time, or smaller rectangles around the edge of the panned area could be requested. The choice is down to the caller. Some examples of driving this code in full page mode are in dwmain. On some platforms, the calling convention for the display device callbacks in gdevdsp.

This supercedes the old DLL interface. The Linux shared object libgs. This instance is passed to most other gsapi functions. Set the callback structure for the display device. The handle passed in the callback functions is taken from the DisplayHandle parameter or NULL if there is no such parameter.

See gdevdsp. By default we expect args to be in encoding 0 the 'local' encoding for this OS. On Windows this means "the currently selected codepage". On Linux this typically means utf8. 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. Allows the calling application to influence which device s gs will try, in order, in it's selection of the default device.

See below for return codes. The arguments are the same as the "C" main function: argv[0] is ignored and the user supplied arguments are argv[1] to argv[argc-1]. Broadly, this is equivalent to setting a parameter using -d , -s or -p on the command line. See gdevdsp. See below for return codes. The arguments are the same as the "C" main function: argv[0] is ignored and the user supplied arguments are argv[1] to argv[argc-1].

If set to a negative value, the functions will return an error code directly to the caller, bypassing the interpreted language. See Lib. This function is useful for debug clients only. Release clients must not call it. This is not an error. If you want to see output from Ghostscript you must do this explicitly as shown in the example below.



0コメント

  • 1000 / 1000