Plug-In Methods

You can plug-in your own print drivers in your environment without CAA context using the CATPrtDrvPlugins provided by V6.

CATPDP_Begin

CATPDP_Begin provides global initialization for the plug-in driver.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError CATPDP_Begin(const CATPDPParameters& iParam);

Parameters

iParams Global structure data parameters

Various user printing options

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Description

This is the first call used from the Printer Manager to inform the driver plug-in that the printing is started. The Printer Manager fills the CATPDPParameters according to the user choices. This structure is then passed to the plug-in by calling the CATPDP_Begin function.

CATPDP_End

CATPDP_End provides global deinitialization for the plug-in driver.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError CATPDP_End(void);

Parameters

No parameters.

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Description

The Printer Manager calls this function when the printing is done. Be sure to release allocations, instances or file I/O flushing in this function. After this call the plug-in driver is unloaded and the printing is stopped.

CATPDP_DefineColor

CATPDP_DefineColor defines a color in the palette.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError CATPDP_DefineColor(int iIndex , float iRed, float iGreen, float iBlue);

Parameters

iIndex Index in the color table (between 0 and 255)
iRed Red color in RGB coordinates (between 0 and 1)
iGreen Green color in RGB coordinates (between 0 and 1)
iBlue Blue color in RGB coordinates (between 0 and 1)

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Description

Defines a color in rgb coordinates. This index is used for function CATPDP_SelectDrawColor or CATPDP_SelectFillColor.

CATPDP_SelectDrawColor

CATPDP_SelectDrawColor selects the drawing color.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError CATPDP_SelectDrawColor(int index);

Parameters

iIndex Index of the current drawing color (between 0 and 255) used for next drawing primitive.

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Decsription

Selects the current drawing color related to the index defined by the CATPDP_DefineColor.

CATPDP_SetDrawWidth

CATPDP_ SetDrawWidth selects the current draw width.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError CATPDP_ SetDrawWidth (float iWidth);

Parameters

IWidth Thickness in mm of the current drawing width used for next drawing primitives

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Description

Selects the current draw width. The width is in mm.

CATPDP_MoveTo

CATPDP_MoveTo moves the pen without drawing.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError (float iX, float iY);

Parameters

iX X coordinate to move
iY Y coordinate to move

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Description

Moves the pen to (x, y) in device coordinates without drawing. Coordinates are in mm.

CATPDP_LineTo

CATPDP_LineTo draws a line.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError CATPDP_LineTo(float iX, float iY)

Parameters

iX X coordinate to draw
iY Y coordinate to draw

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Description

Draws a line from the current pen position to (x, y) in device coordinates with current draw color, line type and draw width.

CATPDP_SelectFillColor

CATPDP_SelectFillColor selects the fill color.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError CATPDP_SelectFillColor (int iIndex)

Parameters

iIndex Index of the current Fill color (between 0 and 255) used for next Fill primitive

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Description

Selects the current filling color related to the index defined by the CATPDP_DefineColor.

CATPDP_FillArea

CATPDP_FillArea fills a polypolygon.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError CATPDP_FillArea(int iOutlines, const int* iCorners, const float* iCoord)

Parameters

IOutlines Number of polygons in the polypolygon
iCorners Array of outlines integers giving the number of corners in each polygon
iCoord Array of floats giving the coordinates of alls corners of each polygon

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Description

Fills a polypolygon in device coordinates with current fill color.

CATPDP_DrawBitmap

CATPDP_DrawBitmap draws a bitmap.

Syntax

#include < CATPDPluginAPI.h >

CATPDPError CATPDP_DrawBitmap(float iX, float iY, const int iTypeOfBitmap, const unsigned char* iPixels, const int iSize);

Parameters

iX X coordinate of the bitmaps to draw
iY Y coordinate of the bitmaps to draw
iTypeOfBitmap Color mode of bitmap: 0 = RGB, 1 = Black and White bitmap
iPixels Array of pixels
iSize Size in bytes of the pixel array

Returns


  • If successful, the function returns CATPDP_NO_ERROR
  • If unsuccessful, the function returns an error code.

Description

Draws a bitmap in device coordinates at the given (x, y) position.