PrintUserParams Class Documentation
classPrintUserParamsNamespace:com::datalogics::PDFL
Detailed Description
A structure used to set parameters for print jobs. 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.
Referenced by
Uses types
Constructor & Destructor Documentation
PrintUserParams
PrintUserParams()Member Function Documentation
DisposeChildren
voidDisposeChildren()Returns:
void[static initializer]
static void[static initializer]()choosePaperSourceBySize
voidchoosePaperSourceBySize(doublewidth, doubleheight)Parameters
width: doublethe desired width of the output in user units
height: doublethe desired height of the output in user units
Returns:
voidChoose the best paper source for a given width and height.
Searches the printer's paper list for the smallest paper size that is greater than or equal to the given width and height, including with rotation, and sets up the job to print with that paper size.
To obtain width and height, specify the Right - Left and Top - Bottom of the MediaBox of a representative Page.
The printerName and portName must be set.
If you use this call in conjunction with PosePrintDialog, UseDefaultPrinter, or UpdateFromPrinterSettings, call this function after those functions.
Setting RotateAndCenter to True is recommended with this function.
delete
synchronized voiddelete(Booleandisposing)Parameters
disposing: Boolean
Returns:
synchronized voiddelete
synchronized voiddelete()Returns:
synchronized voidenumeratePaperSources
java.util.List< String >enumeratePaperSources()Returns:
Set of the tray/bin names.Enumerates available tray/bin names for the specified printer.
finalize
voidfinalize()Returns:
voidgetBinaryOK
intgetBinaryOK()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.
getCollate
booleangetCollate()Returns:
True if copies should be collated.Collate property.
getCommand
StringgetCommand()Returns:
command line argumentsGets the Optional command line arguments on Unix. It is used only if emitToPrinter is true. For example, "lp" or "lpr" applies to a Postscript printer. This API is available on Unix only.
getDeviceName
StringgetDeviceName()Returns:
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.
getDoOPP
intgetDoOPP()Returns:
1 if OverPrint Preview will be used, 0 if notGets the OverPrint Preview setting, 1 uses it, 0 does not. It applies to a printer. The default is 0. This API is available on Windows and macOS only.
getDriverName
StringgetDriverName()Returns:
StringThe unicode name of the driver (for example, "winspool"). See the registry key for deviceName. It applies to the printer.
getEmitHalftones
intgetEmitHalftones()Returns:
1 if halftones will be emitted, 0 if notGets the Emit half-tones setting, 1 turns it on, 0 turns it off. It applies to a Postscript printer. This API is available on Windows and macOS only.
getEmitToFile
booleangetEmitToFile()Returns:
true if a PostScript file is created.Gets whether a Postscript file is created.
getEmitToPrinter
booleangetEmitToPrinter()Returns:
true if output to a printer.Gets whether to Output the PDF document to a Postscript Printer.
getEndPage
intgetEndPage()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.
getFarEastFontOpt
FarEastFontgetFarEastFontOpt()Returns:
a PDFarEastFont value that represents the setting to be usedGets the Far East Font setting. The default value is DownloadAll. PrintAsImage will not be honored. It applies to a Postscript printer. This API is available on Windows only.
getInFileName
StringgetInFileName()Returns:
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.
getNCopies
intgetNCopies()Returns:
the number of copies that will be printedGets the number of copies to print. It applies to a Postscript file.
getOutFileName
StringgetOutFileName()Returns:
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.
getPaperHeight
intgetPaperHeight()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.
getPaperSource
intgetPaperSource()Returns:
Value in DEVMODE->dmDefaultSource if initialized or index of selected paper tray or -1 if not specified.Paper source property.
getPaperWidth
intgetPaperWidth()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.
getPortName
StringgetPortName()Returns:
StringThe unicode name of the port (for example, "Ne00"). See the registry key for deviceName. It applies to the printer.
getPrintAnnots
intgetPrintAnnots()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.
getPrintParams
PrintParamsgetPrintParams()Returns:
the print parameter settingsGets the Print Parameter settings.
getPsLevel
intgetPsLevel()Returns:
Postscript level settingGets the Postscript level. It applies to a Postscript printer. This API is available on Windows and macOS only.
getReverse
intgetReverse()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.
getShrinkToFit
booleangetShrinkToFit()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.
getStartPage
intgetStartPage()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.
getStartResult
intgetStartResult()Returns:
the Spooler IDGets the Spooler ID from StartDoc. This API is available on Windows and Unix only.
getTransQuality
intgetTransQuality()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.
getUseCustomPaperSize
booleangetUseCustomPaperSize()Returns:
true if force.Gets whether to force the use of the paper size provided in the PaperWidth and PaperHeight parameters and not search for best fit size provided by printer. SetPageSize must also be set.
paperSourceIdByName
intpaperSourceIdByName(StringtrayName)Parameters
trayName: Stringthe tray/bin's name whose number need to obtain.
Returns:
Tray/Bin number corresponding to the specified name.Obtain tray/bin number by its name.
posePrintDialog
booleanposePrintDialog(Documentdoc)Parameters
doc: Documenta Document which will be used to set the maximum page range in the dialog box.
Returns:
true if the user accepted the dialog box, false if it was cancelledSet the print parameters by posing a dialog box to the user. The parameters set include the printer, page range, paper size, number of copies, and duplexing mode.
Changes to these parameters made by the user will be copied into the corresponding PrintUserParams fields. If you want to override the user's choices, change these fields after calling PosePrintDialog().
setBinaryOK
voidsetBinaryOK(intbinaryOK)Parameters
binaryOK: 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.
setCollate
voidsetCollate(booleancollate)Parameters
collate: booleanTrue if need to collate copies.
Returns:
voidCollate property.
setCommand
voidsetCommand(Stringcommand)Parameters
command: Stringthe optional command line arguments
Returns:
voidSets the Optional command line arguments on Unix. It is used only if emitToPrinter is true. For example, "lp" or "lpr" applies to a Postscript printer. This API is available on Unix only.
setDeviceName
voidsetDeviceName(StringinStr)Parameters
inStr: String
Returns:
voidsetDoOPP
voidsetDoOPP(intdoOPP)Parameters
doOPP: int1 if OverPrint Preview will be used, 0 if not
Returns:
voidSets the OverPrint Preview setting, 1 uses it, 0 does not. The default is 0. It applies to a printer. This API is available on Windows and macOS only.
setDriverName
voidsetDriverName(StringinStr)Parameters
inStr: String
Returns:
voidsetEmitHalftones
voidsetEmitHalftones(intemitHalftones)Parameters
emitHalftones: int1 if halftones will be emitted, 0 if not
Returns:
voidSets the Emit half-tones setting, 1 turns it on, 0 turns it off. It applies to a Postscript printer. This API is available on Windows and macOS only.
setEmitToFile
voidsetEmitToFile(booleanemitToFile)Parameters
emitToFile: booleanpass 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.
setEmitToPrinter
voidsetEmitToPrinter(booleanemitToPrinter)Parameters
emitToPrinter: booleanpass 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.
setEndPage
voidsetEndPage(intendPage)Parameters
endPage: 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.
setFarEastFontOpt
voidsetFarEastFontOpt(FarEastFontfarEastFontOpt)Parameters
farEastFontOpt: FarEastFonta PDFarEastFont value that represents the setting to be used
Returns:
voidSets the Far East Font setting. The default value is DownloadAll. PrintAsImage will not be honored. It applies to a Postscript printer. This API is available on Windows only.
setInFileName
voidsetInFileName(StringinStr)Parameters
inStr: String
Returns:
voidsetNCopies
voidsetNCopies(intnCopies)Parameters
nCopies: intthe number of copies to print.
Returns:
voidSets the number of copies to print. It applies to a Postscript file.
setOutFileName
voidsetOutFileName(StringinStr)Parameters
inStr: String
Returns:
voidsetPaperHeight
voidsetPaperHeight(intpaperHeight)Parameters
paperHeight: intthe 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.
setPaperSource
voidsetPaperSource(intPaperSource)Parameters
PaperSource: int
Returns:
voidPaper source property.
setPaperWidth
voidsetPaperWidth(intpaperWidth)Parameters
paperWidth: intthe 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.
setPortName
voidsetPortName(StringinStr)Parameters
inStr: String
Returns:
voidsetPrintAnnots
voidsetPrintAnnots(intprintAnnots)Parameters
printAnnots: 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.
setPsLevel
voidsetPsLevel(intpsLevel)Parameters
psLevel: intPostscript Level setting.
Returns:
voidSets the Postscript level. It applies to a Postscript printer. This API is available on Windows and macOS only.
setReverse
voidsetReverse(intreverse)Parameters
reverse: 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.
setShrinkToFit
voidsetShrinkToFit(booleanshrinkToFit)Parameters
shrinkToFit: booleanpass 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.
setStartPage
voidsetStartPage(intstartPage)Parameters
startPage: 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.
setStartResult
voidsetStartResult(intstartResult)Parameters
startResult: intthe Spooler ID
Returns:
voidSets the Spooler ID for StartDoc. This API is available on Windows and Unix only.
setTransQuality
voidsetTransQuality(inttransQuality)Parameters
transQuality: 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.
setUseCustomPaperSize
voidsetUseCustomPaperSize(booleanuseCustomPaperSize)Parameters
useCustomPaperSize: booleanpass true to use custom size.
Returns:
voidSets whether to force the use of the paper size provided in the PaperWidth and PaperHeight parameters and not search for best fit size provided by printer. SetPageSize must also be set.
useDefaultPrinter
voiduseDefaultPrinter(Documentdoc)Parameters
doc: Documenta Document which will be used to set the maximum page range.
Returns:
voidSet the print parameters to the defaults. The parameters set include the printer, page range, paper size, number of copies, and duplexing mode.
Operating system defaults for these parameters will be copied into the corresponding PrintUserParams fields. If you want to override the system defaults, change these fields after calling UseDefaultPrinter().