Package org.ghost4j.display
Interface DisplayCallback
-
- All Known Implementing Classes:
ImageWriterDisplayCallback
,PageRasterDisplayCallback
public interface DisplayCallback
Interface representing a display callback. A display callback provides method to interract with the Ghostscript interpreter display. This can be usefull if you are interested in capturing PS or PDF page rasters. Important: in order to use a display callback, Ghostscript must be initialized with -sDEVICE=display -sDisplayHandle and -dDisplayFormat arguments. Usually set -sDisplayHandle to 0 and use -dDisplayFormat to define how display data will be sent to the displayPage method. -dDisplayFormat=16#804 sets a standard RGB ouput. Please refer to http://ghostscript.com/doc/8.54/Devices.htm to see how to set display parameters.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
displayClose()
Method called when device has been closed.void
displayOpen()
Method called when new device has been opened.void
displayPage(int width, int height, int raster, int format, int copies, int flush, byte[] imageData)
Method called on show page.void
displayPreClose()
Method called when device is about to be closed.void
displayPreSize(int width, int height, int raster, int format)
Method called when device is about to be resized.void
displaySize(int width, int height, int raster, int format)
Method called when device has been resized.void
displaySync()
Method called on page flush.void
displayUpdate(int x, int y, int width, int height)
Method called to notify whenever a portion of the raster is updated.
-
-
-
Method Detail
-
displayOpen
void displayOpen() throws GhostscriptException
Method called when new device has been opened. This is the first event from this device.- Throws:
GhostscriptException
-
displayPreClose
void displayPreClose() throws GhostscriptException
Method called when device is about to be closed. Device will not be closed until this function returns.- Throws:
GhostscriptException
-
displayClose
void displayClose() throws GhostscriptException
Method called when device has been closed. This is the last event from this device.- Throws:
GhostscriptException
-
displayPreSize
void displayPreSize(int width, int height, int raster, int format) throws GhostscriptException
Method called when device is about to be resized.- Parameters:
width
- Widthheight
- Heightraster
- Rasterformat
- Format- Throws:
GhostscriptException
-
displaySize
void displaySize(int width, int height, int raster, int format) throws GhostscriptException
Method called when device has been resized.- Parameters:
width
- Widthheight
- Heightraster
- Rasterformat
- Format- Throws:
GhostscriptException
-
displaySync
void displaySync() throws GhostscriptException
Method called on page flush.- Throws:
GhostscriptException
-
displayPage
void displayPage(int width, int height, int raster, int format, int copies, int flush, byte[] imageData) throws GhostscriptException
Method called on show page.- Parameters:
width
- Widthheight
- Heightraster
- Rasterformat
- Formatcopies
- Copiesflush
- FlushimageData
- Byte array representing image data. Data layout and order is controlled by the -dDisplayFormat argument.- Throws:
GhostscriptException
-
displayUpdate
void displayUpdate(int x, int y, int width, int height) throws GhostscriptException
Method called to notify whenever a portion of the raster is updated.- Parameters:
x
- X coordinatey
- Y coordinatewidth
- Widthheight
- Height- Throws:
GhostscriptException
-
-