Duplicate :
|
|
Duplicate :
|
|
Relates :
|
Name: jk109818 Date: 09/17/2003 FULL PRODUCT VERSION : java version "1.3.1_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_04-b02) Java HotSpot(TM) Client VM (build 1.3.1_04-b02, mixed mode) and java version "1.4.2" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28) Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode) FULL OS VERSION : Microsoft Windows XP [Version 5.1.2600] A DESCRIPTION OF THE PROBLEM : We have a rather complex data warehouse application which can print multi-form page layouts. Those layouts tend to become more and more complex. When those printouts are produced some (about 30 percent) of the pages are printed incompletely. This happens for different brands of printer, Postscript and non-postscript. The funny thing is that using FinePrint or PDFWriter to print indirectly solves the problem. It is not a printer problem since the spool-file reproducibly stops drawing the page at the same place and reducing the resolution to save printer memory has no effect. Recently, I've found a work-around which might give you a hint on the source of the problem: If I set a non-uniform scale or shear, then the problem seems to disappear for Postscript printers. At least one non-Postscript printer still shows the problem. It also stops more frequently when starting to print a string than with other graphical elements, although I've seen it happen before drawing a box. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Difficult to reproduce exactly. Our application would show the problem on 30 percent of all multi-form page layouts. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Complete printour ACTUAL - Some pages incompletely printed ERROR MESSAGES/STACK TRACES THAT OCCUR : No error message REPRODUCIBILITY : This bug can be reproduced often. CUSTOMER SUBMITTED WORKAROUND : Now, works on Postscript printers by adding a g2.getTransform().scale(0.999999,1.0) transformation or a shear() call. Using FinePrint or PDFWriter as the printer driver also works reproducibly. (Incident Review ID: 200117) ====================================================================== ---------------------- 6308772 Description ---------------------- FULL PRODUCT VERSION : java version "1.5.0_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05) Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing) FULL OS VERSION : Microsoft Windows 2000 ver 5.00.2195 Service Pack 3 A DESCRIPTION OF THE PROBLEM : When printing a JTable in landscape VM crashes; or partially prints; or print is missing or garbage. This behavior occurs if I create my own Printable object and do painting myself in the print method or if I call the JTable print method. The attached testcase should help in reproducing the bug. It has crashed the VM several times. I can't recall it ever printing all three pages correctly. You can control the print density by expanding the columns since it automatically scales the print down. The tests were performed on a HP LaserJet 8000 series printer connected to a 10Gb Ethernet network. It is printing PostScript format. As far as I know the problem does not occur when: - run as an Applet - portrait layout is used - the print is output to a file and printed w/ a utility When I print to a file using the test program I get a lot of garbage. This is the program I used to print the test file. Perhaps there is a threading problem when rotating the image in landscape layout or a buffer issue or several errors. THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: No STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Execute the attached test case EXPECTED VERSUS ACTUAL BEHAVIOR : The table object should print as it does on the screen. ERROR MESSAGES/STACK TRACES THAT OCCUR : Attached seperatly ---------- BEGIN SOURCE ---------- import java.util.*; import java.net.*; import java.awt.*; import java.text.*; import java.awt.event.*; import javax.swing.*; import javax.swing.table.*; import javax.print.*; import javax.print.attribute.*; import javax.print.attribute.standard.*; import javax.print.event.*; public class MainFrame extends JFrame implements ActionListener { JMenuBar menuBar; JMenu options; JMenuItem printAlloc; JTable testTab; TestModel allocModel = new TestModel(); JTabbedPane tabbedPane = new JTabbedPane(); public MainFrame () { super("Print Test"); addWindowListener (new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); testTab = new JTable(); testTab.getTableHeader().setReorderingAllowed(false); testTab.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); testTab.setPreferredScrollableViewportSize(new Dimension(500, 70)); testTab.setColumnSelectionAllowed(true); testTab.setCellSelectionEnabled(true); testTab.setModel(allocModel); JScrollPane jspan = new JScrollPane(testTab); jspan.getViewport().setPreferredSize(new Dimension(500, 300)); //Create the scroll pane and add the table to it. tabbedPane.addTab("Allocations", null, jspan, "Identify Current Allocation"); menuBar = new JMenuBar(); setJMenuBar(menuBar); JMenu printing = new JMenu("Printing"); printAlloc = new JMenuItem("Print Allocations"); printing.add(printAlloc); JMenu actions = new JMenu("Actions"); actions.add(printing); menuBar.add(actions); printAlloc.addActionListener(this); Container cp = getContentPane(); cp.setLayout(new GridLayout(1, 1)); cp.add(tabbedPane); setBounds(20, 20, 700, 800); setVisible(true); } public void actionPerformed(ActionEvent ae) { MessageFormat header = new MessageFormat("Bug Testing"); Object [] arguments = {new Date(System.currentTimeMillis())}; String result = MessageFormat.format("{0,date},",arguments); System.out.println("printing.."); System.out.println(result); MessageFormat footer = new MessageFormat("result"); boolean showPrintDialog = true; boolean interactive = true; PrintRequestAttributeSet attr = new HashPrintRequestAttributeSet(); // set the page orientation attr.add(OrientationRequested.LANDSCAPE); try { System.out.println("printing.."); testTab.print(JTable.PrintMode.FIT_WIDTH, header, footer, showPrintDialog, attr, interactive); System.out.println("printing.. done"); } catch(Exception e) { e.printStackTrace(); } } public static void main (String[] args) { new MainFrame(); } } class TestModel extends AbstractTableModel { String alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; public TestModel() { super(); } public int getColumnCount() { return 15; } public int getRowCount() { return 400; } public Object getValueAt(int row, int col) { return(alpha); } public Class getColumnClass(int col) { try { return getValueAt(0, col).getClass(); } catch (Exception e) { return "Test".getClass(); } } public boolean isCellEditable(int row, int col) { return false; } public void setValueAt(Object value, int row, int col) { } } ---------- END SOURCE ---------- REPRODUCIBILITY : This bug can be reproduced often. CUSTOMER SUBMITTED WORKAROUND : Must print portrate *** (#1 of 1): 2005-08-09 22:21:50 PDT ###@###.###
|