ERRCODE TFormer_SetPrinterName ( HTFORM  pInstance,
LPCSTR  pszPrinterName,
DEVMODE *  pDevMode 
)

Sets type and name of the output device.

Returns:
- ErrOk (0) in case of success
- Non-zero if error occurred
Parameters:
[in] pInstance The TFORMer-Instance provided by a previous call to TFormer_Init.
[in] pszPrinterName Printer name as defined in Windows (see Control Panel). Use NULL or an empty string ("") to use the default printer of the logged-on user.
[in] pDevMode Special device-mode settings for Windows printers, usually NULL to use the default settings. Can be used for modifying printer driver behavior directly.
[in] pszCupsOptions CUPS options string which is passed directly to CUPS (Linux/UNIX only). Use NULL for default settings.
See also:
TFormer_SetPrinterType, TFormer_SetOutputName
Remarks:
Specifies the output format as well as the target device or target filename. By using a prefix for the device name the output type may be specified (see table below). If a prefix is specified you can omit TFormer_SetPrinterType. This function must be called before TFormer_Print. On Windows platforms the parameter pDevMode may be used to modify default GDI printer settings. All valid fields passed via pDevMode are merged with the default settings of the printer question. For more information check out the Win32 SDK documentation.
Output Devices and Formats
Prefix Example Description
No Prefix HP4050PS Direct printing to the printer specified. This method is only available under Microsoft Windows and uses GDI methods. Supply a printer name as defined by Windows (\\server\printer, printer).
PDFFile: PDFFile:C:\Temp\out.pdf PDF-output is stored in C:\temp\out.pdf
PDF: PDF:C:\Temp\out.pdf PDF-output is stored in C:\temp\out.pdf
HTML: HTML:C:\Temp\out.html HTML-output stored in C:\temp\out.html and automatically named subfolders
PS: PS:C:\Temp\out.ps PostScript-output is stored in C:\temp\out.ps
PSPRINTER: PSPRINTER:HP4050PS Direct printing to the printer specified. Because the output format is already PostScript a generic ASCII printer driver must be used.
TXT: TXT:C:\temp\out.txt Plain text output is stored in C:\temp\out.txt
TXTPRINTER: TXTPRINTER:ZEBRA4M Direct printing to the printer specified. Because the output format is plain text which may contain printer control sequences a generic ASCII printer driver must be used.
REPO: REPO:PrinterName Direct printing to the printer specified in the Repository. This method is only available under Microsoft Windows and uses GDI methods.
IMGBMP: IMGBMP:C:\temp\out.bmp The BMP image file named out.bmp is stored in C:\temp. If the output consists of multiple pages, multiple output files are generated. In this case the page number is appended to the filename (e.g. out_001.bmp). As an alternative you can use the # character as placeholder for the pagenumer: e.g. out###.bmp
IMGGIF: IMGGIF:C:\temp\out.gif The GIF image file named out.gif is stored in C:\temp. If the output consists of multiple pages, multiple output files are generated. In this case the page number is appended to the filename (e.g. out_001.gif). As an alternative you can use the # character as placeholder for the pagenumer: e.g. out###.gif
IMGJPG: IMGJPG:C:\temp\out.jpg The JPG image file named out.jpg is stored in C:\temp. If the output consists of multiple pages, multiple output files are generated. In this case the page number is appended to the filename (e.g. out_001.jpg). As an alternative you can use the # character as placeholder for the pagenumer: e.g. out###.jpg
IMGPCX: IMGPCX:C:\temp\out.pcx The PCX image file named out.pcx is stored in C:\temp. If the output consists of multiple pages, multiple output files are generated. In this case the page number is appended to the filename (e.g. out_001.pcx). As an alternative you can use the # character as placeholder for the pagenumer: e.g. out###.pcx
IMGPNG: IMGPNG:C:\temp\out.png The PNG image file named out.png is stored in C:\temp. If the output consists of multiple pages, multiple output files are generated. In this case the page number is appended to the filename (e.g. out_001.png). As an alternative you can use the # character as placeholder for the pagenumer: e.g. out###.png
IMGTGA: IMGTGA:C:\temp\out.tga The TGA image file named out.tga is stored in C:\temp. If the output consists of multiple pages, multiple output files are generated. In this case the page number is appended to the filename (e.g. out_001.tga). As an alternative you can use the # character as placeholder for the pagenumer: e.g. out###.tga
IMGTIF: IMGTIF:C:\temp\out.tif The TIF image file named out.tif is stored in C:\temp. If the output consists of multiple pages, multiple output files are generated. In this case the page number is appended to the filename (e.g. out_001.tif). As an alternative you can use the # character as placeholder for the pagenumer: e.g. out###.tif
IMGMULTITIF:IMGMULTITIF:C:\temp\out.tifThe TIF image file named out.tif is stored in C:\temp. All pages are stored in a single output file.
ZPL: ZPL:C:\temp\out.zpl ZPL-II output (suitable for ZEBRA printers) is stored in C:\temp\out.zpl.
ZPLPRINTER: ZPLPRINTER:ZEBRA4M Direct printing in ZPL-II format to the operating system printer named ZEBRA4M. Because the output format is already ZPL-II a generic ASCII printer driver must be used.

Note:
TFORMer uses a configuration file named TFORMer.xml for adjusting output options and paper format names. Since paper format names are also used in JobTrayControl please check out TFormer_SetConfigFile too.

Usually this function is used instead of TFormer_SetPrinterType and TFormer_SetOutputName. If you print to a Windows printer you can use TFormer_SetOutputName to specify the name of the spool job.


© 2006-2009 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Wed Sep 2 16:01:09 2009 for TFORMer Runtime DLL/Shared Library with doxygen 1.5.8