Creo View MCAD Adapters Guide > Appendices > PVIEW_BATCH Command Line Syntax
PVIEW_BATCH Command Line Syntax
The pview_batch command can be used to print Creo View supported data such as viewables, annotation sets, view states with different printing settings from command line. Command line printing using pview_batch requires the PV_BATCH_PRINT license feature.
PVIEW_BATCH is also used by the following "Client Worker" based adapters:
Creo View Adapters Batch Print Engine
Creo View Adapters Interference Engine (See Using pview_batch).
Prerequisites
To export to image using pview_batch there are no prerequisites.
A command line batch print license must be set up before performing a command line batch print. Perform one of the following steps to receive the license:
Add one of the following System Environmental Variables:
PTC_D_LICENSE_FILE=<port number>@<license server>
LM_LICENSE_FILE=<port number>@<license server>
Execute the related command to set them in the startup environment:
PTC_D_LICENSE_FILE=<port number>@<license server>
LM_LICENSE_FILE=<port number>@<license server>
* 
A license server set through the command line works only for the same command line session.
Supported Input File Formats
Type
File Extension
3D
.ol
.pvs
.ed
.pvz
.edz
2D
.dwg
.dwf
.dxf
.cgm
.hpgl
.plt
Image
.bmp
.gif
.jpg
.jpeg
.tif
.tiff
.c4
.cg4
.gp4
.g4c
Illustration
.iso
Launching pview_batch
To launch the pview_batch script, using Windows Explorer, browse to the <installation_directory>\bin directory. Double-click pview_batch.exe.
pview_batch [options] [input file] [output file]
A command line print job has the following stages:
1. Open a command prompt and navigate to the directory containing the file that you want to print.
2. To print a list of files, type all of the names, separated by spaces on the command line. For example, pview_batch <filename 1 filename 2..>.
* 
You can use wildcards (asterisks *).
To use the zoom_all option for printing a view, you must have a view state or an annotation set applied.
3. Press ENTER. The command is run.
PVIEW_BATCH Command Options for Creo View Adapters Batch Printing
When printing by means of pview_batch.exe, use -p. If not, the data is exported to image with options passed in the command line. For example, to print data using the default printer:
pview_batch.exe -p <data path>
Option
Description
printer_name
Prints the data to a printer other than default printer.
pview_batch.exe –p –printer_name=<printer_path> <data path>
For example,
pview_batch.exe –p –printer_name=”\\server1\1f-Canon-ps” Z:\pvdata\saw\saw.pvs
* 
Specify printer path if network printer is used for printing.
file_name
Prints the input data set.
pview_batch.exe -p -file_name= <data path>
For example,
pview_batch.exe -p –filename=Z:\pvdata\saw\saw.pvs
annotation_set
Prints a particular annotation set.
pview_batch.exe -p -annotation_set=<annotation set name> <data path>
For example,
pview_batch.exe -p -annotation_set=saw-annZ:\pvdata\saw\saw.pvs
zoom_all
Prints the input data set with zoom all option. Value can be TRUE or FALSE (default).
pview_batch.exe -p -zoom_all=<TRUE|FALSE> <data path>
For example,
pview_batch.exe -p -zoom_all=TRUE z:\pvdata\brass_screw.hpgl
or
pview_batch.exe -p -zoom_all=FALSE z:\pvdata\brass_screw.hpgl
background
To print specific background color passed in the command line. Value can be either Color Name or RGB value of color.
Valid color names:
Red
Green
Blue
White
Black
RGB values range from 0 to 255, for example 0, 0, 0 for Black.
pview_batch.exe -p -background=<Color Name|RGB value> <data path>
For example,
pview_batch.exe -p -background =black z:\pvdata\brass_screw.hpgl
or
pview_batch.exe -p -background =0,0,0 z:\pvdata\brass_screw.hpgl
print_scale
Prints the data set with specific scale in percentage. default value is 100%.
pview_batch.exe -p -print_scale=<percentage scale> <data path>
For example,
pview_batch.exe -p -print_scale=50 z:\pvdata\brass_screw.hpgl
paper_size
Prints data set in a particular paper size. If not specified, default paper size is used.
pview_batch.exe -p -paper_size=<Paper Size> <data path>
For example,
pview_batch.exe -p -paper_size=a4 z:\pvdata\brass_screw.hpgl
Some of the supported paper sizes are listed here:
letter
lettersmall
a3
a4
a4small
10x14
11x17
paper_width
paper_length
Specifies the length and width in mm of paper being used for batch printing.
pview_batch.exe -p -paper_width=<Width in mm>
-paper_length=<Length in mm> <data path>
For example, to print the data set in A4
pview_batch.exe -p -paper_width=210
-paper_length=297 z:\pvdata\brass_screw.hpgl
Some of the supported paper lengths and width are listed here (in mm):
Paper Size
Width
Length
A5
148
210
A4
210
297
A3
297
420
A3+
329
483
A2
420
594
A1
594
841
A0
841
1189
paper_orientation
Set data in specified paper orientation. The value can be Portrait or Landscape.
pview_batch.exe -p -paper_orientation=<Portrait|Landscape> <data path>
For example,
pview_batch.exe -p - paper_orientation =portrait z:\pvdata\brass_screw.hpgl
or
pview_batch.exe -p - paper_orientation =landscape z:\pvdata\brass_screw.hpgl
view_state
Enter view state to command line to print the view states of the data set.
pview_batch.exe -p -view_state =<view state name> <data path>
For example,
pview_batch.exe -p -view_state =MBD1_SITE_MAP Z:\pvdata\bracket_02-x3_prt.pvs
viewable
Enter viewable name with the file extension to command line to print the particular viewable of the data set.
pview_batch.exe -p -viewable =< Viewable name along with the extension> <data path>
For example,
pview_batch.exe -p -viewable =Saw_motor.gif Z:\pvdata\saw\demo-saw.pvz
orientation
Prints 3D models in the particular view of the data set.
pview_batch.exe -p -orientation =<orientation name> <data path>
For example,
pview_batch.exe -p –orientation=iso1 Z:\pvdata\saw\demo-saw.pvz
Orientation values can be one of the following:
iso1
iso2
front
back
top
bottom
left
right
pages
Sets the sequence of printing of 2D pages.
A number of examples follow.
To print 3rd page of drawing:
Printing Type: Individual Page
Option: -pages=<page number>
pview_batch.exe -p –pages=3 z:\pvdata\brass_screw.hpgl
To print 1st, 3rd, and 5th pages of drawing:
Printing Type: Multiple Pages
Option: -pages=n1,n3,n5
pview_batch.exe -p –pages =1,3,5 z:\pvdata\brass_screw.hpgl
To print the sheet range 2 to 4:
Printing Type: Sheet Range
Option: -pages=n1...nx
pview_batch.exe -p –pages =2..4 z:\pvdata\brass_screw.hpgl
To print 1st and 3rd to 5th pages:
Printing Type: Individual Pages
Option: -pages=n,m,v..y
pview_batch.exe -p –pages =1,3..5 z:\pvdata\brass_screw.hpgl
To print from the 3rd page to the last page:
Printing Type:
From page
to last page
Option: -pages=x...0
pview_batch.exe -p –pages =3..0 z:\pvdata\brass_screw.hpgl
To print from the 3rd page to 1st page:
Printing Type: pages in reverse direction
Option: -pages=xx...-1
pview_batch.exe -p –pages =3..-1 z:\pvdata\brass_screw.hpgl
monochrome
Prints the data set in monochrome format. The option applies only to drawing. The value can be TRUE or FALSE (default).
pview_batch.exe -p -monochrome=<TRUE|FALSE> <Data Path>
For example:
pview_batch.exe -p -monochrome=TRUE z:\pvdata\brass_screw.hpgl
or
pview_batch.exe -p -monochrome=FALSE z:\pvdata\brass_screw.hpgl
penmap
Prints the data set with a particular pen map setting. Applicable only to pen maps which are already set through Creo View preferences.
pview_batch.exe -p -penmap=<pen map name in preferences> <Data Path>
For example:
pview_batch.exe -p - penmap=penmap z:\pvdata\brass_screw.hpgl
To set pen map preferences in Creo View, see To Configure the HPGL Pen Map in the Creo View Help.
xml
Prints the data using XML file to describe the parameters.
pview_batch.exe -p -xml=<xml path>
For example:
pview_batch.exe -p -xml=D:\temp\batch_print.xml
p_file
Prints the data using XML file to describe the parameters. With this option, there is no need to pass -p parameter in the command line. With this option selected, there is no need to pass parameter in the command line.
pview_batch.exe -p_file=<xml path>
For example:
pview_batch.exe -p_file=D:\temp\batch_print.xml
help
Prints help in the command line output.
pview_batch.exe -h
list_paper_sizes
Lists all of the available paper sizes to the command console.
pview_batch.exe -list_paper_sizes
list_paper_size_units
Lists all of the available paper size units to the command console.
pview_batch.exe -list_paper_size_units
copies
Used to print number of copies. The option is only applicable with xml.
copies=<number> is added to print number of copies of data set.
watermark
Prints the data with watermark. It can print the data with watermark which is already set in the Creo View options.
pview_batch.exe -watermark=<Watermark Name> <Data Path>
For example:
pview_batch.exe -watermark=Watermark1 z:\pvdata\brass_screw.hpgl
polyfill
port
driver_name
PVIEW_BATCH Command-line Options for Creo View Adapters Thumbnail Generation
Option
Description
-image_width=<number>
Output image width
-image_height=<number>
Output image height
-image_units=<string>
Output image unit used for -image_width and -image_height
inches
feet
mm
cm
m
-format=<fmt>
Output image format:
.bmp
.jpg
.tif
.tga
.png
-DPU=<integer>
Output image dots per unit
-PPI=<integer>
Output image pixels per inch
-pixelformat=BITONAL
If specified, generate bitonal (dithered) output
-gnomon=<true|false>
Show or hide the view gnomon
This completes the command-line syntax for Batch Printing and Thumbnail Generation using PVIEW_BATCH.