public class

ConvertPrinter

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.ConvertPrinter

Class Overview

The ConvertPrinter class contains static member functions for installing and uninstalling a Windows OS printer for conversion of document formats by the Convert class.

Summary

Constants
int e_convert_printer_auto By default PDFNet will pick the best means of converting the target document.
int e_convert_printer_interop_only For Office file conversions, force COM Interop to be used, regardless if this virtual printer is installed or not.
int e_convert_printer_prefer_builtin_converter For Office file conversions, use the built in converter if it is available for the converted file type.
int e_convert_printer_printer_only For Office file conversions, do not check for Office COM Interop availability, and use the printer path instead.
Public Constructors
ConvertPrinter()
Public Methods
static int getMode()
Get the current mode for print jobs.
static String getPrinterName()
Get the name of the PDFNet printer installed in this process session.
static void install()
Install the PDFNet printer with the default name.
static void install(String in_printerName)
Install the PDFNet printer.
static boolean isInstalled(String in_printerName)
Determine if the specified printer is installed.
static boolean isInstalled()
Determine if the PDFNet printer is installed with the default name.
static void setMode(int mode)
Configure how PDFNet prints documents.
static void setPrinterName(String in_printerName)
Set the name of the PDFNet printer to be used.
static void setPrinterName()
Set the name of the PDFNet printer to be used to the default printer name "PDFTron PDFNet".
static void uninstall()
Uninstall all printers using the PDFNet printer driver.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int e_convert_printer_auto

By default PDFNet will pick the best means of converting the target document.

Constant Value: 0 (0x00000000)

public static final int e_convert_printer_interop_only

For Office file conversions, force COM Interop to be used, regardless if this virtual printer is installed or not.

Constant Value: 1 (0x00000001)

public static final int e_convert_printer_prefer_builtin_converter

For Office file conversions, use the built in converter if it is available for the converted file type.

Constant Value: 3 (0x00000003)

public static final int e_convert_printer_printer_only

For Office file conversions, do not check for Office COM Interop availability, and use the printer path instead.

Constant Value: 2 (0x00000002)

Public Constructors

public ConvertPrinter ()

Public Methods

public static int getMode ()

Get the current mode for print jobs.

Returns
  • the current print mode

public static String getPrinterName ()

Get the name of the PDFNet printer installed in this process session.

Note: if no printer was installed in this process then the predefined string "PDFTron PDFNet" will be returned.

Returns
  • the Unicode name of the PDFNet printer

public static void install ()

Install the PDFNet printer with the default name. See previous function for more details.

public static void install (String in_printerName)

Install the PDFNet printer. Installation can take a few seconds, so it is recommended that you install the printer once as part of your deployment process. Duplicated installations will be quick since the presence of the printer is checked before installation is attempted. There is no need to uninstall the printer after conversions, it can be left installed for later access.

Note: Installing and uninstalling printer drivers requires the process to be running as administrator.

Parameters
in_printerName the name of the printer to install and use for conversions. If in_printerName is not provided then the name "PDFTron PDFNet" is used.

public static boolean isInstalled (String in_printerName)

Determine if the specified printer is installed.

Note: may or may not check if the printer with the given name is actually a PDFNet printer.

Parameters
in_printerName the name of the printer to install and use for conversions. If in_printerName is not provided then the name "PDFTron PDFNet" is used.
Returns
  • true if the named printer is installed, false otherwise

public static boolean isInstalled ()

Determine if the PDFNet printer is installed with the default name. See previous function for more details.

Returns
  • true, if ConvertPrinter is installed

public static void setMode (int mode)

Configure how PDFNet prints documents.

Parameters
mode set the print mode. Default is e_convert_printer_auto.

public static void setPrinterName (String in_printerName)

Set the name of the PDFNet printer to be used.

Parameters
in_printerName the new printer name

public static void setPrinterName ()

Set the name of the PDFNet printer to be used to the default printer name "PDFTron PDFNet".

public static void uninstall ()

Uninstall all printers using the PDFNet printer driver.

Note: Installing and uninstalling printer drivers requires the process to be running as administrator. Only the "PDFTron PDFNet" printer can be uninstalled with this function.