United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4869575 : Setting orientation in the page format does not have any effect on the printout

Details
Type:
Bug
Submit Date:
2003-05-26
Status:
Closed
Updated Date:
2003-07-21
Project Name:
JDK
Resolved Date:
2003-07-07
Component:
client-libs
OS:
windows_nt,windows_xp
Sub-Component:
2d
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.1,5.0
Fixed Versions:
5.0 (tiger)

Related Reports
Backport:
Duplicate:

Sub Tasks

Description
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.

                                    

Comments
EVALUATION

Committing to tiger.
###@###.### 2003-05-27
===================================
Problem is that orientation setting in the print properties dialog is still set to portrait even though PageFormat's orientation is set to Landscape.  This is also evident in previous builds.  Apparently, older version like 1.4.1 prints it in landscape so the bug is not obviously seen but in Tiger, print dialog settings like orientation are always copied into the internal state through attributes thereby whatever is set in the print dialog, in this case portrait,  will also be printed as such.  The fix is to make sure that printDialog() reflects the PageFormat's settings.

###@###.### 2003-06-04
====================================
                                     
2003-06-04
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger

FIXED IN:
tiger

INTEGRATED IN:
tiger
tiger-b10

VERIFIED IN:
tiger


                                     
2004-06-14



Hardware and Software, Engineered to Work Together