Limited time promo

AddNovaPrinterExt2

English

This help topic applies only to novaPDF. If you don't have it yet, you must download it first.

Download now Buy licenses
Mar 29, 2022
novaPDF 11.x
We strive to keep our help as accurate as possible. If you notice any inconsistencies or outdated info please let us know.
The AddNovaPrinterExt2 method adds a temporary novaPDF printer in the system
HRESULT AddNovaPrinterExt2(
	[ in, string ] BSTR p_wsPrinterName,
	[ in, string ] BSTR p_wsPortName,
	[ in, string ] BSTR p_wsOEMID,
	[ in, string ] BSTR p_wsServicePort,
	[ in, string ] BSTR p_wsLicensekey,
	[ in ] SHORT p_nDefaultPaperSize,
	[ in, string ] BSTR p_wsDefaultPaperName,
	[ in ] SHORT p_nDefaultPaperLength,
	[ in ] SHORT p_nDefaultPaperWidth,
	[ in ] SHORT p_nDefaultResolution,
	[ in ] SHORT p_nMaxCopies,
	[ in ] SHORT p_nDefaultCopies,
	[ in ] SHORT p_nDefaultCollate,
	[ in ] SHORT p_nDefaultOrientation,
	[ in ] SHORT p_nDefaultScale,
	[ in ] BOOL p_bAllowChangePaper,
	[ in ] BOOL p_bAllowChangeResolution,
	[ in ] BOOL p_bAllowChangeCopies,
	[ in ] BOOL p_bAllowChangeCollate,
	[ in ] BOOL p_bAllowChangeOrientation,
	[ in ] BOOL p_bAllowChangeScale,
	[ in ] BOOL p_bSharedPrinter,
	[ in, string ] BSTR p_wsSharedName
);

Parameters:

p_wsPrinterName
	[in] printer name
p_wsPortName
	[in] printer port
p_wsOEMID
	[in] custom OEMID; for trial is "nPdfSdk10_Softland"
p_wsServicePort
	[in] novaPDF Server service port number, by default 8501
p_wsLicenseKey
	[in] license key
p_nDefaultPaperSize
	[in] default paper size (for instance 1 for Letter, 9 for A4,.,..)
p_wsDefaultPaperName
	[in] pointer to a null terminated Unicode string containing paper name (like Letter, A4,...)
p_nDefaultPaperLength
	[in] default paper length expressed in tenths of millimeters (for A4, 2970)
p_nDefaultPaperWidth
	[in] default paper width expressed in tenths of millimeters (for A4, 2100)
p_nDefaultResolution
	[in] default resolution (300, 600,...)
p_nMaxCopies
	[in] maximum number of copies allowed (999)
p_nDefaultCopies
	[in] default number of copies (1)
p_nDefaultCollate
	[in] default collate (1 or 0)
p_nDefaultOrientation
	[in] default orientation (1 - portrait, 2 - landscape)
p_nDefaultScale
	[in] default scale (100)
p_bAllowChangePaper
	[in] bool, allow user to change paper size
p_bAllowChangeResolution
	[in] bool, allow user to change resolution
p_bAllowChangeCopies
	[in] bool, allow user to change copies
p_bAllowChangeCollate
	[in] bool, allow user to change collate
p_bAllowChangeOrientation
	[in] bool, allow user to change orientation
p_bAllowChangeScale
	[in] bool, allow user to change scale
p_bSharedPrinter
	[in] share the printer when added
p_wsSharedName
	[in] shared printer name

Return values:

S_OK on success or COM error code
NV_NOT_A_NOVAPDF_PRINTER - invalid OEMID
NV_INVALID_LICENSE - invalid license
NV_INVALID_PRINTER_NAME - a printer with the specified name or options cannot be added

Remarks:

This method must be called before printing documents. It will add a printer in the system with the specified name and options. This printer will be available until DeleteNovaPrinter2 is called with the same printer name. Use this method if you wish to work with temporary printers and you wish to configure special printer defaults.