public class Printer
extends java.lang.Object
Provides access to the Printer object.
The Printer class provides important and very helpful methods to print the chart. Using the supported members, you will have control over the margins, paper orientation, color or pattern printing, among others. The supported methods will also allow you to prompt the user with page setup, preview, and print dialogs to ensure the user prints exactly what they want.
| Constructor and Description |
|---|
Printer()
Constructs a newly allocated Printer object
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Insets |
getMargins()
Gets or sets the margins, in hundredths of an inch.
|
PageOrientation |
getOrientation()
Allows you to select a paper orientation when printing charts.
|
boolean |
isCompress()
Forces Chart FX to print the chart in one page regardless of scrolling.
|
boolean |
isDrawBackground()
Used to instruct Chart FX to include the Background when printing a chart.
|
boolean |
isForceColors()
Allows you to force color printing (matching) even when the printer is B&W.
|
boolean |
isUsePrinterResolution()
Forces the printer to use maximum resolution when printing charts.
|
void |
resetCompress()
Set the property Compress to its default value.
|
void |
resetDrawBackground()
Set the property DrawBackground to its default value.
|
void |
resetForceColors()
Set the property ForceColors to its default value.
|
void |
resetOrientation()
Set the property Orientation to its default value.
|
void |
resetUsePrinterResolution()
Set the property UsePrinterResolution to its default value.
|
void |
setCompress(boolean value)
Forces Chart FX to print the chart in one page regardless of scrolling.
|
void |
setDrawBackground(boolean value)
Used to instruct Chart FX to include the Background when printing a chart.
|
void |
setForceColors(boolean value)
Allows you to force color printing (matching) even when the printer is B&W.
|
void |
setMargins(java.awt.Insets value)
Gets or sets the margins, in hundredths of an inch.
|
void |
setOrientation(PageOrientation value)
Allows you to select a paper orientation when printing charts.
|
void |
setUsePrinterResolution(boolean value)
Forces the printer to use maximum resolution when printing charts.
|
public boolean isCompress()
chart1.getPrinter().setCompress(true);
resetCompresspublic void setCompress(boolean value)
chart1.getPrinter().setCompress(true);
value - resetCompresspublic boolean isDrawBackground()
chart1.getPrinter().setDrawBackground(true);
resetDrawBackgroundpublic void setDrawBackground(boolean value)
chart1.getPrinter().setDrawBackground(true);
value - resetDrawBackgroundpublic boolean isForceColors()
chart1.getPrinter().setForceColors(true);
resetForceColorspublic void setForceColors(boolean value)
chart1.getPrinter().setForceColors(true);
value - resetForceColorspublic java.awt.Insets getMargins()
Gets or sets the margins, in hundredths of an inch.
The setMargins method is set in hundredths of an inch, therefore, if you set this method to 100 the corresponding margin will be set to one inch.
For more information regarding the Printing type, please refer to the Documentation.
To set all margins to 20:
chart1.getPrinter().setMargins(new SfxNET.System.Drawing.Printing.Margins(20, 20, 20, 20));
public void setMargins(java.awt.Insets value)
Gets or sets the margins, in hundredths of an inch.
The setMargins method is set in hundredths of an inch, therefore, if you set this method to 100 the corresponding margin will be set to one inch.
For more information regarding the Printing type, please refer to the Documentation.
To set all margins to 20:
chart1.getPrinter().setMargins(new SfxNET.System.Drawing.Printing.Margins(20, 20, 20, 20));
value - public PageOrientation getOrientation()
Allows you to select a paper orientation when printing charts.
The isCompress method will force the chart to fit to one page, then you may assign the Landscape or Portrait orientations.
You can assign custom margins for printing using the setMargins method.
To print the chart in Horizontal mode:
resetOrientationpublic void setOrientation(PageOrientation value)
Allows you to select a paper orientation when printing charts.
The isCompress method will force the chart to fit to one page, then you may assign the Landscape or Portrait orientations.
You can assign custom margins for printing using the setMargins method.
To print the chart in Horizontal mode:
value - resetOrientationpublic boolean isUsePrinterResolution()
chart1.getPrinter().setUsePrinterResolution(true);
resetUsePrinterResolutionpublic void setUsePrinterResolution(boolean value)
chart1.getPrinter().setUsePrinterResolution(true);
value - resetUsePrinterResolutionpublic void resetCompress()
isCompresspublic void resetDrawBackground()
isDrawBackgroundpublic void resetForceColors()
isForceColorspublic void resetOrientation()
setOrientationpublic void resetUsePrinterResolution()
isUsePrinterResolution2014 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
All other names are trademarks or registered trademarks of their respective owners.