Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4236095
Votes 0
Synopsis 1.2 printing API: REVERSE_LANDSCAPE printer orientation not working
Category java:classes_2d
Reported Against 1.2.2
Release Fixed 1.3
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 06-MAY-1999
Description
Using Java 2 SDK 1.2.2, REVERSE_LANDSCAPE printer orientation
may result in nothing being printedThe new printing API in JDK 1.2 supports several paper orientations.

With JDK 1.2 LANDSCAPE and REVERSE_LANDSCAPE were ignored (when not
printing a raster).

That was filed as bug 4186119 which fixed the LANDSCAPE case.

Now however, REVERSE_LANDSCAPE seems to have an effect: but it appears
it transforms the drawing righf off the device/page.

The following test case from "J.Ganesan" < xxxxx@xxxxx >
which simply did not set orientation on 1.2FCS, now
(using JDK 1.2.2) shows nothing on the page at all.

import javax.swing.* ;
import java.awt.* ;
import java.awt.print.* ;

public class HorizontalLine implements Printable 
             
{
  public HorizontalLine()
  {
    super() ;
  }
  
  public void paint( Graphics g )
  {
    g.setColor(Color.black);
    g.drawLine( 100 , 100 , 300 , 100 ) ;
  }
  
  public int print(Graphics g, PageFormat pf, int pi) throws PrinterException
  {
    if (pi >= 1) {
      return Printable.NO_SUCH_PAGE;
    }
    paint(g);
    return Printable.PAGE_EXISTS;
  }
  
  public static void main( String[] args )
  {
    // Get a PrinterJob     
    PrinterJob prnJob = PrinterJob.getPrinterJob();
    PageFormat pf = prnJob.defaultPage();
    pf.setOrientation(PageFormat.REVERSE_LANDSCAPE);
    prnJob.setPrintable(new HorizontalLine() , pf );     
       try 
       { 
         prnJob.print();
       }  
       catch (PrinterIOException e) 
       { /* handle exception */ 
         System.out.println( e ) ;
       }       
       catch (Exception e) 
       { /* handle exception */ 
         System.out.println( e ) ;
       }       
  }  
}
Work Around
Use LANDSCAPE.
Evaluation
incorrect transform
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang