Customizing Print Driver Plug-Ins

You can use print drivers other than those provided with V6. To do so, you can plug-in your own print drivers in your environment without CAA context using CATPrtDrvPlugins.

A CATPrtDrvPlugin is made of one group of 10 functions and one shared data structure:


  • Plug-in methods are functions you implement in the plug-in. These functions will then be called by V6. Their names all begin with "CATPDP_", for instance CATPDP_Begin.

  • Data structures are plug-in-specific types defined for use in the plug-in API. Their names begin with "CATPDP".

    All plug-in API structures and definitions are found in CATPDPluginAPI.h located in $CATStartupPath\startup\PrintServices\PrintDriverPlugIn.

A plug-in is a native code library whose source conforms to standard C syntax. You can use the template file (CATPluginTemplate.cpp) located in $CATStartupPath\startup\PrintServices\PrintDriverPlugIn and adapt it to your needs by implementing the plug-in methods provided by V6.

When the code has been written, you will have to compile and build the module then declare the resulting module to the Print Driver Manager File. The file CATPDPlugin.mak provided in $CATStartupPath\startup\PrintServices\PrintDriverPlugIn\BUILD\WINDOWS can help you build your library module.

  1. Access the file CATPluginTemplate.cpp located in $CATStartupPath\startup\PrintServices\PrintDriverPlugIn.

  2. Write the code corresponding to the interfaces to implement the plug-in methods that will be called by V6.

    For information on the syntax and use of C or C++ language, see your language documentation.

    The methods provided are listed in the table below. Click the desired method to access the corresponding description:

    Method Name Description
    CATPDPP_Begin Driver initialization with parameters provided by user interface
    CATPDP_End Indicates if the plug-in driver is about to be closed or removed
    CATPDP_DefineColor Defines a RGB color in the palette
    CATPDP_SelectDrawColor Selects the drawing color
    CATPDP_SetDrawWidth Selects the drawing path
    CATPDP_MoveTo Moves the pen without drawing
    CATPDP_LineTo Draws a line
    CATPDP_SelectFillColor Selects the filling color for polygon primitives
    CATPDP_FillArea Fills a polygon
    CATPDP_DrawBitmap Draws a bitmap

  3. Compile and build the module.

    Important: You can use the file CATPDPlugin.mak provided in $CATStartupPath\startup\PrintServices\PrintDriverPlugIn\BUILD\WINDOWS.

  4. In a V6 session, select Tools > Options... > General > Printers.

  5. In the Printer List area, click Add.



  6. In the Add Printer Wizard dialog box, select a printer type then click OK.



  7. In the Printer Properties dialog box, select V5 Print Plugin Driver from the Driver list.

  8. Click Advanced Configuration....



  9. In the Plugin Driver selection box, enter the path of the library module you built in step 3 or click Plugin... which enables you to browse your file tree.

  10. Click OK.

  11. Select PLM Access > Print.

  12. In the Print dialog box, indicate the name of the new customized printer in the Printer Name

    box.

  13. Modify the desired print settings then click OK to print the document.