Your location:Home>图形图像 出版印刷

Chart FX Printing

Chart FX Printing

The Printer object provides important and very helpful properties to print a chart. Using this object, 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.

 

Setting the Page Layout

When you are ready to add printing functionality to your chart, there are questions you should take into account:

 

Would you like to use the default printer margins or specify custom margins?

 

Should the printed chart use a landscape or portrait page orientation?

 

Should you prompt the user with a preview or setup dialog to make these choices themselves?

 

Chart FX 7 supports properties and methods that will allow you to specify exactly the page layout desired.

Margins

If no margins are set for a chart, the default printer margins will be used when the chart is printed. Chart FX allows you to specify the top, bottom, right and left margins using the Margins property. The margins property is set using an integer and is measured in hundredths of an inch; therefore, if you would like to set an inch margin around the chart, each margin must be set to 100, using the following API calls:

 

 

If you would rather allow the user to configure the printing margins, you may do so by calling the PageSetup method. The PageSetup method will prompt the user with a page setup dialog box that allows end user access to the page margins and page orientation (Landscape/Portrait). The print preview dialog may also be prompted to the user by calling the PrintPreview method, with the following API:

 

Orientation

From the page setup dialog, the end user my select to print the chart in either the landscape or portrait formats. The landscape format is longer from left to right, while the portrait format is longer from top to bottom.

 

You can also set the page orientation programmatically using the Orientation property, using the API calls below:

 

Printing Colors

Normally if you have a black and white printer and try printing a color chart, you will receive a printout that is virtually unreadable due to the grayscales that are printed instead of the true palette colors. To resolve this type of issue, Chart FX includes the ForceColors property. When a color chart is printed to a B&W printer while this property is set to "False", each color in the chart is printed as a hatched pattern. This helps the end user read different series in the chart based on the contrasting patterns created in the printout. If the chart is to be printed with a color printer, you can force Chart FX to print a color chart by setting this property to "True". The API below should be used to set the ForceColors property and print the chart:

Note: The ForceColors property will have no effect when the Chart is printed with a B/W printer.

北京哲想软件有限公司