Complex Printer Configuration
Introduction
A printer configuration defines a list of available printers, along with the defaults and constraints for each printer. A valid PrinterConfig.xml can be used to create a printer configuration at the Site or Organizations containers using the Visualization Configuration Administration utility. A valid printer configuration is also required in order to enable Batch Print. Refer to the $wt_home\codebase\com\ptc\wvs\server\xml\PrinterConfigSchema.xsd schema definition to understand different possibilities and constraints involved in constructing a PrinterConfig.xml.
See $wt_home\codebase\com\ptc\wvs\server\xml\PrinterConfig-SimpleTemplate.xsd for details about the configurable elements and attributes of a simple PrinterConfig.xml.
See $wt_home\codebase\com\ptc\wvs\server\xml\PrinterConfig-ComplexTemplate.xsd for details about the configurable elements and attributes of a complex PrinterConfig.xml.
In addition, $wt_home\codebase\com\ptc\wvs\server\xml\PrinterConfig-WorkingExample.xsd contains a sample printer configuration for PrinterConfig.xml.
Printer configuration in WVS is structured in a series of blocks, called elements. Each element is discussed separately.
printers Element
The printers block defines all printers, along with global defaults and dictionaries of available paper sizes, paper orientations, and so on.
Attribute Name
Description
resource
Optional. Defines the resource bundle used to display a localized string in the batchprint UI. Out of the box, batchPrintResource is provided, which includes commonly used localized strings for the batchprint UI.
Examples:
resource ="com.ptc.windchill.enterprise.wvs.batchPrint.batchPrintResource"
<printers resource ="com.ptc.windchill.enterprise.wvs.batchPrint.batchPrintResource">
printer Element
The printer block defines a single printer. It also defines UI defaults that are displayed when selecting a printer based on the properties of the printer as defined in this block. define a printer block for each available printer.
Attribute Name
Description
id
Required. The value is a unique integer that identifies the printer in this printer configuration.
name
Required. The value is the name that the printworker uses to access the printer. The name is displayed in the UI if the comment attribute (below) is not specified.
workerhost
Required. Defines the workerhost for the corresponding printworker defined in $wt_home\conf\wvs\agent.ini
workertype
Required. Out of the box, the value is PRINT.
comment
Optional. A descriptive name for the printer that is displayed in the batchprint UI. If not specified, the name of the printer is displayed instead.
location
Optional. The location of the printer. If specified along with the comment attribute, the location is displayed in the batchprint UI in square brackets after the printer comment.
papertray
Optional. The paper tray ID that is used for all files printed on the printer.
Examples:
<printer id="1" name="\\AH-MP2\AH-8PT-PRINTER" workerhost="printworker1.ptcnet.ptc.com" workertype="PRINT"/>
<printer id="2" name="\\AH-MP2\AH-8PTW-COPIER" workerhost="printworker1.ptcnet.ptc.com" workertype="PRINT" comment="B/W Duplex Copier" location="West CADroom" />
<printer id="3" name="\\AH-MP2\AH-8PTL-PRINTER-C workerhost="printworker1.ptcnet.ptc.com" workertype="PRINT" comment="Color Laser Printer" location="East CADroom" />
<printer id="unique_printer_id" name="printworker_accessible_printername" workerhost="printworker_hostname_here" workertype="PRINT" comment="descriptive_printername_for_UI" location="descriptive_printerlocation_for_UI">
supportedtypes Element
The supportedtypes element is a child element of the printer block, and defines the extensions and/or Creo View file types that this printer supports. The extensions and/or file types defined in this section are used to determine if this printer is listed in the list of valid printers for a given printable item row in the batchprint UI.
If this block is not defined, then the default is alltypes- meaning all extensions and file types are supported by this printer.
Examples:
Define printer for printing only .jpg, .jpeg and .tiff extensions:
<supportedtypes>jpg jpeg tiff</supportedtypes>
Define printer for printing only drawing type files and .pdf extensions:
<supportedtypes>drawing pdf</supportedtypes <supportedtypes>list_of_types_and_extensions</supportedtypes>
defaultorientation Element
The defaultorientation element is a child element of the printer block, and defines the default orientation to be used when printing a file on this printer. This orientation is selected by default in the UI.
* 
For certain file types, such as drawing files, the paper orientation to be used for printing is defined inside the printable file. For such files, the orientation used and displayed is the orientation on the printable file and not what is defined by the defaultorientationvalue.
If the defaultorientation element is not defined, then the first non-unknown (i.e., pvis=0) and non-custom (i.e. pvsid=1) <orientation>defined in the <paperorientation> block at the end of this file is used as the default orientation.
Attribute Name
Description
name
Required. The name of the orientation. This name must match one of the names defined in the <paperorientation>section at the end of this file.
Examples:
Set default orientation to Portrait:
<defaultorientation name="Portrait" />
Set default orientation to Landscape:
<defaultorientation name="Landscape" /> <defaultorientation name="default_paper_orientation" />
defaultprintscale Element
The defaultprintscale block is a child element of the printer block, and defines the default print scale that is used when printing a file on this printer. This scale is selected by default in the batchprint UI.
If the defaultprintscale element is not defined, then the first non-unknown (i.e., pvis=0) and non-custom (i.e. pvsid=1) <scale> defined in the <printscales> block at the end of this file is used as the default scale.
Attribute Name
Description
name
Required. The name of the scale. This name must match one of the <scale> names defined in the <printscales> section at the end of this file.
Examples:
Set default scale to 100%:
<defaultorientation name="Portrait" />
Set default scale to Fit to Page:
<defaultorientation name="Fit to Page" /> <defaultprintscale name="default_print_scale" />
monochrome Element
The monochrome block is a child element of the printer block, and defines whether the printer is monochrome. If defined, this value is reflected in the batchprint printoptions modal window for this printer. If not defined, monochrome is assumed to be false, meaning that the printer is assumed to support color printing.
Examples:
Set printer for black-and-white printing:
<monochrome>true</monochrome>
Set printer for color printing:
<monochrome>false</monochrome> <monochrome>true_or_false</monochrome>
papersize Element
The papersize block is a child element of the printer block, and defines the paper size(s) supported by this printer. This paper size is displayed by default in the batchprint UI.
* 
For certain file types, such as drawing files, the paper size to be used for printing is defined inside the printable file. For such files, the paper size used and displayed is the size defined in the printable file and not what is defined in this section.
If not defined, no specific paper size is assumed. A dictionary of all possible paper sizes is defined in the <papersizes> section at the end of this file.
Attribute Name
Description
name
Required. The name of the paper size. This name must match one of the <size> names defined in the <papersizes> section at the end of this file.
Examples:
Set supported paper size to A4:
<papersize name="A4" />
Set supported paper size to ANSI_B:
<defaultorientation name="ANSI_B" /> <papersize name="paper_size_name">
alternatepapersize Element
The alternatepapersize block is a child element of the printer block, and defines the alternate paper size(s) supported by this printer. The alternatepapersize element must be added for each alternate paper size supported by this printer. This block is a convenient way to define supported paper sizes in both metric and imperial size conventions.
* 
For certain file types, such as drawing files, the paper size to be used for printing is defined inside the printable file. For such files, the papersize name is used and displayed if the size defined in the printable file matches with the alternate paper size name.
If not defined, no specific supported alternate paper size is assumed. A dictionary of all possible alternate paper sizes as is defined in the <papersizes> section at the end of this file.
Attribute Name
Description
name
Required. The name of the alternate paper size. This name must match one of the <size> names defined in the <papersizes> section at the end of this file.
Examples:
Set supported paper size to Letter and set alternate paper size to ANSI_A:
<papersize name="Letter" /> <alternatepapersize name="ANSI_A" /> </papersize>
Set supported paper size to ANSI_B and set alternate paper size to Tabloid:
<papersize name="ANSI_B" /> <alternatepapersize name="Tabloid" /> </papersize>
<alternatepapersize name="alternate_papersize_name" /> </papersize> </printer>
defaultprinters Element
The defaultprinters block is a child element of the printer block, and defines the default printer for a given file extension or a given Product View file type.
Attribute Name
Description
defaultprinterid
Required. This attribute defines the overall default printer for this printer configuration.
Examples:
Setting printer id “1” as the overall default printer in this printer configuration, and not defining any other specific defaults for any other file types or extensions.
<defaultprinters defaultprinterid="1"/> <alternatepapersize name="ANSI_A" /> </papersize>
filetype Element
The filetype block is a child element of the defaultprinters block, and defines the default printer for a given Product View file type or file extension. If not defined, no specific default printer is assumed for any file type or extension.
Attribute Name
Description
type
Required. The value is either a Creo View file type or a file extension for which a default printer is to be defined.
printerid
Required. The value of the id attribute for the printer to be used as the default printer for this type.
Examples:
Set the overall default printer to 1, and set printer id 2 as the default printer for printing .jpeg extensions and all other drawing-type files.
file extensions<defaultprinters defaultprinterid="1"/> <filetype type="jpeg" printerid="2" / <filetype type="drawing" printerid="2" /> </defaultprinters>
Examples:
Set the overall default printer to 1, and set printer id 2 as the default printer for printing.cgm extensions and setting printer id 3 for all other drawing-type files.
file extensions<defaultprinters defaultprinterid="1"/> <filetype type="cgm" printerid="2" / <filetype type="drawing" printerid="3" /> </defaultprinters> <filetype type="type_or_extension" printerid="printer_id_to_be_marked_default_for_this_type" /> </defaultprinters>
printabletypes Element
The printabletypes block is a child element of the printers block, and defines a display filter that enables or disables the display of certain extensions based on the file type.
<printabletypes>
pvtypes Element
The pvtypes block is a child element of the printabletypes block, and defines a display filter that enables or disables the display of certain extensions for a single file type.
Attribute Name
Description
type
Required. type is the name of the Creo View file type to be filtered.
filter
Required. This can be include or exclude. When the include filter is used, only the extension specified by the filterby attribute is displayed. When the exclude filter is used, only the extension specified by the filterby attribute is excluded. If the filterby attribute is excluded, then all printable items for that type are excluded.
filterby
Contains a list of extensions to include or exclude. If filterby is not defined, it is assumed to be alltypes. Multiple extensions can be separated using spaces.
Examples:
Filter all “model” file types:
<printabletypes> <pvtype type="model" filter="exclude" /></printabletypes>
Filter all “model” file types and filter.cgm extensions for drawings:
<printabletypes> <pvtype type="model" filter="exclude" /> <pvtype type="drawing" filter="exclude" filterby="cgm"/></printabletypes>
Only display files with .pdf extension for document file types:
<printabletypes> <pvtype type="document" filter="include" filterby="pdf"/></printabletypes>
<pvtype type="filetype_name" filter="include_or_exclude" filterby="space_separated_file_extensions"/>
* 
This line must be added because batch print does not support Microsoft document types.
<pvtype type="document" filter="exclude" filterby="doc docx xls xlsx ppt pptx" /></printabletypes>
Out-of-the-Box Defaults
This section defines the defaults for paper sizes, paper orientation, print scales, and units. These entries are only used when a job and/or printer makes use of these properties. Do not delete the lines in this section. Your administrator can modify existing entries or add custom entries for paper sizes, paper orientation, print scales, or units.
pvsid numbers are internal numbers and must not be changed. pvsid=1 is reserved for all site-specific customizations, and pvsid=0 is reserved for other (or unknown) entries.
For the paper size, paper orientation, scale, and unit elements in the following section, you can define a resourcekey attribute. If defined, the value of this resourcekey is used in the batchprint UI. The resourcekey must exist in the resource defined previously in the printers Element section. If no resourcekey is defined, the name value is used in the batchprint UI.
<papersizes> <size id="0" name="Unknown" pvsid="0" /> <size id="1" name="Custom1" pvsid="1" width="3" height="4" units="in" /> <size id="2" name="Custom2" pvsid="1" width="5" height="6" units="in" /> <size id="3" name="Custom3" pvsid="1" width="8" height="10" units="in" /> <size id="4" name="Letter" pvsid="2" width="8.5" height="11" units="in" /> resourcekey="PRINT_CONFIG_PAPERSIZE_LETTER" /> <size id="5" name="Legal" pvsid="3" width="8.5" height="14" units="in" /> resourcekey="PRINT_CONFIG_PAPERSIZE_LEGAL" /> <size id="6" name="Tabloid" pvsid="4" width="11" height="17" units="in" /> resourcekey="PRINT_CONFIG_PAPERSIZE_TABLOID" /> <size id="7" name="ANSI_A" pvsid="2" width="8.5" height="11" units="in" /> resourcekey="PRINT_CONFIG_PAPERSIZE_ANSI_A" /> <size id="8" name="ANSI_B" pvsid="4" width="11" height="17" units="in" /> resourcekey="PRINT_CONFIG_PAPERSIZE_ANSI_B" /> <size id="9" name="ANSI_C" pvsid="5" width="17" height="22" units="in" /> resourcekey="PRINT_CONFIG_PAPERSIZE_ANSI_C" /> <size id="10" name="ANSI_D" pvsid="6" width="22" height="34" units="in" /> resourcekey="PRINT_CONFIG_PAPERSIZE_ANSI_D" /> <size id="11" name="ANSI_E" pvsid="7" width="34" height="44" units="in" /> resourcekey="PRINT_CONFIG_PAPERSIZE_ANSI_E" /> <size id="12" name="ANSI_F" pvsid="8" width="28" height="40" units="in" /> resourcekey="PRINT_CONFIG_PAPERSIZE_ANSI_F" /> <size id="13" name="A0" pvsid="9" width="841" height="1189" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A0" /> <size id="14" name="A1" pvsid="10" width="594" height="841" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A1" /> <size id="15" name="A2" pvsid="11" width="420" height="594" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A2" /> <size id="16" name="A2" pvsid="12" width="297" height="420" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A3" /> <size id="17" name="A4" pvsid="13" width="210" height="297" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A4" /> <size id="18" name="A5" pvsid="14" width="148.5" height="210" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A5" /> <size id="19" name="A6" pvsid="15" width="105" height="148.5" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A6" /> <size id="20" name="A7" pvsid="16" width="74" height="105" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A7" /> <size id="21" name="A8" pvsid="17" width="52" height="74" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A8" /> <size id="22" name="A9" pvsid="18" width="37" height="52" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A9" /> <size id="23" name="A10" pvsid="19" width="26" height="37" units="mm" /> resourcekey="PRINT_CONFIG_PAPERSIZE_A10" /></papersizes>
<paperorientation> <orientation id="0" pvsid="0" name="Unknown" /> <orientation id="1" pvsid="1" name="Landscape" resourcekey="PRINT_CONFIG_PAPERORIENTATION_LANDSCAPE" /> <orientation id="2" pvsid="2" name="Portrait" resourcekey="PRINT_CONFIG_PAPERORIENTATION_PORTRAIT" /> </paperorientation>
<printscales> <scale id="0" pvsid="0" name="Unknown" /> <scale id="1" pvsid="1" name="Fit to Page" resourcekey="PRINT_CONFIG_PRINTSCALES_FITTOPAGE" /> <scale id="2" pvsid="2" name="1.00" <scale id="3" pvsid="3" name="0.75" <scale id="4" pvsid="4" name="0.50" <scale id="5" pvsid="5" name="0.25" </printscales>
<units> <unit id="0" pvsid="0" name="Unknown" /> <unit id="1" pvsid="1" name="Custom Metric" /> <unit id="2" pvsid="2" name="Custom Imperial" /> <unit id="3" pvsid="3" name="km" /> <unit id="4" pvsid="4" name="m" /> <unit id="5" pvsid="5" name="cm" /> <unit id="6" pvsid="6" name="mm" /> <unit id="7" pvsid="7" name="micron" /> <unit id="8" pvsid="8" name="nanometer" /> <unit id="9" pvsid="9" name="mile" /> <unit id="10" pvsid="10" name="yd" /> <unit id="11" pvsid="11" name="ft" /> <unit id="12" pvsid="12" name="in" /> <unit id="13" pvsid="13" name="mil" /> <unit id="14" pvsid="14" name="point" /> </units>
</printers>
War dies hilfreich?