As documented on PrinterJob, the JobSettings installed on that job will initially reflect the current default settings for the initially associated printer for that job.
The JobSettings delegate then remains the same for the life of the job, and will have it's member properties updated to be compatible with a change in Printer on the job. For example as a result of a user interaction via a platform's dialog. An incompatible setting will usually cause the setting to revert to the default for the new printer.
Any implicit or explicit updates to settings resulting from the user interaction with dialog will be propagated and visible to the application once the user approves the settings by dismissing the dialog using its "accept" option.
For most printing applications it is likely sufficient to let the user set the desired options and have these propagated to the job. For applications which need them, there are setter and getter methods for the individual options, which are also available as properties, and change in values of settings may be monitored and updated via these properties.
 Not all values of settings are available on all printers. For example
 a printer may not support two-sided printing.
 See the Printer class for how to
 to determine supported settings.
- Since:
- JavaFX 8.0
- 
Property SummaryPropertiesTypePropertyDescriptionProperty representing an instance ofCollation.IntegerPropertyrepresenting the number of copies of the job to print.StringPropertyrepresenting the name of a job.AStringPropertyrepresenting the name of a filesystem file, to which the platform printer driver should spool the rendered print data.Property representing an instance ofPageLayout.AnObjectPropertywhose value represents the job pages to print as an array of PageRange.Property representing an instance ofPaperSource.Property representing an instance ofPrintColor.Property representing an instance ofPrintQuality.Property representing an instance ofPrintResolution.Property representing an instance ofPrintSides.
- 
Method SummaryModifier and TypeMethodDescriptionProperty representing an instance ofCollation.IntegerPropertyrepresenting the number of copies of the job to print.Collation determines how sheets are sorted when multiple copies of a document are printed.intGet the number of copies to print.Get the name of a job.Gets the value of the property outputFile.Get the current page layout for this job.The range of pages to print.Gets the value of the property paperSource.Gets the value of the property printColor.Gets the value of the property printQuality.If a printer supports it, then a job may be printed on both sides of the media (paper), ie duplex printing.StringPropertyrepresenting the name of a job.AStringPropertyrepresenting the name of a filesystem file, to which the platform printer driver should spool the rendered print data.Property representing an instance ofPageLayout.AnObjectPropertywhose value represents the job pages to print as an array of PageRange.Property representing an instance ofPaperSource.Property representing an instance ofPrintColor.Property representing an instance ofPrintQuality.Property representing an instance ofPrintResolution.Property representing an instance ofPrintSides.voidsetCollation(Collation collation)Set theCollationproperty.voidsetCopies(int nCopies)Set the number of copies to print.voidsetJobName(String name)Set the name of a job.voidsetOutputFile(String filePath)Sets the value of the property outputFile.voidsetPageLayout(PageLayout pageLayout)Set the PageLayout to use.voidsetPageRanges(PageRange... pages)The range of pages to print as an array of PageRange.voidsetPaperSource(PaperSource value)Sets the value of the property paperSource.voidsetPrintColor(PrintColor color)Set thePrintColorproperty.voidsetPrintQuality(PrintQuality quality)Set thePrintQualityproperty.voidsetPrintResolution(PrintResolution resolution)Set thePrintResolutionproperty.voidsetPrintSides(PrintSides sides)Set thePrintSidesproperty which controls duplex printing.
- 
Property Details- 
jobNameStringPropertyrepresenting the name of a job.- See Also:
- getJobName(),- setJobName(String)
 
- 
outputFileAStringPropertyrepresenting the name of a filesystem file, to which the platform printer driver should spool the rendered print data.Applications can use this to programmatically request print-to-file behavior where the native print system is capable of spooling the output to a filesystem file, rather than the printer device. This is often useful where the printer driver generates a format such as Postscript or PDF, and the application intends to distribute the result instead of printing it, or for some other reason the application does not want physical media (paper) emitted by the printer. The default value is an empty string, which is interpreted as unset, equivalent to null, which means output is sent to the printer. So in order to reset to print to the printer, clear the value of this property by setting it to null or an empty string. Additionally if the application displays a printer dialog which allows the user to specify a file destination, including altering an application specified file destination, the value of this property will reflect that user-specified choice, including clearing it to reset to print to the printer, if the user does so. If the print system does not support print-to-file, then this setting will be ignored. If the specified name specifies a non-existent path, or does not specify a user writable file, when printing the results are platform-dependent. Possible behaviours might include replacement with a default output file location, printing to the printer instead, or a platform printing error. If a SecurityManageris installed and it denies access to the specified file aSecurityExceptionmay be thrown.- Default value:
- an empty string
- Since:
- 17
- See Also:
- getOutputFile(),- setOutputFile(String)
 
- 
copiesIntegerPropertyrepresenting the number of copies of the job to print.- See Also:
- getCopies(),- setCopies(int)
 
- 
pageRangesAnObjectPropertywhose value represents the job pages to print as an array of PageRange. A null values mean print all pages. Otherwise it must be a non-overlapping array of PageRange instances ordered in increasing page number. Page numbers start from 1 (one). An empty array is considered equivalent to a null array.An illegal or unsupported (by the printer) set of page ranges will be ignored. Ranges which exceed beyond the number of pages imaged by the job during printing do not cause any error. - See Also:
- getPageRanges(),- setPageRanges(PageRange[])
 
- 
printSidesProperty representing an instance ofPrintSides.- See Also:
- getPrintSides(),- setPrintSides(PrintSides)
 
- 
collationProperty representing an instance ofCollation.- See Also:
- getCollation(),- setCollation(Collation)
 
- 
printColorProperty representing an instance ofPrintColor.- See Also:
- getPrintColor(),- setPrintColor(PrintColor)
 
- 
printQualityProperty representing an instance ofPrintQuality.- See Also:
- getPrintQuality(),- setPrintQuality(PrintQuality)
 
- 
printResolutionProperty representing an instance ofPrintResolution.
- 
paperSourceProperty representing an instance ofPaperSource.- See Also:
- getPaperSource(),- setPaperSource(PaperSource)
 
- 
pageLayoutProperty representing an instance ofPageLayout.- See Also:
- getPageLayout(),- setPageLayout(PageLayout)
 
 
- 
- 
Method Details- 
jobNamePropertyStringPropertyrepresenting the name of a job.- See Also:
- getJobName(),- setJobName(String)
 
- 
getJobNameGet the name of a job.- Returns:
- a string representing the name of a job
 
- 
setJobNameSet the name of a job.- Parameters:
- name- string representing the name of a job
 
- 
outputFilePropertyAStringPropertyrepresenting the name of a filesystem file, to which the platform printer driver should spool the rendered print data.Applications can use this to programmatically request print-to-file behavior where the native print system is capable of spooling the output to a filesystem file, rather than the printer device. This is often useful where the printer driver generates a format such as Postscript or PDF, and the application intends to distribute the result instead of printing it, or for some other reason the application does not want physical media (paper) emitted by the printer. The default value is an empty string, which is interpreted as unset, equivalent to null, which means output is sent to the printer. So in order to reset to print to the printer, clear the value of this property by setting it to null or an empty string. Additionally if the application displays a printer dialog which allows the user to specify a file destination, including altering an application specified file destination, the value of this property will reflect that user-specified choice, including clearing it to reset to print to the printer, if the user does so. If the print system does not support print-to-file, then this setting will be ignored. If the specified name specifies a non-existent path, or does not specify a user writable file, when printing the results are platform-dependent. Possible behaviours might include replacement with a default output file location, printing to the printer instead, or a platform printing error. If a SecurityManageris installed and it denies access to the specified file aSecurityExceptionmay be thrown.- Default value:
- an empty string
- Since:
- 17
- See Also:
- getOutputFile(),- setOutputFile(String)
 
- 
getOutputFileGets the value of the property outputFile.- Property description:
- A StringPropertyrepresenting the name of a filesystem file, to which the platform printer driver should spool the rendered print data.Applications can use this to programmatically request print-to-file behavior where the native print system is capable of spooling the output to a filesystem file, rather than the printer device. This is often useful where the printer driver generates a format such as Postscript or PDF, and the application intends to distribute the result instead of printing it, or for some other reason the application does not want physical media (paper) emitted by the printer. The default value is an empty string, which is interpreted as unset, equivalent to null, which means output is sent to the printer. So in order to reset to print to the printer, clear the value of this property by setting it to null or an empty string. Additionally if the application displays a printer dialog which allows the user to specify a file destination, including altering an application specified file destination, the value of this property will reflect that user-specified choice, including clearing it to reset to print to the printer, if the user does so. If the print system does not support print-to-file, then this setting will be ignored. If the specified name specifies a non-existent path, or does not specify a user writable file, when printing the results are platform-dependent. Possible behaviours might include replacement with a default output file location, printing to the printer instead, or a platform printing error. If a SecurityManageris installed and it denies access to the specified file aSecurityExceptionmay be thrown.
- Default value:
- an empty string
- Since:
- 17
 
- 
setOutputFileSets the value of the property outputFile.- Property description:
- A StringPropertyrepresenting the name of a filesystem file, to which the platform printer driver should spool the rendered print data.Applications can use this to programmatically request print-to-file behavior where the native print system is capable of spooling the output to a filesystem file, rather than the printer device. This is often useful where the printer driver generates a format such as Postscript or PDF, and the application intends to distribute the result instead of printing it, or for some other reason the application does not want physical media (paper) emitted by the printer. The default value is an empty string, which is interpreted as unset, equivalent to null, which means output is sent to the printer. So in order to reset to print to the printer, clear the value of this property by setting it to null or an empty string. Additionally if the application displays a printer dialog which allows the user to specify a file destination, including altering an application specified file destination, the value of this property will reflect that user-specified choice, including clearing it to reset to print to the printer, if the user does so. If the print system does not support print-to-file, then this setting will be ignored. If the specified name specifies a non-existent path, or does not specify a user writable file, when printing the results are platform-dependent. Possible behaviours might include replacement with a default output file location, printing to the printer instead, or a platform printing error. If a SecurityManageris installed and it denies access to the specified file aSecurityExceptionmay be thrown.
- Default value:
- an empty string
- Since:
- 17
 
- 
copiesPropertyIntegerPropertyrepresenting the number of copies of the job to print.- See Also:
- getCopies(),- setCopies(int)
 
- 
getCopiespublic int getCopies()Get the number of copies to print.- Returns:
- number of copies to print
 
- 
setCopiespublic final void setCopies(int nCopies)Set the number of copies to print.- Parameters:
- nCopies- number of copies to print
 
- 
pageRangesPropertyAnObjectPropertywhose value represents the job pages to print as an array of PageRange. A null values mean print all pages. Otherwise it must be a non-overlapping array of PageRange instances ordered in increasing page number. Page numbers start from 1 (one). An empty array is considered equivalent to a null array.An illegal or unsupported (by the printer) set of page ranges will be ignored. Ranges which exceed beyond the number of pages imaged by the job during printing do not cause any error. - See Also:
- getPageRanges(),- setPageRanges(PageRange[])
 
- 
getPageRangesThe range of pages to print. null always means all pages. SeepageRangesProperty()for more details.- Returns:
- null or an array as specified above
 
- 
setPageRangesThe range of pages to print as an array of PageRange. The use of varargs means the common case of a single range can be auto-boxed.((PageRange[])null)always means all pages however since this is the default it is less likely to be used. SeepageRangesProperty()for more details.- Parameters:
- pages- null or a varargs array as specified above
 
- 
printSidesPropertyProperty representing an instance ofPrintSides.- See Also:
- getPrintSides(),- setPrintSides(PrintSides)
 
- 
getPrintSidesIf a printer supports it, then a job may be printed on both sides of the media (paper), ie duplex printing. This method returns the selected setting.- Returns:
- the duplex (side) setting.
 
- 
setPrintSidesSet thePrintSidesproperty which controls duplex printing. A null value is ignored.- Parameters:
- sides- new setting for number of sides.
 
- 
collationPropertyProperty representing an instance ofCollation.- See Also:
- getCollation(),- setCollation(Collation)
 
- 
getCollationCollation determines how sheets are sorted when multiple copies of a document are printed. As such it is only relevant if 2 or more copies of a document with 2 more sheets are printed. A sheet is the physical media, so documents with 2 pages that are printed N-up, or double-sided may still have only one sheet. A collated print job produces documents with sheets of a document sorted in sequence. An uncollated job collects together the multiple copies of the same sheet. Uncollated (false) is the typical default value.- Returns:
- the collation
 
- 
setCollationSet theCollationproperty. A null value is ignored.- Parameters:
- collation- new setting for collation
 
- 
printColorPropertyProperty representing an instance ofPrintColor.- See Also:
- getPrintColor(),- setPrintColor(PrintColor)
 
- 
getPrintColorGets the value of the property printColor.- Property description:
- Property representing an instance of PrintColor.
 
- 
setPrintColorSet thePrintColorproperty. A null value is ignored.- Parameters:
- color- new setting for print color.
 
- 
printQualityPropertyProperty representing an instance ofPrintQuality.- See Also:
- getPrintQuality(),- setPrintQuality(PrintQuality)
 
- 
getPrintQualityGets the value of the property printQuality.- Property description:
- Property representing an instance of PrintQuality.
 
- 
setPrintQualitySet thePrintQualityproperty. A null value is ignored.Note that quality and resolution overlapping concepts. Therefore a printer may support setting one, or the other but not both. Applications setting these programmatically should query both properties and select appropriately from the supported values. If a printer supports non-standard values, code likely cannot distinguish the printer's interpretation of these values and is safest to stick to selecting from the standard value that matches the requirement. - Parameters:
- quality- new setting for print quality.
 
- 
printResolutionPropertyProperty representing an instance ofPrintResolution.
- 
getPrintResolution- Returns:
- the print resolution
 
- 
setPrintResolutionSet thePrintResolutionproperty. A null value is ignored.Note that quality and resolution overlapping concepts. Therefore a printer may support setting one, or the other but not both. Applications setting these programmatically should query both properties and select appropriately from the supported values. If a printer supports non-standard values, code likely cannot distinguish the printer's interpretation of these values and is safest to stick to selecting from the standard value that matches the requirement. - Parameters:
- resolution- new setting for print resolution.
 
- 
paperSourcePropertyProperty representing an instance ofPaperSource.- See Also:
- getPaperSource(),- setPaperSource(PaperSource)
 
- 
getPaperSourceGets the value of the property paperSource.- Property description:
- Property representing an instance of PaperSource.
 
- 
setPaperSourceSets the value of the property paperSource.- Property description:
- Property representing an instance of PaperSource.
 
- 
pageLayoutPropertyProperty representing an instance ofPageLayout.- See Also:
- getPageLayout(),- setPageLayout(PageLayout)
 
- 
getPageLayoutGet the current page layout for this job.- Returns:
- page layout to use for the job.
 
- 
setPageLayoutSet the PageLayout to use.- Parameters:
- pageLayout- The page layout to use.
 
 
-