PrintUserParams Class Documentation
classPrintUserParamsNamespace:datalogics_interface
Detailed Description
Two structures provide settings for setting parameters for print jobs, PrintUserParams and PrintParams. PrintUserParams was created first, and then PrintParams was created as an extension of PrintUserParams, to provide more settings to account for changing technology.
When the system seeks to print a document it will pass the content and the print parameters, such as the page size, paper tray, and landscape v. portrait, to the print API in APDFL. If the setting is in PrintParams it will pass the document and parameters to PrintParams and then to PrintUserParams and from there to the print API to complete the printing process.
The print logic may take different code paths depending on whether or not the print content is being sent to a printer or to a file, or if the printing uses PostScript or not. When you see a print setting that appears in both PrintUserParams and PrintParams, such as "ShrinktoFit," set the appropriate value in both of these classes. Also, PrintParams offers a variety of settings related to PostScript, but the use of PrintParams is not limited to PostScript.
Constructor & Destructor Documentation
PrintUserParams
PrintUserParams()Initializes the print parameters to default values: paper size set to use the media box, emit to printer enabled, emit to file disabled, and zero copies. On macOS, also initializes the system print session, print settings, and page format.
PrintUserParams
PrintUserParams(PrintUserParams &&)Parameters
~PrintUserParams
~PrintUserParams()Member Function Documentation
get_binary_ok
intget_binary_ok()Returns:
Binary ok setting.Gets whether to enable Binary data, 1 turns it on and 0 turns it off. It applies to a Postscript printer. This API is available on Windows and macOS only.
get_collate
boolget_collate()Returns:
True if copies should be collated.Collate property.
get_device_name
std::stringget_device_name()Returns:
std::stringThe unicode name of the device to print to (for example, "Distiller
Assistant v3.01"). Available devices can be found in the Windows Registry at HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices. It applies to a printer.
get_driver_name
std::stringget_driver_name()Returns:
std::stringThe unicode name of the driver (for example, "winspool"). See the registry key for deviceName. It applies to the printer.
get_emit_to_file
boolget_emit_to_file()Returns:
true if a PostScript file is created.Gets whether a Postscript file is created.
get_emit_to_printer
boolget_emit_to_printer()Returns:
true if output to a printer.Gets whether to Output the PDF document to a Postscript Printer.
get_end_page
intget_end_page()Returns:
the page to end uponGets the page on which to finish printing, using zero-based nubmering. It applies to a printer. This API is only available on Windows and macOS only.
get_in_file_name
std::stringget_in_file_name()Returns:
std::stringUnicode name used for the Windows DOCINFO structure (lpszDocName) that points to a NULL-terminated string that specifying the name of the document. In case of printing/exporting to Postscript, this field sets the Title DSC comment in the generated Postscript file. If inFileName was not provided, the Title DSC comment is filled with the name of pdf document.
get_n_copies
intget_n_copies()Returns:
the number of copies that will be printedGets the number of copies to print. It applies to a Postscript file.
get_out_file_name
std::stringget_out_file_name()Returns:
std::stringUnicode name used for the Windows DOCINFO structure (lpszOutput). It points to a NULL-terminated string that specifies the name of an output file. If this pointer is NULL, the output will be sent to the device identified by deviceName, driverName, and portName. It applies to a printer.
get_paper_height
unsigned shortget_paper_height()Returns:
the height of the paper in pointsGets the Height of paper in points. The default value is 792. It applies to a Postscript printer.
get_paper_width
unsigned shortget_paper_width()Returns:
the width of the paper in pointsGets the Width of paper in points. The default value is 612. It applies to a Postscript printer.
get_port_name
std::stringget_port_name()Returns:
std::stringThe unicode name of the port (for example, "Ne00"). See the registry key for deviceName. It applies to the printer.
get_print_annots
intget_print_annots()Returns:
1 if annotations will be printed, 0 if notGets the printing annotations setting, 1 turns it on, 0 turns it off. It applies to a printer. This API is available on Windows and macOS only.
get_ps_level
intget_ps_level()Returns:
Postscript level settingGets the Postscript level. It applies to a Postscript printer. This API is available on Windows and macOS only.
get_reverse
intget_reverse()Returns:
1 to reverse page order or 0 for regular orderGets whether to reverses print order, 1 reverses it and 0 does regular order. It applies to a printer. This API is available on Windows and macOS only.
get_shrink_to_fit
boolget_shrink_to_fit()Returns:
true if the page will be shrunk to fitGets the Shrink to fit setting, true turns it on, false turns it off. It applies to a Postscript printer. This API is available on Windows and macOS only.
get_start_page
intget_start_page()Returns:
the start pageGets the page to start printing with, using zero-based numbering. It applies to a printer. This API is only available on Windows and macOS only.
get_trans_quality
intget_trans_quality()Returns:
the transparency flatting quality, 1 is fastest; 5 is bestGets the Transparency flattening quality control. 1 is fastest; 5 is best. The default is 3. It applies to a printer. This API is available on Windows only.
operator=
PrintUserParams &operator=(PrintUserParams &&)Parameters
Returns:
PrintUserParams &set_binary_ok
voidset_binary_ok(intvalue)Parameters
value: intBinary Ok setting.
Returns:
voidSets whether to enable Binary datam, 1 turns it on and 0 turns it off. It applies to a Postscript printer. This API is available on Windows and macOS only.
set_collate
voidset_collate(boolvalue)Parameters
value: boolTrue if need to collate copies.
Returns:
voidThese private functions are used to keep the DevMode (or Mac PMSession/Settings/Etc) in 'sync': all relevant fields in both structures should agree on common settings at the moment PDFLPrintDoc() (in CDocument) is called. This synchronization is necessary because DevMode settings can change outside of DLE's direct control (e.g. print dialog box).
UpdateDevModeAndNamesFromPrintDlgInternal(): Updates the DevMode and DevNames with handles pulled from a PRINTDLG UpdateDevModeFromPrintUserParamsInternal(): Updates the DevMode with values from the current PrintUserParams UpdatePrintUserParamsFromDevModeInternal(): Updates the PrintUserParams with values from the current DevMode
set_device_name
voidset_device_name(const std::string &name)Parameters
name: const std::string &the device name
Returns:
voidset_driver_name
voidset_driver_name(const std::string &name)Parameters
name: const std::string &the driver name
Returns:
voidset_emit_to_file
voidset_emit_to_file(boolvalue)Parameters
value: boolpass true to emit output to a PostScript file
Returns:
voidSets whether a Postscript file is created. You set either this parameter or emitToPrinter, but not both.
set_emit_to_printer
voidset_emit_to_printer(boolvalue)Parameters
value: boolpass true to emit to the printer
Returns:
voidSets whether to Output the PDF document to a Postscript Printer. Set either this parameter or emitToFile, but not both.
set_end_page
voidset_end_page(intpage)Parameters
page: intthe page to end upon
Returns:
voidSets the page on which to finish printing, using zero-based nubmering. It applies to a printer. This API is only available on Windows and macOS only.
set_in_file_name
voidset_in_file_name(const std::string &name)Parameters
name: const std::string &the input file name used as the Title DSC comment in the generated Postscript file.
Returns:
voidset_n_copies
voidset_n_copies(intcopies)Parameters
copies: intthe number of copies to print.
Returns:
voidSets the number of copies to print. It applies to a Postscript file.
set_out_file_name
voidset_out_file_name(const std::string &name)Parameters
name: const std::string &the out file name
Returns:
voidset_paper_height
voidset_paper_height(unsigned shortheight)Parameters
height: unsigned shortthe height of the paper in points
Returns:
voidSets the Height of paper in points. The default value is 792. It applies to a Postscript printer.
set_paper_width
voidset_paper_width(unsigned shortwidth)Parameters
width: unsigned shortthe width of the paper in points
Returns:
voidSets the Width of paper in points. The default value is 612. It applies to a Postscript printer.
set_port_name
voidset_port_name(const std::string &name)Parameters
name: const std::string &the port name
Returns:
voidset_print_annots
voidset_print_annots(intvalue)Parameters
value: int1 to print annotations, 0 to not print them.
Returns:
voidSets the printing annotations setting, 1 turns it on, 0 turns it off. It applies to a printer. This API is available on Windows and macOS only.
set_ps_level
voidset_ps_level(intlevel)Parameters
level: intPostscript Level setting.
Returns:
voidSets the Postscript level. It applies to a Postscript printer. This API is available on Windows and macOS only.
set_reverse
voidset_reverse(intvalue)Parameters
value: int1 to reverse page order or 0 for regular order
Returns:
voidSets whether to reverses print order, 1 reverses it and 0 does regular order. It applies to a printer. This API is available on Windows and macOS only.
set_shrink_to_fit
voidset_shrink_to_fit(boolvalue)Parameters
value: boolpass true to shrink the page to fit
Returns:
voidSets the Shrink to fit setting, true turns it on, false turns it off. It applies to a PostScript printer. This API is available on Windows and macOS only.
set_start_page
voidset_start_page(intpage)Parameters
page: intthe page to start on
Returns:
voidSets the page to start printing with, using zero-based numbering. It applies to a printer. This API is only available on Windows and macOS only.
set_trans_quality
voidset_trans_quality(intquality)Parameters
quality: intthe transparency flatting quality, 1 is fastest; 5 is best
Returns:
voidSets the Transparency flattening quality control. 1 is fastest; 5 is best. The default is 3. It applies to a printer. This API is available on Windows only.