PrintUserParams Class Documentation
classPrintUserParams : SystemIDisposableNamespace:Datalogics::PDFL
- Inherits from:
SystemIDisposable
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
Constructor & Destructor Documentation
PrintUserParams
PrintUserParams(PrintUserParamsrhs, InternalConstructsignifier)Parameters
rhs: PrintUserParamssignifier: InternalConstruct
PrintUserParams
PrintUserParams()~PrintUserParams
~PrintUserParams()Property Documentation
BinaryOK
intBinaryOK[get, set]Collate
boolCollate[get, set]Command
stringCommand[get, set]DeviceName
stringDeviceName[get, set]DoOPP
intDoOPP[get, set]DriverName
stringDriverName[get, set]EmitHalftones
intEmitHalftones[get, set]EmitToFile
boolEmitToFile[get, set]EmitToPrinter
boolEmitToPrinter[get, set]EndPage
intEndPage[get, set]FarEastFontOpt
FarEastFontFarEastFontOpt[get, set]InFileName
stringInFileName[get, set]NCopies
intNCopies[get, set]OutFileName
stringOutFileName[get, set]PaperHeight
ushortPaperHeight[get, set]PaperSource
intPaperSource[get, set]PaperWidth
ushortPaperWidth[get, set]PortName
stringPortName[get, set]PrintAnnots
intPrintAnnots[get, set]PrintParams
PrintParamsPrintParams[get]PsLevel
intPsLevel[get, set]Reverse
intReverse[get, set]ShrinkToFit
boolShrinkToFit[get, set]StartPage
intStartPage[get, set]StartResult
intStartResult[get, set]TransQuality
intTransQuality[get, set]UseCustomPaperSize
boolUseCustomPaperSize[get, set]Member Function Documentation
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.
ConstructorRetrieve
static PrintUserParamsConstructorRetrieve(System.IntPtrignored)Parameters
ignored: System.IntPtr
Returns:
PrintUserParamsDispose
voidDispose()Returns:
voidDisposeChildren
voidDisposeChildren()Returns:
voidEnumeratePaperSources
System.Collections.Generic.IList< System.String >EnumeratePaperSources()Returns:
Set of the tray/bin names.Enumerates available tray/bin names for the specified printer.
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
boolPosePrintDialog(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().
UpdateDevModeAndNamesFromPrintDlgInternal
voidUpdateDevModeAndNamesFromPrintDlgInternal(IntPtrhDevMode, IntPtrhDevNames)Parameters
hDevMode: IntPtrhDevNames: IntPtr
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
UpdateDevModeFromPrintUserParamsInternal
voidUpdateDevModeFromPrintUserParamsInternal()Returns:
voidUpdateFromPrinterSettings
voidUpdateFromPrinterSettings(System.Drawing.Printing.PrinterSettingssettings)Parameters
settings: System.Drawing.Printing.PrinterSettingsPrinter settings
Returns:
voidUpdate the PrintUserParams from System.Drawing.Printing.PrinterSettings.
The following items are updated:
startPage
endPage
driverName
deviceName
portName
nCopies
paperWidth
paperHeight
DEVMODE
Use this if you pose the print settings dialog box in your own code.
UpdatePrintUserParamsFromDevModeInternal
voidUpdatePrintUserParamsFromDevModeInternal()Returns:
voidUseDefaultPrinter
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().