Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

PDFKit.SetPrintSetting

Sets print settings for printing PDF.

Component Version macOS Windows Linux Server iOS SDK
PDFKit 4.0 ✅ Yes ❌ No ❌ No ✅ Yes, on macOS ✅ Yes
MBS( "PDFKit.SetPrintSetting"; Selector; Value )   More

Parameters

Parameter Description Example
Selector Which value to set. "FaxNumber"
Value The value for the setting. "+123456"

Result

Returns OK or error.

Description

Sets print settings for printing PDF.
See also PDFKit.Print function.
All settings are optional and if not set will use default setting.

Possible settings:
jobTitleThe title of the printing job.
faxNumberA fax number for fax printers. This text is passed through and must match the format your driver expects.
PaperNameThe name of the paper to use.
PrinterThe name of the printer to use.
FirstPageThe number of the first page to print.
LastPageThe number of the last page to print.
CopiesThe number of copies to print. Default is 1.
ReversePageOrderWhether to reverse the page order. Pass 1 to reverse or 0 to not reverse. Default is not reverse.
MustCollateWhether to collate or not. Pass 1 to collate or 0 to not collate. Default is 0.
AutoRotateWhether to automatically rotate to match the PDF page format. Default is 1 (on).
ShowsPrintPanelWhether to show the print panel. Default is 0 to not show it. Pass 1 for value to show dialog.
ShowsProgressPanelWhether to show the progress panel. Default is 0 to not show it. Pass 1 for value to show progress.
DuplexModeWhether to use duplex mode. Can be None (Print only on one side of sheet of paper), DuplexNoTumble (Print on both sides of the paper, with no tumbling), DuplexTumble (Print on both sides of the paper, tumbling on) or SimplexTumble (Print on only one side of the paper, but tumble the images while printing).
DetailedErrorReportingWhether to enable detailed error reporting. If 1, produce detailed reports when an error occurs.
PagesAcrossNumber of logical pages to be placed across a physical sheet.
PagesDownNumber of logical pages to be placed down a physical sheet.
TopMarginThe top margin. Default 0.
BottomMarginThe bottom margin. Default 0.
LeftMarginThe left margin. Default 0.
RightMarginThe right margin. Default 0.
HorizontalPaginationThe horizontal pagination. Can be auto, clip or fit. Default is fit.
VerticalPaginationThe vertical pagination. Can be auto, clip or fit. Default is fit.
scalingModeThe scaling mode to use. Default is None, but can also be DownToFit or ToFit.
TrayThe name of the paper tray. See PrintDialog.GetTray to find the name of the tray. (New in 8.0)
PaperSizeThe paper size in Width and Height in points for custom format. Takes 2 value parameters.

You can use PDFKit.SetPrintOption to set custom print options like with PrintDialog.SetOption function.

Print settings for iOS:
JobTitleThe job title. Default is the app name.
PrinterIDThe identifier for the printer to use (when using dialog).
PrinterURLThe URL to identify the printer (when not using dialog).
ShowsPrintPanelWhether to show the printer dialog. Default true.
ShowsNumberOfCopiesWhether to show number of copies option in dialog.
ShowsPaperSelectionForLoadedPapersWhether to show paper selection option in dialog.
ShowsPaperOrientationWhether to show orientation option in dialog.
OutputTypeThe output type to use: General, Photo, Grayscale or PhotoGrayscale.
DuplexModeThe duplex mode to use: None, LongEdge or ShortEdge

Examples

Set a fax number:

MBS( "PDFKit.SetPrintSetting"; "FaxNumber"; "+123456" )

Print page 2 to 10 and make 3 copies:

MBS( "PDFKit.ResetPrintSettings" )
MBS( "PDFKit.SetPrintSetting"; "FirstPage"; 2 )
MBS( "PDFKit.SetPrintSetting"; "LastPage"; 10 )
MBS( "PDFKit.SetPrintSetting"; "Copies"; 3 )
MBS( "PDFKit.Print" )

Set a duplex:

MBS( "PDFKit.SetPrintSetting"; "DuplexMode"; "DuplexNoTumble" )

Horizontal and vertical fit:

$r = MBS( "PDFKit.SetPrintSetting"; "HorizontalPagination"; "fit" )
$r = MBS( "PDFKit.SetPrintSetting"; "VerticalPagination"; "fit" )

Set paper tray:

MBS("PDFKit.SetPrintSetting"; "Tray"; "Tray-2")

Enable print dialog:

MBS( "PDFKit.SetPrintSetting"; "ShowsPrintPanel"; 1 )

Enable progress dialog:

MBS( "PDFKit.SetPrintSetting"; "ShowsProgressPanel"; 1 )

Set paper size for A4:

MBS( "PDFKit.SetPrintSetting"; "PaperSize"; 300; 400 )

Setup with various options:

# set in file PDFKit Print Documents

Set Variable [ $r ; Value: MBS( "PDFKit.ResetPrintSettings" ) ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "ShowsPrintPanel"; 0) ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "ShowsProgressPanel"; 1) ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "Copies"; 1) ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "AutoRotate"; 1) ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "scalingMode"; "ToFit") ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "PaperName"; "A5") ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "DuplexMode"; "DuplexTumble") ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "Printer"; "Laserprinter") ]

Setup some iOS options:

Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "ShowsPrintPanel"; 0 ) ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "PrinterURL"; "ipp://Laserdrucker.local.:631/ipp/print" ) ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "OutputType"; "Grayscale" ) ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "JobTitle"; "Test" ) ]
Set Variable [ $r ; Value: MBS( "PDFKit.SetPrintSetting"; "DuplexMode"; "LongEdge" ) ]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 7th April 2024


PDFKit.SetPrintOption - PDFKit.Watermark