To do complete print integration, your application must:
Provide a print action
Use the four desktop printing environment variables
To have fully integrated printing, your application must use the values of the following four environment variables. The LPDEST variable is particularly important. It provides the ability for the user to choose the print destination by using a particular printer drop zone.
The print action is usually defined in a configuration file, app_root/dt/appconfig/types/<language>/name.dt.
If your print action starts a program that dereferences the four environment variables indicated in "Desktop Printing Environment Variables", then your data type is fully integrated. The print action must be written to be specific for the application's data type and should accept only a single file.
For example, the following print action is specific for a data type named ThisAppData:
ACTION Print { ARG_TYPE ThisAppData EXEC_STRING print_command -file %(file)Arg_1% }
If your application handles the ToolTalk Media message set Print request, then your print action could send a variant of it with the following actions.
ACTION Print { ARG_TYPE ThisAppData ARG_CLASS FILE ARG_COUNT 1 TYPE TT_MSG TT_CLASS TT_REQUEST TT_SCOPE TT_SESSION TT_OPERATION Print TT_FILE %Arg_1% TT_ARG0_ MODE TT_IN TT_ARG0_ VTYPE %Arg_1% TT_ARG1_ MODE TT_IN TT_ARG1_ VTYPE LPDEST TT_ARG1_VALUE $LPDEST TT_ARG2_MODE TT_IN TT_ARG2_VTYPE DTPRINTUSERFILENAME TT_ARG2_VALUE $DTPRINTUSERFILENAME TT_ARG3_MODE TT_IN TT_ARG3_VTYPE DTPRINTSILENT TT_ARG3_VALUE $DTPRINTSILENT TT_ARG4_MODE TT_IN TT_ARG4_VTYPE DTPRINTFILEREMOVE TT_ARG4_VALUE $DTPRINTFILEREMOVE } ACTION Print { ARG_TYPE ThisAppData ARG_CLASS BUFFER ARG_COUNT 1 TYPE TT_MSG TT_CLASS TT_REQUEST TT_SCOPE TT_SESSION TT_OPERATION Print TT_ARG0_MODE TT_IN TT_ARG0_VTYPE %Arg_1% TT_ARG0_VALUE %Arg_1% TT_ARG1_MODE TT_IN TT_ARG1_VTYPE LPDEST TT_ARG1_VALUE $LPDEST TT_ARG2_MODE TT_IN TT_ARG2_VTYPE DTPRINTUSERFILENAME TT_ARG2_VALUE $DTPRINTUSERFILENAME TT_ARG3_MODE TT_IN TT_ARG3_VTYPE DTPRINTSILENT TT_ARG3_VALUE $DTPRINTSILENT TT_ARG4_MODE TT_IN TT_ARG4_VTYPE DTPRINTFILEREMOVE TT_ARG4_VALUE false }
If any of the four environment variables are not set, the corresponding message argument will be null. When the message argument is null, refer to "Desktop Printing Environment Variables" for the default interpretation.
The desktop print utility /usr/dt/dtlp provides functionality on top of the lp subsystem. It gathers lp print options and prints the specified file.
Your application can use dtlp if either of the following conditions is true:
The data files do not need to be processed before they are sent to a printer.
Or, your application provides a filter for converting its data files to a ready-to-print form.
For more information about dtlp, see the dtlp(1) man page.
If the file is ready to print, the Print action runs dtlp in the EXEC_STRING.For example:
ACTION Print { ARG_TYPE ThisAppData EXEC_STRING dtlp %Arg_1% }
If the application provides a conversion filter, the filter must be run before running dtlp. For example:
ACTION Print { ARG_TYPE MyAppData EXEC_STRING /bin/sh `cat %Arg_1%| filter_name | dtlp` }
where filter_name is the name of the print filter.