
Print Views:
There are two view in which documents can be printed. These are:
1. Landscape
2. Portrait
1. Landscape: In this view, the printing content will be printed Horizontally on the paper. If we will configure our printer for the Landscape view, all the content will displayed horizontally on the final print. This view is more suitable and admired for printing photographs(Wildlife, family, beautiful sceneries) and office documents where the number of columns is more. This is also suitable for printing the book view where two pages of book can be displayed on the same paper.
1. Portrait: In this view, the printing content will be printed Vertically on the paper. If we will configure our printer for the Portrait view, all the content will be displayed vertically on the final print. This view is more suitable and admired for printing photographs(Single Person) and office documents where the number of columns is less and more number of rows needs to be printed on a single page.
How to configure the printing views in JAVA ?
1. Landscape view: In this view the origin of the co-ordinate axis will be the bottom left of the page. X axis will run from bottom to top and y axis starts from bottom and will span towards right side. Below are the settings for this view:
Paper paper = ExtraUtil.getA4Paper();
PageFormat pf= new PageFormat();
pf.setPaper(paper);
pf.setOrientation(PageFormat.LANDSCAPE);
2. Portrait view: In this view the origin of the co-ordinate axis will be the top left of the page. X axis will run from top to bottom and y axis starts from top left and will span towards right side. Below are the settings for this view:
Paper paper = ExtraUtil.getA4Paper();
PageFormat pf= new PageFormat();
pf.setPaper(paper);
pf.setOrientation(PageFormat.PORTRAIT);
3. Reverse Portrait: Apart from the two common views, one more view is supported by JAVA. It is REVERSE_LANDSCAPE. This is specially fro Mac PC's. This is slightly different from the normal Landscape. The only difference is that the origin is considered as the top right of paper and X axis spans towards left. Similary Y axis is from top to bottom. Below are the settings for this view:
Paper paper = ExtraUtil.getA4Paper();
PageFormat pf= new PageFormat();
pf.setPaper(paper);
pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
No comments:
Post a Comment