Windows printing automation

How to Print Files Using the ViewCompanion Command Line

Print PDF, DWG, DWF, DXF, PLT, HPGL/2, CGM, TIFF and other supported technical files from scripts and automated Windows workflows. Start with a simple print command, select a particular printer, or use a reusable printer configuration file for consistent output.

Why use command-line printing?

ViewCompanion can open and print supported technical documents from a command, batch file, another application or Windows Task Scheduler. This makes repetitive printing easier to standardize while keeping document processing on your own Windows computer or network.

Repeatable output

Reuse the same paper, scale, orientation, color and printer settings for every job.

Automated workflows

Start printing from batch files, scheduled tasks or an existing document-management process.

Technical formats

Print PDF, CAD drawings, plot files, raster documents and other supported formats through one application.

Print a file without a configuration file

For straightforward printing, use the /p parameter followed by the document filename. ViewCompanion opens the file and prints it using the applicable printer and print settings.

  1. Locate ViewCompanion.exeUse the full executable path if ViewCompanion is not available through the Windows path.
  2. Select the documentSupply the complete path to the PDF, drawing, plot file or image you want to print.
  3. Add the /p commandPlace /p before the document filename.
  4. Run and verifyTest the command with a representative file before placing it in an unattended workflow.
General command pattern"C:\Program Files\Software Companions\ViewCompanion Premium\ViewCompanion.exe" /p "inputfile"
"C:\Program Files\Software Companions\ViewCompanion Pro\ViewCompanion.exe" /p "inputfile"
"C:\Program Files\Software Companions\ViewCompanion Standard\ViewCompanion.exe" /p "inputfile"
Print a PDF fileviewcompanion.exe /p "C:\Drawings\floor-plan.pdf"
Print a DWG drawingviewcompanion.exe /p "C:\Drawings\mechanical-layout.dwg"
Paths containing spaces: Put quotation marks around the executable path, document filename and configuration filename. Full paths are especially important when a command is started by Windows Task Scheduler or another application.

Print to a specific printer

Use /pt when the command itself should identify the printer, driver and port. This is useful when the same computer has several printers or plotters installed.

General /pt command patternviewcompanion.exe /pt "inputfile" "printer" "driver" "port"
Example using a named printerviewcompanion.exe /pt "C:\Drawings\sheet-a1.pdf" "Engineering Plotter" "Printer Driver Name" "PORTPROMPT:"

Use the installed Windows names

The printer, driver and port parameters must match the names configured in Windows. Verify them on the computer that will run the command. If you also need paper size, scaling, orientation or other repeatable settings, use a printer configuration file with /pi.

Print with a printer configuration file

A printer configuration file stores the settings that should be applied to a print job. Use the /pi command followed by the configuration filename and document filename.

General /pi command patternviewcompanion.exe /pi "printer-config.ini" "inputfile"
Print an A3 drawing using saved settingsviewcompanion.exe /pi "C:\VCConfig\a3-landscape.ini" "C:\Drawings\assembly.dwg"

Separate the job from its settings

The command selects the document. The configuration file defines how and where it should be printed. You can update a shared configuration without rewriting every batch file that uses it.

Useful configuration profiles

  • a3-landscape.iniA3 paper, landscape orientation, centered and fitted to the page.
  • a1-plotter.iniA named engineering plotter with A1 paper and a selected paper source.
  • monochrome-review.iniBlack-and-white output with a review header and page-number footer.
  • two-copy-issue.iniTwo copies with controlled scale and orientation.
  • confidential-watermark.iniA repeated print profile with a visible document watermark.

Example printer configuration file

Every printer configuration file must start with the [ViewCompanion Plot Configuration] header. This example fits and centers a drawing on A3 paper in landscape orientation and adds useful document information.

a3-landscape.ini[ViewCompanion Plot Configuration]
SCALE=FIT
CENTER=ON
PAPERSIZE=A3
ORIENTATION=2
COPIES=1
MONOCHROME=OFF
HEADER=Printed by &u on &d
HEADERPOS=UR
FOOTER=&f - Page &p of &P
FOOTERPOS=LM
FONT=ARIAL,12,BOLD

Lines beginning with ; or # are treated as comments. See the printer configuration file reference for all supported keywords, paper sizes, header and footer macros, and watermark options.

SettingPurposeExample
SCALE and CENTERControl drawing scale and placement on the sheet.SCALE=FIT
CENTER=ON
PAPERSIZE and ORIENTATIONSelect the paper size and portrait or landscape output.PAPERSIZE=A3
ORIENTATION=2
PRINTERNAME, DRIVERNAME, PORTNAMEDirect the job to a particular installed Windows printer.PRINTERNAME=Engineering Plotter
MONOCHROME and PENTABLEControl black-and-white output or apply a ViewCompanion pen table.MONOCHROME=ON
HEADER, FOOTER, FONTAdd filenames, dates, users, page numbers and other job information.FOOTER=Page &p of &P
WATERMARKTEXT and related optionsAdd and position watermark text on printed pages.WATERMARKTEXT=CONFIDENTIAL

Practical printer configuration examples

FIT TO PAGE

A4 portrait output

Fit and center a document on A4 paper.

[ViewCompanion Plot Configuration]
SCALE=FIT
CENTER=ON
PAPERSIZE=A4
ORIENTATION=1


MONOCHROME

Black-and-white printing

Print two monochrome copies in landscape orientation.

[ViewCompanion Plot Configuration]
MONOCHROME=ON
COPIES=2
ORIENTATION=2



WATERMARK

Confidential print profile

Add a gray diagonal watermark above the drawing.

[ViewCompanion Plot Configuration]
WATERMARKTEXT=CONFIDENTIAL
WATERMARKCOLOR=#808080
WATERMARKFONT=ARIAL,26,BOLD
WATERMARKROTATION=45
WATERMARKVPOS=1
WATERMARKORDER=1

Use command-line printing in a batch file

Place tested print commands in a Windows batch file when several known documents should be printed as one repeatable job. Each command can use the same configuration or a different profile.

print-drawing-set.bat@echo off
set "VC=C:\Program Files\Software Companions\ViewCompanion Premium\ViewCompanion.exe"
set "CFG=C:\VCConfig\a3-landscape.ini"

"%VC%" /pi "%CFG%" "C:\Drawing Set\sheet-01.pdf"
"%VC%" /pi "%CFG%" "C:\Drawing Set\sheet-02.dwg"
"%VC%" /pi "%CFG%" "C:\Drawing Set\sheet-03.plt"

If the print workflow will run unattended, test printer availability, permissions and paper handling while signed in as the same Windows account that will run the automated task.

Tips for reliable automated printing

  • Use complete paths and put quotation marks around paths or names that contain spaces.
  • Install the required printer and driver for the Windows account or computer running the command.
  • Confirm that printer, driver, port, paper size and paper-bin names match the Windows installation.
  • Use SCALE=FIT and CENTER=ON when mixed drawing sizes should fit the selected paper.
  • Create separate configuration files for different plotters, paper sizes and output policies.
  • Check multipage documents, DWG layouts, orientation and rotation with representative files.
  • Keep configuration files in a stable folder and restrict changes if they are shared by production jobs.
  • Test the complete batch manually before scheduling it or calling it from another application.

Frequently asked questions

Can I print without a printer configuration file?

Yes. Use /p followed by the document filename for straightforward command-line printing.

Can command-line printing use a specific printer?

Yes. Use /pt with the printer, driver and port, or define PRINTERNAME, DRIVERNAME and PORTNAME in a printer configuration file used with /pi.

Can I control paper size, orientation and scaling?

Yes. A printer configuration file can define PAPERSIZE, ORIENTATION, SCALE, CENTER and other print settings.

Can printing add headers, footers or watermarks?

Yes. The configuration format supports header, footer and watermark text, together with placement and formatting options. Header and footer macros can insert the filename, path, date, time, user, page number, total pages and print scale.

Can I use the same settings for Folder Monitor printing?

Yes. Printer configuration files can also be used with the hot-folder printing feature in ViewCompanion Premium.

Related information

Automate technical document printing with ViewCompanion

ViewCompanion combines desktop viewing, printing and conversion with command-line and batch-processing tools for Windows workflows.

Explore ViewCompanion Premium Explore ViewCompanion Pro Explore ViewCompanion Standard