The way that page size is set depends on the method that you use to print.
When you use PrintDialog.show
or ViewPrinter.print(boolean)
to print, then the view printer finds the page size from the printer job (2D
printing) or from the print job (AWT printing). You do not have to set anything.
When you use PageSetupDialog.show
or PreviewDialog.show
, you call the setPageFormat
method to set the page format on the view printer.
When you use ViewPrinter.renderPage
or ViewPrinter.printPage
,
you set the ViewDimension
property of the view printer to set the
paper size. The view printer treats the ViewDimension
property
as the page size, even if you print more than one object on a page.
With ViewPrinter.renderPage
, the view printer respects margin settings and
prints headers and footers inside the area that the ViewDimension
specifies.
With ViewPrinter.printPage
, the view printer does not respect margin property
settings; instead, it prints the view into the entire area. It does not print headers and
footers.