public class DefaultPrintHandler extends java.lang.Object implements PrintHandler
PrintHandler
that displays standard Java Print dialog and modify default settings with the settings that end user selects in the dialog. From the print dialog this implementation reads only printer name and update print settings with the selected printer name. Also this implementation enables backgrounds printing.
If you need to modify this default behavior, then you can create your own implementation of the
PrinterHandler
and register it using
Browser.setPrintHandler(com.teamdev.jxbrowser.chromium.PrintHandler)
method.
Constructor and Description |
---|
DefaultPrintHandler(javax.swing.JComponent component) |
Modifier and Type | Method and Description |
---|---|
PrintStatus |
onPrint(PrintJob printJob)
This method is invoked when engine wants to get custom print settings and decide whether it should continue printing or not.
当引擎想要获取自定义打印设置并决定是否继续打印时,将调用此方法。 |
public PrintStatus onPrint(PrintJob printJob)
PrintHandler
onPrint
in interface
PrintHandler
printJob
- active print job. Use it to access default print settings and modify them.
-有效的打印作业。使用它来访问默认打印设置并进行修改。
PrintStatus.CONTINUE
to continue printing.
PrintStatus.CANCEL
to cancel printing. You can return
null
. In this case it will be equivalent of
PrintStatus.CANCEL
.
继续打印。取消打印。您可以返回。在这种情况下,它等于。