I have implemented the Printable interface in such a way that it is expected to print a string appended with the page index. I am calling PrinterJob.setPrintable() with an object of printable and a page format. Page Format object passed to the above method is set with a LANDSCAPE orientation (using setOrientation method). Once the printable and page format is set to the printerjob, I am popping up the PrintDialog and eventually calling the print method of PrinterJob. I am getting a print out in PORTRAIT orientation on Win32 platforms using JDK1.5.0-b05. This seem to work fine in all the builds prior to JDK1.5.0-b05 where I am getting a print out in LANDSCAPE orientation as expected. But in JDK1.5.0-b05, 06 and in the PIT build specified below, the print out still comes in PORTRAIT orientation though the page format is set with LANDSCAPE. But when I set the orientation in the native page dialog by calling PrinterJob.pageDialog() and set the page format returned by this page dialog to the printer job, i am getting the correct output which is LANDSCAPE, on all the builds. But this does not work when orientation is set using PageFormat.setOrientation() in the specified builds.
This bug is reproducible only on Win32 platforms. I tested this with Solaris 8, Win NT and Win XP using 1.3, 1.4.2-b24, 1.5.0 - b02 to b06 and the following PIT build.
java version "2d-jcg-win-01-23-May-03.tiger"
Java(TM) 2 Runtime Environment, Standard Edition (build 2d-jcg-win-01-23-May-03.tiger)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b07, mixed mode)
This is reproducible only from JDK1.5.0-b05.
How to reproduce:
I have attached a sample code. Execute the sample code. If you get the print out in PORTRAIT orientation then the bug is reproduced.