Printing graphics with 72DPI

It's possible to print in flex image (high resolution png/jpg file) with  print quality greater than 72DPI ?

it seems that the printout from the flash player  is limited to 72dpi. Am I right ???

Similar Messages

  • Color printing help with large graphics Reader 11.0.3

    Good morning!  We recently upgraded to 11.0.3.  Windows 7 64-bit.  We've had issues printing large color graphics from Reader 11.
    For example, the PDF will have an intricate purple graphic with matching purple text blocks underneath.  Print preview shows correctly, but when printed the graphic prints brown instead of purple.  The purple text blocks print correctly.  This seems to happen sporadically, but seems to be with complex graphics.
    Documents from all other apps print OK and if we open this .pdf from Acrobat X Standard and export it to a .png file the colors print correctly. 
    The graphic files come from a myriad of sources and customers and we don't have control over the way the documents are originally saved or what apps are used to create the artwork. 
    Any idea why the graphics colors aren't printing and if there are settings we can adjust in Reader 11 so they will print correctly?
    We've tried:
    - Printing to several printers with different drivers and all yield the same results.  (Toshiba eStudio 3530c with PCL6 and PS drivers, Epson Artisan 835, HP OfficeJet 8600, Samsung CLX-6200x)
    - Adjusting the Overprint Preview settings under File -> Preferences and setting "Simulate Overprinting" under the Advanced button in the print preview window.
    - Selecting "Print As Image" under the Advanced button in the print preview window.
    - Adjusting the Document Color Options under File -> Preferences -> Accessibility.
    Thanks in advance for any help!

    Fastest thing you can try: use Windows Explorer to navigate to C:\Program Files (x86)\Adobe\Reader 11.0\Reader, then double-click on Eula.exe and accept the license agreement.
    If that doesn't work, you can try using this tool to first remove all traces of Reader from your computer:
    http://labs.adobe.com/downloads/acrobatcleaner.html
    Then, you can download the full offline Reader installer from
    http://get.adobe.com/reader/enterprise/
    After downloading, restart your computer and run the installer before doing anything else.

  • Printing problem with muliple page 2D graphics.........URGENT

    /*hi
    I want to print the drawings that i create in my painting application.
    Following is the extract from my drawing application, which takes care of the printing part. The problem i am facing is that, i am able to print only one page, the other parts of my drawing are clipped (both from the horizontal as well as vertical direction)
    However i did found some help on printing multiple page TEXT documents, from some literature, but nothing was mentioned about printing drawing that may extend to multiple pages.
    Since printing forms a very important part of any painting application, the whole of my project now relies on the success of the printing code. Its really urgent for me to get out of this problem, any kind of help from anyone would be a great contribution in completing my project */
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.print.*;
    public class Print {
    public static void main(String[] args) {
    PrintFrame f = new PrintFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.show();
    class PrintFrame extends JFrame implements ActionListener{
    DrawingPanel drawingPanel = new DrawingPanel();
    public PrintFrame() {
    setTitle("Test Printing");
    setBounds(100,100,500,400);
    getContentPane().add(new JScrollPane(drawingPanel), BorderLayout.CENTER);
    JButton printButton = new JButton("Print");
    getContentPane().add(printButton,BorderLayout.SOUTH);
    printButton.addActionListener(this);
    public void actionPerformed(ActionEvent event) {
    PrintUtilities.printComponent(drawingPanel);
    class DrawingPanel extends JPanel {
    private int fontSize = 90;
    private String message = "Java 2D";
    private int messageWidth;
    Dimension pref = new Dimension(1500, 1500);//will define the max scrollable area
    public Dimension getPreferredSize() {
    return pref;
    public DrawingPanel() {
    setBackground(Color.white);
    Font font = new Font("Serif", Font.PLAIN, fontSize);
    setFont(font);
    FontMetrics metrics = getFontMetrics(font);
    messageWidth = metrics.stringWidth(message);
    int width = messageWidth*5/3;
    int height = fontSize*3;
    setPreferredSize(new Dimension(width, height));
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    Graphics2D g2d = (Graphics2D)g;
    int x = messageWidth/10;
    int y = fontSize*5/2;
    g2d.translate(x, y);
    g2d.setPaint(Color.lightGray);
    AffineTransform origTransform = g2d.getTransform();
    g2d.shear(-0.95, 0);
    g2d.scale(1, 3);
    g2d.drawString(message, 0, 0);
    g2d.setTransform(origTransform);
    g2d.setPaint(Color.black);
    g2d.drawString(message, 0, 0);
    g2d.drawLine(5,5,1490,500);//this line goes outside my paper width, & does not get printed
    class PrintUtilities implements Printable {
    private Component componentToBePrinted;
    public static void printComponent(Component c) {
    new PrintUtilities(c).print();
    public PrintUtilities(Component componentToBePrinted) {
    this.componentToBePrinted = componentToBePrinted;
    public void print() {
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if (printJob.printDialog())
    try {
    printJob.print();
    } catch(PrinterException pe) {
    System.out.println("Error printing: " + pe);
    public int print(Graphics g, PageFormat pageFormat, int pageIndex) {
    if (pageIndex > 0) {
    return(NO_SUCH_PAGE);
    } else {
    Graphics2D g2 = (Graphics2D)g;
    g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    disableDoubleBuffering(componentToBePrinted);
    componentToBePrinted.paint(g2);
    enableDoubleBuffering(componentToBePrinted);
    return(PAGE_EXISTS);
    /* disables double buffering globally. */
    public static void disableDoubleBuffering(Component c) {
    RepaintManager currentManager = RepaintManager.currentManager(c);
    currentManager.setDoubleBufferingEnabled(false);
    /* Re-enables double buffering globally. */
    public static void enableDoubleBuffering(Component c) {
    RepaintManager currentManager = RepaintManager.currentManager(c);
    currentManager.setDoubleBufferingEnabled(true);
    }

    Um I dont know if im doing something daft but I tried this like you said
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if(printJob.printDialog()){
    try {
              PageFormat pageFormat = printJob.defaultPage();
              if (pageFormat.getOrientation() == PageFormat.PORTRAIT) {
              landscape = 0;} else {
                   landscape = 1;}
              System.out.println("THE ORIENTATION IS "+ landscape);
              printJob.print(); }
    catch (Exception PrinterExeption) { PrinterExeption.printStackTrace();}
    and it doesnt seem to work as I tried it both as landscape and portrait in the print dialog but landscape is always 0.
    cheers
    pmiggy

  • I cannot get my HP officejet 4215 all-in-one to print graphics

    how do i get my HP officejet 4215 all-in-one to print graphics. as an example if i print my visa statement the visa logo and bank logos don,t print

    bamajim,
    Here is a link to a page for your printer that may help with your issue.
    The document provides steps to troubleshoot printouts that do not match the screen while printing from the web.
    Does this also happen when printing graphics from somewhere other than the web ?
    Once you give these steps a try let us know what happens.
    If I helped you at all it would be great if you clicked the blue kudos star!
    If I solved your post please mark it as solved to help others.
    I'm a printer tech with HP.

  • Print JTable with Multiple pages and rows

    I took the printing example at http://java.sun.com/developer/onlineTraining/Programming/JDCBook/advprint.html#pe and modified it a bit to include the following:
    1) To Print Multiple pages
    2) To wrap lines that is too long for the column
    3) To print with a more proffesional style, so that it doesn't look like a screen capture is printed
    4) To align the numbers to the right and center column headings
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.print.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.Dimension;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import java.text.*;
    public class Report implements Printable
         private final int LEFT_ALIGN = -1;
         private final int CENTER_ALIGN = 0;
         private final int RIGHT_ALIGN = 1;
         private JFrame frame;
         private JTable tableView;
         private String lastPrintDate;
         private Font defaultFont;
         private Font headerFont;
         private Font footerFont;
         private int headerHeight;
         private int footerHeight;
         private int cellBuffer = 5;
         private boolean first_pass;
         private ArrayList pages;
         public Report()
              frame = new JFrame("Sales Report");
              frame.addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent e)
                        System.exit(0);
              final String[] headers =
                   "ID",
                   "Description",
                   "open price",
                   "latest price",
                   "End Date",
                   "Quantity"
              int count = 0;
              final Object[][] data =
                   {new Integer(count++), "Box of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of BirosBox of Biros ppppppppppppppp", "1.00", "4.99", new Date(), new Integer(200000)},
                   {new Integer(count++), "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++), "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++), "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++), "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++), "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++), "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++), "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++), "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++), "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++), "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++), "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++), "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++), "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++), "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++), "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++), "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++), "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++), "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++), "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++),  "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++),  "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)},
                   {new Integer(count++),  "Blue Biro", "0.10", "0.14", new Date(), new Integer(1)},
                   {new Integer(count++),  "legal pad", "1.00", "2.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "tape", "1.00", "1.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "stapler", "4.00", "4.49", new Date(), new Integer(1)},
                   {new Integer(count++),  "Box of Biros", "1.00", "4.99", new Date(), new Integer(2)}
              TableModel dataModel = new AbstractTableModel()
                   public int getColumnCount() { return headers.length; }
                   public int getRowCount() { return data.length;}
                   public Object getValueAt(int row, int col)
                        return data[row][col];
                   public String getColumnName(int column)
                        return headers[column];
                   public Class getColumnClass(int col)
                        return getValueAt(0,col).getClass();
                   public boolean isCellEditable(int row, int col)
                        return (col==1);
                   public void setValueAt(Object aValue, int row, int column)
                        data[row][column] = aValue;
              tableView = new JTable(dataModel);
              JScrollPane scrollpane = new JScrollPane(tableView);
              scrollpane.setPreferredSize(new Dimension(500, 80));
              frame.getContentPane().setLayout(new BorderLayout());
              frame.getContentPane().add(BorderLayout.CENTER,scrollpane);
              frame.pack();
              JButton printButton= new JButton();
              printButton.setText("print me!");
              frame.getContentPane().add(BorderLayout.SOUTH,printButton);
              // for faster printing turn double buffering off
              RepaintManager.currentManager(frame).setDoubleBufferingEnabled(false);
              printButton.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent evt)
                        doPrint();
              frame.setVisible(true);
          * Reset variables before printing
         private void prepareForPrint()
              pages = new ArrayList();
              first_pass = true;
          * Display a print dialog with some hardcoded defaults
          * The print fonts are also hardcoded
         public void doPrint()
              try
                   String jobName = "Java Report";
                   defaultFont = new Font("Arial", Font.PLAIN, 8);
                   footerFont = new Font("Arial", Font.PLAIN, 6);
                   headerFont = new Font("Arial", Font.BOLD, 10);
                   PrinterJob prnJob = PrinterJob.getPrinterJob();
                   prnJob.setPrintable(this);
                   PrintRequestAttributeSet prnSet = new HashPrintRequestAttributeSet();
                   prnSet.add(new Copies(1));
                   prnSet.add(new JobName(jobName, null));
                   prnSet.add(MediaSizeName.ISO_A4);
                   PageFormat pf = prnJob.defaultPage();
                   pf.setOrientation(java.awt.print.PageFormat.PORTRAIT);
                   prnJob.setJobName(jobName);
                   PrintService[] services = PrinterJob.lookupPrintServices();
                   if (services.length > 0)
                        if (prnJob.printDialog(prnSet))
                              * Get print date
                             String dateFormat = "dd/MM/yyyy HH:mm:ss";
                             DateFormat m_DateFormat = new SimpleDateFormat(dateFormat);
                             lastPrintDate = m_DateFormat.format(new Date()).toString();
                             prepareForPrint();
                             prnJob.print(prnSet);
                   else
                        JOptionPane.showMessageDialog(frame, "No Printer was found!!", "Printer Error", JOptionPane.ERROR_MESSAGE);
                        return;
              catch (PrinterException e)
                   e.printStackTrace();
         public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException
               * Check if this is the first time the print method is called for this print action.
               * It is not guaranteed that the print will be called with synchronous pageIndex'es,
               * so we need to calculate the number of pages and which rows appear on which pages.
               * Then the correct page will be printed regardless of which pageIndex is sent through.
              if (first_pass)
                   calcPages(g, pageFormat);
              first_pass = false;
              // Stop printing if the pageIndex is out of range
              if (pageIndex >= pages.size())
                   return NO_SUCH_PAGE;
              Graphics2D     g2 = (Graphics2D) g;
              g2.setColor(Color.black);
              // The footer will be one line at the bottom of the page, cater for this.
              g2.setFont(footerFont);
              footerHeight = g2.getFontMetrics().getHeight() + g2.getFontMetrics().getDescent();
              g2.setFont(defaultFont);
              FontMetrics fontMetrics = g2.getFontMetrics();
              int fontHeight = fontMetrics.getHeight();
              int fontDescent = fontMetrics.getDescent();
              double pageHeight = pageFormat.getImageableHeight() + pageFormat.getImageableY();
              double pageWidth = pageFormat.getImageableWidth();
              double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
              // Shrink or expand the table to fit the page width
              double scale = pageWidth / (tableWidth+ (cellBuffer * tableView.getColumnCount()));
              // Calculate the width in pixels for each column
              double[] columnWidths = new double[tableView.getColumnCount()];
              for(int i = 0; i < tableView.getColumnCount(); i++)
                   columnWidths[i] = (double)tableView.getColumnModel().getColumn(i).getWidth() * scale;
              // Reset the view to the start of the page
              g2.translate(0, 0);
              // Draw a rectangle to see the printable area
              g2.draw3DRect((int)pageFormat.getImageableX(),
                        (int)pageFormat.getImageableY(),
                        (int)pageFormat.getImageableWidth(),
                        (int)pageFormat.getImageableHeight(),
                        false);
              // Calculate the header height
              g2.setFont(headerFont);
              fontMetrics = g2.getFontMetrics();
              // Print the headers and retreive the starting position for the data
              int next_row = printLine(g2, pageFormat, fontMetrics, -1, (int)pageFormat.getImageableY() + fontHeight, columnWidths);
              g2.setFont(defaultFont);
              fontMetrics = g2.getFontMetrics();
              // Start printing the detail
              ArrayList page = (ArrayList)pages.get(pageIndex);
              int start = ((Integer)page.get(0)).intValue();
              int end = ((Integer)page.get(1)).intValue();
              for (int i = start; i <= end; i++)
                   next_row = printLine(g2, pageFormat, fontMetrics, i, next_row, columnWidths);
              // Print the footer
              g2.setFont(footerFont);
              String pageFooter = "Page " + (pageIndex + 1) + " - " + lastPrintDate;
              g2.drawString(pageFooter,
                             (int)pageFormat.getWidth() / 2 - (fontMetrics.stringWidth(pageFooter) / 2),
                             (int)(pageHeight - fontDescent));
              return PAGE_EXISTS;
          * We can't guarantee that the same amount of rows will be displayed on each page,
          * the row heights are dynamic and may wrap onto 2 or more lines.
          * Thus we need to calculate the height of each row and then test how may rows
          * fit on a specific page. eg. Page 1 contains rows 1 to 10, Page 2 contains rows 11 to 15 etc.
         public void calcPages(Graphics g, PageFormat pageFormat) throws PrinterException
              Graphics2D     g2 = (Graphics2D) g;
              g2.setColor(Color.black);
              // The footer will be one line at the bottom of the page, cater for this.
              g2.setFont(footerFont);
              footerHeight = g2.getFontMetrics().getHeight() + g2.getFontMetrics().getDescent();
              g2.setFont(defaultFont);
              FontMetrics fontMetrics = g2.getFontMetrics();
              int fontHeight = fontMetrics.getHeight();
              int fontDescent = fontMetrics.getDescent();
              double pageHeight = pageFormat.getImageableHeight() - fontHeight;
              double pageWidth = pageFormat.getImageableWidth();
              double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
              // Shrink or expand the table to fit the page width
              double scale = pageWidth / (tableWidth+ (cellBuffer * tableView.getColumnCount()));
              // Calculate the width in pixels for each column
              double[] columnWidths = new double[tableView.getColumnCount()];
              for(int i = 0; i < tableView.getColumnCount(); i++)
                   columnWidths[i] = (double)tableView.getColumnModel().getColumn(i).getWidth() * scale;
              // Calculate the header height
              int maxHeight = 0;
              g2.setFont(headerFont);
              fontMetrics = g2.getFontMetrics();
              for (int j = 0; j < tableView.getColumnCount(); j++)
                   String value = tableView.getColumnName(j).toString();
                   int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                   if (numLines > maxHeight)
                        maxHeight = numLines;
              headerHeight = g2.getFontMetrics().getHeight() * maxHeight;
              g2.setFont(defaultFont);
              fontMetrics = g2.getFontMetrics();
              int pageNum = 0;
              int bottom_of_page = (int)(pageFormat.getImageableHeight() + pageFormat.getImageableY()) - footerHeight;
              int prev_row = 0;
              int next_row = (int)pageFormat.getImageableY() + fontHeight + headerHeight;
              int i = 0;
              ArrayList page = new ArrayList();
              page.add(new Integer(0));
              for (i = 0; i < tableView.getRowCount(); i++)
                   maxHeight = 0;
                   for (int j = 0; j < tableView.getColumnCount(); j++)
                        String value = tableView.getValueAt(i, j).toString();
                        int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                        if (numLines > maxHeight)
                             maxHeight = numLines;
                   prev_row = next_row;
                   next_row += (fontHeight * maxHeight);
                   // If we've reached the bottom of the page then set the current page's end row
                   if (next_row > bottom_of_page)
                        page.add(new Integer(i - 1));
                        pages.add(page);
                        page = new ArrayList();
                        page.add(new Integer(i));
                        pageNum++;
                        next_row = (int)pageFormat.getImageableY()
                                       + fontHeight
                                       + ((int)pageFormat.getHeight() * pageNum)
                                       + headerHeight;
                        bottom_of_page = (int)(pageFormat.getImageableHeight()
                                            + pageFormat.getImageableY())
                                            + ((int)pageFormat.getHeight() * pageNum)
                                            - footerHeight;
                        //Include the current row on the next page, because there is no space on this page
                        i--;
              page.add(new Integer(i - 1));
              pages.add(page);
          * Print the headers or a row from the table to the graphics context
          * Return the position of the row following this one
         public int printLine(Graphics2D g2,
                                       PageFormat pageFormat,
                                       FontMetrics fontMetrics,
                                       int rowNum,
                                       int next_row,
                                       double[] columnWidths)
                   throws PrinterException
              int lead = 0;
              int maxHeight = 0;
              for (int j = 0; j < tableView.getColumnCount(); j++)
                   String value = null;
                   int align = LEFT_ALIGN;
                   if (rowNum > -1)
                        Object obj = tableView.getValueAt(rowNum, j);
                        if (obj instanceof Number)
                             align = RIGHT_ALIGN;
                        value = obj.toString();
                   else
                        align = CENTER_ALIGN;
                        value = tableView.getColumnName(j);
                   int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                   if (numLines > maxHeight)
                        maxHeight = numLines;
                   if (fontMetrics.stringWidth(value) < columnWidths[j])
                        // Single line
                        int offset = 0;
                        // Work out the offset from the start of the column to display alignment correctly
                        switch (align)
                             case RIGHT_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)); break;
                             case CENTER_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)) / 2; break;
                             default: offset = 0; break;
                        g2.drawString(value,
                                       lead + (int)(pageFormat.getImageableX() + offset),
                                       next_row);
                   else
                        for(int a = 0; a < numLines; a++)
                             //Multi-Line
                             int x = 0;
                             int width = 0;
                             for(x = 0; x < value.length(); x++)
                                  width += fontMetrics.charWidth(value.charAt(x));
                                  if (width > columnWidths[j])
                                       break;
                             int offset = 0;
                             // Work out the offset from the start of the column to display alignment correctly
                             switch (align)
                                  case RIGHT_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)); break;
                                  case CENTER_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)) / 2; break;
                                  default: offset = 0; break;
                             g2.drawString(value.substring(0, x),
                                            lead + (int)(pageFormat.getImageableX() + offset),
                                            next_row + (fontMetrics.getHeight() * a));                    
                             value = value.substring(x);
                   lead += columnWidths[j] + cellBuffer;
              // Draw a solid line below the row
              g2.draw(new Line2D.Double(pageFormat.getImageableX(),
                             next_row + (fontMetrics.getHeight() * (maxHeight - 1)) + fontMetrics.getDescent(),
                             pageFormat.getImageableY() + pageFormat.getImageableWidth(),
                             next_row + (fontMetrics.getHeight() * (maxHeight - 1)) + fontMetrics.getDescent()));
              // Return the position of the row following this one
              return next_row + (fontMetrics.getHeight() * maxHeight);
         public static void main(String[] args)
              new Report();
    }

    Fixed some bugs and added a title. Just pass in a JTable and the class will do the rest.
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.print.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import java.text.*;
    import java.math.*;
    public class PrintJTable implements Printable
         private final int LEFT_ALIGN = -1;
         private final int CENTER_ALIGN = 0;
         private final int RIGHT_ALIGN = 1;
         private JFrame m_parent;
         private String m_title;
         private JTable tableView;
         private String lastPrintDate;
         private Font defaultFont;
         private Font headerFont;
         private Font footerFont;
         private int headerHeight;
         private int footerHeight;
         private int cellBuffer = 5;
         private boolean first_pass;
         private ArrayList pages;
         public PrintJTable(JFrame parent, JTable table)
              m_parent = parent;
              tableView = table;
              doPrint();
         public PrintJTable(JFrame parent, String title, JTable table)
              m_parent = parent;
              m_title = title;
              tableView = table;
              doPrint();
          * Reset variables before printing
         private void prepareForPrint()
              pages = new ArrayList();
              first_pass = true;
          * Display a print dialog with some hardcoded defaults
          * The print fonts are also hardcoded
         public void doPrint()
              try
                   String jobName = "Java Report";
                   defaultFont = new Font("Arial", Font.PLAIN, 8);
                   footerFont = new Font("Arial", Font.PLAIN, 6);
                   headerFont = new Font("Arial", Font.BOLD, 8);
                   PrinterJob prnJob = PrinterJob.getPrinterJob();
                   prnJob.setPrintable(this);
                   PrintRequestAttributeSet prnSet = new HashPrintRequestAttributeSet();
                   prnSet.add(new Copies(1));
                   prnSet.add(new JobName(jobName, null));
                   prnSet.add(MediaSizeName.ISO_A4);
                   PageFormat pf = prnJob.defaultPage();
                   pf.setOrientation(java.awt.print.PageFormat.PORTRAIT);
                   prnJob.setJobName(jobName);
                   PrintService[] services = PrinterJob.lookupPrintServices();
                   if (services.length > 0)
                        if (prnJob.printDialog(prnSet))
                              * Get print date
                             String dateFormat = "dd/MM/yyyy HH:mm:ss";
                             DateFormat m_DateFormat = new SimpleDateFormat(dateFormat);
                             lastPrintDate = m_DateFormat.format(new Date()).toString();
                             prepareForPrint();
                             prnJob.print(prnSet);
                   else
                        JOptionPane.showMessageDialog(m_parent, "No Printer was found!!", "Printer Error", JOptionPane.ERROR_MESSAGE);
                        return;
              catch (PrinterException e)
                   e.printStackTrace();
         public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException
               * Check if this is the first time the print method is called for this print action.
               * It is not guaranteed that the print will be called with synchronous pageIndex'es,
               * so we need to calculate the number of pages and which rows appear on which pages.
               * Then the correct page will be printed regardless of which pageIndex is sent through.
              if (first_pass)
                   calcPages(g, pageFormat);
              first_pass = false;
              // Stop printing if the pageIndex is out of range
              if (pageIndex >= pages.size())
                   return NO_SUCH_PAGE;
              Graphics2D     g2 = (Graphics2D) g;
              g2.setColor(Color.black);
              // The footer will be one line at the bottom of the page, cater for this.
              g2.setFont(footerFont);
              footerHeight = g2.getFontMetrics().getHeight() + g2.getFontMetrics().getDescent();
              g2.setFont(defaultFont);
              FontMetrics fontMetrics = g2.getFontMetrics();
              int fontHeight = fontMetrics.getHeight();
              int fontDescent = fontMetrics.getDescent();
              double pageHeight = pageFormat.getImageableHeight() + pageFormat.getImageableY();
              double pageWidth = pageFormat.getImageableWidth();
              double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
              // Shrink or expand the table to fit the page width
              double scale = (pageWidth - (cellBuffer * tableView.getColumnCount())) / tableWidth;
              // Calculate the width in pixels for each column
              double[] columnWidths = new double[tableView.getColumnCount()];
              double test = 0;
              for(int i = 0; i < tableView.getColumnCount(); i++)
                   columnWidths[i] = (double)Math.floor(tableView.getColumnModel().getColumn(i).getWidth() * scale);
                   test += columnWidths;
              // Reset the view to the start of the page
              g2.translate(0, 0);
              // Draw a rectangle to see the printable area
              g2.draw3DRect((int)pageFormat.getImageableX(),
                        (int)pageFormat.getImageableY(),
                        (int)pageFormat.getImageableWidth(),
                        (int)pageFormat.getImageableHeight(),
                        false);
              // Calculate the header height
              g2.setFont(headerFont);
              fontMetrics = g2.getFontMetrics();
              // Print the headers and retreive the starting position for the data
              int next_row = (int)pageFormat.getImageableY() + fontMetrics.getHeight();
              if ((m_title != null) && (!m_title.equalsIgnoreCase("")))
                   g2.drawString(m_title,
                                       (int)(pageFormat.getImageableX()),
                                       next_row);
                   Color current_color = g2.getColor();
                   g2.setColor(Color.lightGray);
                   int y = next_row + fontMetrics.getDescent();
                   g2.draw(new Line2D.Double(pageFormat.getImageableX(),
                                  y,
                                  (pageFormat.getImageableY() + pageFormat.getImageableWidth()),
                                  y));
                   g2.setColor(current_color);
                   next_row += fontMetrics.getHeight();
              next_row = printLine(g2, pageFormat, fontMetrics, -1, next_row, columnWidths);
              g2.setFont(defaultFont);
              fontMetrics = g2.getFontMetrics();
              // Start printing the detail
              ArrayList page = (ArrayList)pages.get(pageIndex);
              int start = ((Integer)page.get(0)).intValue();
              int end = ((Integer)page.get(1)).intValue();
              for (int i = start; i <= end; i++)
                   next_row = printLine(g2, pageFormat, fontMetrics, i, next_row, columnWidths);
              // Print the footer
              g2.setFont(footerFont);
              String pageFooter = "Page " + (pageIndex + 1) + " - " + lastPrintDate;
              g2.drawString(pageFooter,
                             (int)pageFormat.getWidth() / 2 - (fontMetrics.stringWidth(pageFooter) / 2),
                             (int)(pageHeight - fontDescent));
              return PAGE_EXISTS;
         * We can't guarantee that the same amount of rows will be displayed on each page,
         * the row heights are dynamic and may wrap onto 2 or more lines.
         * Thus we need to calculate the height of each row and then test how may rows
         * fit on a specific page. eg. Page 1 contains rows 1 to 10, Page 2 contains rows 11 to 15 etc.
         public void calcPages(Graphics g, PageFormat pageFormat) throws PrinterException
              Graphics2D     g2 = (Graphics2D) g;
              g2.setColor(Color.black);
              // The footer will be one line at the bottom of the page, cater for this.
              g2.setFont(footerFont);
              footerHeight = g2.getFontMetrics().getHeight() + g2.getFontMetrics().getDescent();
              g2.setFont(defaultFont);
              FontMetrics fontMetrics = g2.getFontMetrics();
              int fontHeight = fontMetrics.getHeight();
              int fontDescent = fontMetrics.getDescent();
              double pageHeight = pageFormat.getImageableHeight() - fontHeight;
              double pageWidth = pageFormat.getImageableWidth();
              double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
              // Shrink or expand the table to fit the page width
              double scale = (pageWidth - (cellBuffer * tableView.getColumnCount())) / tableWidth;
              // Calculate the width in pixels for each column
              double[] columnWidths = new double[tableView.getColumnCount()];
              for(int i = 0; i < tableView.getColumnCount(); i++)
                   columnWidths[i] = (double)Math.floor(tableView.getColumnModel().getColumn(i).getWidth() * scale);
              // Calculate the header height
              int maxHeight = 0;
              g2.setFont(headerFont);
              fontMetrics = g2.getFontMetrics();
              headerHeight = 0;
              if ((m_title != null) && (!m_title.equalsIgnoreCase("")))
                   headerHeight = fontMetrics.getHeight();
              for (int j = 0; j < tableView.getColumnCount(); j++)
                   String value = tableView.getColumnName(j).toString();
                   int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                   if (numLines > maxHeight)
                        maxHeight = numLines;
              headerHeight += g2.getFontMetrics().getHeight() * maxHeight;
              g2.setFont(defaultFont);
              fontMetrics = g2.getFontMetrics();
              int pageNum = 0;
              int bottom_of_page = (int)(pageFormat.getImageableHeight() + pageFormat.getImageableY()) - footerHeight;
              int prev_row = 0;
              int next_row = (int)pageFormat.getImageableY() + fontHeight + headerHeight;
              int i = 0;
              ArrayList page = new ArrayList();
              page.add(new Integer(0));
              for (i = 0; i < tableView.getRowCount(); i++)
                   maxHeight = 0;
                   for (int j = 0; j < tableView.getColumnCount(); j++)
                        String value = formatObject(tableView.getValueAt(i, j));
                        int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                        if (numLines > maxHeight)
                             maxHeight = numLines;
                   prev_row = next_row;
                   next_row += (fontHeight * maxHeight);
                   // If we've reached the bottom of the page then set the current page's end row
                   if (next_row > bottom_of_page)
                        page.add(new Integer(i - 1));
                        pages.add(page);
                        page = new ArrayList();
                        page.add(new Integer(i));
                        pageNum++;
                        next_row = (int)pageFormat.getImageableY()
                                       + fontHeight
                                       + ((int)pageFormat.getHeight() * pageNum)
                                       + headerHeight;
                        bottom_of_page = (int)(pageFormat.getImageableHeight()
                                            + pageFormat.getImageableY())
                                            + ((int)pageFormat.getHeight() * pageNum)
                                            - footerHeight;
                        //Include the current row on the next page, because there is no space on this page
                        i--;
              page.add(new Integer(i - 1));
              pages.add(page);
         * Print the headers or a row from the table to the graphics context
         * Return the position of the row following this one
         public int printLine(Graphics2D g2,
                                       PageFormat pageFormat,
                                       FontMetrics fontMetrics,
                                       int rowNum,
                                       int next_row,
                                       double[] columnWidths)
                   throws PrinterException
              int lead = 0;
              int maxHeight = 0;
              for (int j = 0; j < tableView.getColumnCount(); j++)
                   String value = null;
                   int align = LEFT_ALIGN;
                   if (rowNum > -1)
                        Object obj = tableView.getValueAt(rowNum, j);
                        if (obj instanceof Number)
                             align = RIGHT_ALIGN;
                        value = formatObject(obj);
                   else
                        //align = CENTER_ALIGN;
                        value = tableView.getColumnName(j);
                   int numLines = (int)Math.ceil(fontMetrics.stringWidth(value) / columnWidths[j]);
                   if (numLines > maxHeight)
                        maxHeight = numLines;
                   if (fontMetrics.stringWidth(value) < columnWidths[j])
                        // Single line
                        int offset = 0;
                        // Work out the offset from the start of the column to display alignment correctly
                        switch (align)
                             case RIGHT_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)); break;
                             case CENTER_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value)) / 2; break;
                             default: offset = 0; break;
                        g2.drawString(value,
                                       lead + (int)(pageFormat.getImageableX() + offset),
                                       next_row);
                   else
                        for(int a = 0; a < numLines; a++)
                             //Multi-Line
                             int x = 0;
                             int width = 0;
                             for(x = 0; x < value.length(); x++)
                                  width += fontMetrics.charWidth(value.charAt(x));
                                  if (width > columnWidths[j])
                                       break;
                             int offset = 0;
                             // Work out the offset from the start of the column to display alignment correctly
                             switch (align)
                                  case RIGHT_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value.substring(0, x))); break;
                                  case CENTER_ALIGN: offset = (int)(columnWidths[j] - fontMetrics.stringWidth(value.substring(0, x))) / 2; break;
                                  default: offset = 0; break;
                             g2.drawString(value.substring(0, x),
                                            lead + (int)(pageFormat.getImageableX() + offset),
                                            next_row + (fontMetrics.getHeight() * a));                    
                             value = value.substring(x);
                   lead += columnWidths[j] + cellBuffer;
              // Draw a solid line below the row
              Color current_color = g2.getColor();
              g2.setColor(Color.lightGray);
              int y = next_row + (fontMetrics.getHeight() * (maxHeight - 1)) + fontMetrics.getDescent();
              g2.draw(new Line2D.Double(pageFormat.getImageableX(),
                             y,
                             (pageFormat.getImageableY() + pageFormat.getImageableWidth()),
                             y));
              g2.setColor(current_color);
              // Return the position of the row following this one
              return next_row + (fontMetrics.getHeight() * maxHeight);
         public String formatObject(Object obj)
              String value = (obj == null) ? "" : obj.toString();
              return value;

  • Printing problem with Graphics2D

    Hi, Ive got a problem with printing.
    I have a JPanel and it has among other things a button to print the component which is an instance of the class its in. This is a drawing in Graphics2D. here is the following code that is meant to do the printing:-
         if(e.getActionCommand().equals("print")){
              System.out.println("print pressed " + title);
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if(printJob.printDialog()){
    try { printJob.print(); }
    catch (Exception PrinterExeption) { PrinterExeption.printStackTrace();}
    public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
    if (pi >= 1) {
    System.out.println("print failed");
    return Printable.NO_SUCH_PAGE;
    Graphics2D g2 = (Graphics2D) g;
    g2.translate(pf.getImageableX(), pf.getImageableY());
    g2.setColor(Color.black);
    this.paintAll(g2);
    System.out.println("print successful");
    return Printable.PAGE_EXISTS;
    However it doesnt print and comes up with the following long message..
    java.awt.image.ImagingOpException: Unable to transform src image
    at java.awt.image.AffineTransformOp.filter(AffineTransformOp.java:263)
    at sun.java2d.pipe.DrawImage.transformImage(DrawImage.java:304)
    at sun.java2d.pipe.DrawImage.scaleBufferedImage(DrawImage.java:453)
    at sun.java2d.pipe.DrawImage.scaleImage(DrawImage.java:531)
    at sun.java2d.pipe.DrawImage.scaleImage(DrawImage.java:801)
    at sun.java2d.pipe.ValidatePipe.scaleImage(ValidatePipe.java:171)
    at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2875)
    at sun.print.PSPathGraphics.drawImageToPS(PSPathGraphics.java:998)
    at sun.print.PSPathGraphics.drawImage(PSPathGraphics.java:495)
    at sun.print.PSPathGraphics.drawImage(PSPathGraphics.java:406)
    at sun.print.PSPathGraphics.drawImage(PSPathGraphics.java:345)
    at sun.print.PSPathGraphics.drawImage(PSPathGraphics.java:288)
    at sun.print.PSPathGraphics.drawImage(PSPathGraphics.java:197)
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4781)
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)
    at javax.swing.JComponent.paint(JComponent.java:798)
    at java.awt.Component.lightweightPaint(Component.java:2382)
    at java.awt.Container.lightweightPaint(Container.java:1390)
    at java.awt.GraphicsCallback$PeerPaintCallback.run(GraphicsCallback.java:67)
    at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
    at java.awt.Component.paintAll(Component.java:2367)
    at DrawingMethods.print(DrawingMethods.java:833)
    at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1506)
    at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1078)
    at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:979)
    at DrawingMethods.actionPerformed(DrawingMethods.java:817)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:227)
    at java.awt.Component.processMouseEvent(Component.java:5093)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    I dont know how to get it to work and either does a PHD mate of mine.
    Please help
    All I need is a guarenteed way to get a Graphics2D component to print
    cheers
    pmiggy

    Um I dont know if im doing something daft but I tried this like you said
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if(printJob.printDialog()){
    try {
              PageFormat pageFormat = printJob.defaultPage();
              if (pageFormat.getOrientation() == PageFormat.PORTRAIT) {
              landscape = 0;} else {
                   landscape = 1;}
              System.out.println("THE ORIENTATION IS "+ landscape);
              printJob.print(); }
    catch (Exception PrinterExeption) { PrinterExeption.printStackTrace();}
    and it doesnt seem to work as I tried it both as landscape and portrait in the print dialog but landscape is always 0.
    cheers
    pmiggy

  • Printing problem with WindowsXP

    I've written a Java application using SDK v1.4.0 and this class works with all printers and Windows versions (95, 98, ME) on the several PCs I've tested it on except the machine running WindowsXP. Using WindowsXP, the page prints out the border around the textArea, but not the text. This problem occurs with both HPDeskJet and HPLaserJet printers connected to that PC.
    Has anyone seen a similar problem with WindowsXP? What should I change in this class, or change in the PC/printer properties, to get this print class to work with WindowsXP? All PCs tested are running Java v1.4.0.
    Russ Carroll
    (class code follows below)
    class ButtonHandlerPrint extends Frame implements ActionListener{
         public void actionPerformed(ActionEvent e){
              PageAttributes pageAttributes = new PageAttributes();
              pageAttributes.setPrintQuality(3);
              PrintJob pjob = Toolkit.getDefaultToolkit().getPrintJob(this,null,null,pageAttributes);
              if(pjob!=null){
                   Graphics pg = pjob.getGraphics();
                   if(pg!=null){
                        pg.translate(50,50);
                        textAreawinBCP.printAll(pg);
                        pg.dispose();
                   pjob.end();

    Did you find a fix for this problem? I have a similar problem with Win 2000 and JRE 1.4.0.01. My print works with Java 1.2 methods and prints fine in JRE 1.3.1 in Win 98,Me,2000, and prints fine in JRE 1.4.0.01 in Win 98 and Me but not in 2000. The problem sounds similar, but my text in a table doesn't print. I do get text printed that is in a text field.

  • Calibri font not printing - created with Acrobat XI pro 11.0.4 in Word 2007

    Hi, we recently upgraded to Adobe Acrobat XI pro (11.0.4) and when we create a PDF in Word using the Calibri fonts, it doesn't print when using Adobe Reader X.
    Prints ok when using Quark or other software, just not working with Office.

    Thanks for your answer.
    We are in a controlled office environment and unfortunately we cannot receive updates due to company policies. We have to wait until they do another "package" with an upgraded version.
    It's printing ok with Adobe Reader XI, but not Reader X (which is our actual default Reader). And again they cannot install Reader XI to all (only me since I'm a graphic designer, I have admin rights). We tried on other printers, not working too. Font is embeded too. It's working when using another PDF maker (like we have PDF X Change, it's working). Was working also with our previous Acrobat X Pro.

  • Printing issue with Electronic Signatures

    In the footer of my document, i place document properties and also use the captioning feature for tables and figures. I have saved it in native 2010 format not in a compatability mode.
    When I print my document (paper or PDF) these fields print properly.
    After I electronically sign the document and look at the document on the screen, the fields and caption numbers (Table 1-1: Intended Audience) appear correctly. When I print to PDF or paper, the numbers disappear (Table 1-: Intended Audience) and they
    also disappear from the screen.
    When I close the document and reopen it, the fields are correct. It only changes after the document prints.
    Using Microsoft Office Professional Plus 2010 Version 14.0.6023.1000 (32-bit).
    (--merging--)
    The original document was a 2007 document opened/stored in the 2010 format.
    Reproduced with new 2010 document simply by creating two properties:
    Template Version - Test - Value 1.0
    Template Date - Date - Value 1/25/2012
    And doing the following:
    Using the default Normal template with calibri as the font
    Added a heading level 1 to the document
    Added a 2x2 table with Insert Caption including the chapter number based on heading 1 below the table
    Added the template version and template date as two lines on the page
    Inserted a signature line
    Created a footer with the template version, page number aligned center (via tab), template date alighted right (via tab)
    Printed without signing and all data was present (Table 0-1: Test)
    Signed the document and printed. The following was missing:
    The template date in the footer.
    The table label was Table 0-: Test
    The template date was present in the middle of the document

    Hi,
    Is this problem only affect Word program with Electronic Signatures?
    Please try to test Printing with different printer drivers.
    If the Word printing problem occurs only when you print documents with a certain font or a certain type of graphics image, try to print to another printer.
    If no other printer is available, contact the manufacturer to find out whether there is an updated version of the driver or a different driver that works with your printer model.
    You may also follow other methods in this KB article troubleshoot print issue in word:
    http://support.microsoft.com/kb/826845
    Best regards.
    William Zhou
    TechNet Community Support

  • Pages 09 not printing graphics since updating to snow leopard

    I've updated to 10.6.2 but I am unable to print templates with graphics to my Xerox 6520 DP printer. Reloaded the drivers but still not working. Will go ck with Xerox to see if they are issuing a new release driver or not. I tried opening a template within Pages and I get the same result of "error printing" no number along with it. Tried doing a save as PDf and get the same printing error. Anyone have any ideas?

    Repair permission is something I do after a major installation. Do that.
    Are you able to print from other applications, i.e. TextEdit?
    If not, can you print from another account? You can create a new account from Accounts in the System preferences.
    It might be the driver that needs an update but that is outside my knowledge.

  • Printing graphics from InDesign CS2 to an HP 4000 PS Laserjet

    My HP 4000 Laserjet will not print InDesign CS2 documents that have pictures, other graphics, or objects created in InDesign with either a drop shadow or feathered.
    I have an HP Laserjet 4000 which I previously used with Pagemaker 6.5. I could set the screen lpi and angle values for exactly as it needed to be using the Acrobat Distiller PPD and print documents (with pictures and graphics) to the post script printer with no problem. Now I am using Adobe InDesign CS2 and I don't seem to have same the printing options and control that I had with Pagemaker. But mainly, in Pagemaker, when I printed a document I could select the HP 4000 PS printer in the Print Document box and it listed Acrobat Distiller in the PPD box which is what I used.
    Now with InDesign CS2, when I select the HP 4000 PS printer it only shows the HP 4000 PS series ppd (and this may be correct). Although I can still set the values for screening (lpi) and screen angles and screened objects that are created in InDesign will print to whatever screen values I selected, the document will not print when pictures and other graphics are placed into the document or if an object created in InDesign has a drop shadow or is feathered. When I remove the graphics and drop shadow, it will print, however, another problem is that it will not print certain fonts properly (leaving out certain letters in certain words - for instance the "l" in "floor".)
    Is this a compatibility issue between this older Laserjet and InDesign -- is there another driver that I need -- or am I overlooking something that's obvious? I'd appreciate someone's help who may know what the problem is so I won't be doing the trial and error thing.
    Thanks,
    Cliff Stone

    Thanks everyone for their input. As far as the memory shortage, I'm pretty sure that's not the problem. I can create a document in Pagemaker of only 200KB that prints fine and the convert the same document to ID and it fails to print.
    I think Dov is right about the 4000 because I remember when the printer was new, there were some incompatibility issues with Pagemaker that I had to work around. The Adobe people told me back then that Pagemaker and HP postscript printers didn't get along very well.
    I'll check with HP again (I've already written to them twice with no response) and see if the firmware upgrade Dov mentioned is still available, however, even though this 4000 has been very durable and a real workhorse for me, it may be time to put it out to pasture and invest in a new Postscript laserjet.
    Any recommendations?
    Thanks again for everyone's help.

  • I have a graphic with a hyperlink in an Outlook email. When I open on it on my iPhone I get the option to email, save, tweet, FB, etc. The text hyerlinks in the email open properly.  Can anyone help?

    I am sending an email from Outlook.  It has a graphic with a hyperlink and it has text with hyperlinks.  When I open the email on my iphone, the text hyperlinks open properly.  The graphic hyperlink gives the options to email, tweet, FB, print, copy, etc.  Can anyone help me correct this so that the graphic links opens in the website it's linked to?  Thank you.

    Try checking the hyperlink for the image in MS Outlook.
    Select image in signature, then click "Insert Hyperlink" image to the far right of Edit signature toolbar.
    Click "Target Frame" button.
    Select "New Window", then "OK".
    After doing this, it solved my problem.

  • Printing graphics - URGENT!

    Hi all,
    I am trying to send a Java2D graphics to a printer. I am reading the file name from JFileChooser. Here is my code:
         if(jfc.getFileFilter().getDescription() == psFileFilterDescription){
              File psfile=new File(jfc.getCurrentDirectory(),jfc.getSelectedFile().getName() + ".ps");
              FileOutputStream out = new FileOutputStream(psfile);
              int w=getSize().width;
              int h=getSize().height;
              System.out.print("Writing PS File "+psfile+"\nw:"+w+" h:"+h);
              BufferedImage mImage=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
              Graphics2D gBuff=mImage.createGraphics();
              paint(gBuff);
         sendToPrinter(mImage);
    private void sendToPrinter(BufferedImage bImage){
    PrinterJob pj = PrinterJob.getPrinterJob();
    // show the print dialog and conditionally proceed
    // with printing if the dialog returns true
    if (pj.printDialog()) {
    // get the default page format
    PageFormat pf = pj.defaultPage();
    // show the page configuration dialog
    // note - this doesn't work in Solaris/JDK1.2beta4
    pj.pageDialog(pf);
    // create a book
    Book b = new Book();
    b.append((Printable)bImage, pf);//How can I convert a BufferedImage to support Printable interface
    // arrange for this book to be the source for our printer job
    pj.setPageable(b);
    // actually invoke the printing
    try {
    pj.print();
    catch (PrinterException ex) {
    ex.printStackTrace(System.err);
    // provide a print method for this component. This implements
    // the Printable interface,
    public int print(Graphics g, PageFormat form, int page) {
    // check for a Graphics2D and apply the page orientation and
    // printable area transforms to it
    if(page == 0) {
    if (g instanceof Graphics2D) {
    AffineTransform tr = new AffineTransform(form.getMatrix());
    tr.translate(form.getImageableX(), form.getImageableY());
    ((Graphics2D)g).transform(tr);
    super.paint(g);
    return PAGE_EXISTS;
    else
    return NO_SUCH_PAGE;
    Does anyone have any ideas on what I should do here?
    Thanks,
    Payam.

    i have a problem with this code.
    public void actionPerformed(ActionEvent e)
              if(e.getSource()==openItem)
                   JFileChooser chooser = new JFileChooser();
                   chooser.setCurrentDirectory(new File("."));
                   chooser.setFilefilter(new javax.swing.filechooser.FileFilter()
                   { public boolean accept(File f)
                        String name = f.getName().toLowerCase();
                        return name.endsWith(".gif")
                        ||name.endsWith(".jpg")
                        ||name.endsWith(".png")
                        ||f.isDirectory();
                   public String getDescription()
                        return "Image files";
              int r = chooser.showOpenDialog(this);
              if(r==JFileChooser.APPROVE_OPTION)
                   String name =chooser.getSelectedFile().getAbsolutePath();
                   panel.loadImage(name);
    all variables used have been allocated memory.

  • Print jTable with a header and footer panel

    Hi Folks,
    I'm currently at a sticking point in a project I'm playing around with. I have a data set of around 300 objects that i'd like printed out in a table. Now, I've gotten the display part down without a hitch but printing the data as well as a header panel and footer panel has been eluding me. I'd basically like something like this...
    Name: some name Order date: some date
    Address: some address Shipped To: some address
    somewhere Some city, some state, etc
    in some city
    Date | Title | Etc | Etc | Etc
    date1 title1 5 $3.00 $15.00
    date1 title1 5 $3.00 $15.00
    date2 title1 5 $3.00 $15.00
    date2 title1 5 $3.00 $15.00
    Total purchases: $60.00
    Total Items: 20
    # of Orders: 2
    Am I barking up the wrong tree by making the first and third sections panels and the second section a table? If not, how the heck do I accomplish this? Most of the time the table has been multiple pages as well - I only need section one on the first page and section three on the last page, but whatever is easiest really.
    My current approach has been basically to make a custom printables, print the first section, figure out how high it was, print the second section and hope for the best, but the third would never show up because it'd never go over two pages.
    Any help would be very much appreciated.
    Thanks,
    Stephen
    Edited by: stephenliberty on May 7, 2009 9:11 AM - more specific subject

    I suppose as a quick update, this is as far as I've gotten and will likely get-
    public class PrintForm extends JFrame implements Printable{
        JComponent headerPanelForPrint;
        JComponent footerPanelForPrint;
        JTable dataTableForPrint;
        public void setPieces(JComponent header, JTable table, JComponent footer){
            this.headerPanelForPrint = header;
            this.footerPanelForPrint = footer;
            this.dataTableForPrint = table;
        public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
            graphics.translate((int)pageFormat.getImageableX(), (int)pageFormat.getImageableY());
            TableFormat tableFormat;
            if(pageIndex>0){
                tableFormat = new TableFormat(0, footerPanelForPrint.getHeight());
            } else {
                headerPanelForPrint.printAll(graphics);
                tableFormat = new TableFormat(headerPanelForPrint.getHeight(), footerPanelForPrint.getHeight());
            MessageFormat footer = new MessageFormat("Page - {0}");
            Printable table = dataTableForPrint.getPrintable(PrintMode.FIT_WIDTH, null, footer);
            int printme = table.print(graphics, tableFormat, pageIndex);
            if(printme == table.NO_SUCH_PAGE){ return table.NO_SUCH_PAGE; }
            return Printable.PAGE_EXISTS;
    class TableFormat extends PageFormat {
        double footerHeight;
        double headerHeight;
        public TableFormat(double headerHeight, double footerHeight){
            this.headerHeight = headerHeight;
            this.footerHeight = footerHeight;
        @Override
        public double getImageableHeight() {
            return super.getImageableHeight() - ( this.footerHeight + this.headerHeight );
        @Override
        public double getHeight() {
            return super.getImageableHeight() - ( this.footerHeight + this.headerHeight);
        @Override
        public double getImageableX() {
            return 0;
        @Override
        public double getImageableY() {
            return this.headerHeight;
    }It works very well with just a header and the table, but I still have not been able to get a footer to show up in the appropriate spot or (preferably) on the last page.
    Edited by: stephenliberty on May 8, 2009 12:29 PM

  • K550 won't print graphics - Help!

    Working great till one day suddenly stopped printing graphics.  Prints text copy fine.  Photos, clip art, etc missing from print.  Ran Diagnostics - okay; ran Configuration page - okay.   Laptop prints fine when connected to another printer,  which eliminated a 'computer' issue; definately a printer setting problem.   Help!!  I'm out of warranty :-(

    As near as I can tell, the printer is not the problem. I have tried three different printers, all with the most up-to-date drivers, and even tried Adobe Acrobat 9 Pro, which should bypass all of the above. The graphic elements that worked perfectly in my previous system simply disappear in Snow Leopard. My workaround is to send them to an "older" Mac NOT running Snow Leopard, then convert them to PDF files, then print from Snow Leopard, and all is well. Absolutely frosted! I have publishing deadlines to meet!

Maybe you are looking for

  • Material ledger activation

    Hello experts, In material master i wqnt to set price determination as 2. when I go to MM02 in costing tab it doesn't allow me to set price determination as 2. For this particular material Material ledger is deactivated. Howver for other materials in

  • How to turn multiple tracks into one element for changing scale

    I've created an image out of a number of video tracks in my motion timeline. When I try to change the scale of all the parts, they change but remain the same distance apart so the pieces break apart in my viewer. I've tried making a clone and this so

  • Help in lock

    Plz do help me how can i lock my 8530 without using a password? I need 2have it in my home screen coz I'm careless so I nid diz phone 2be lock 24/7. Having a password when I'm home is 222tiring. Thanks a lot Tmobile 8530

  • Mac installing flash player, Flash quits unexpectedly when opened after download.

    Can anyone help me with this?  Flash has been in use on my mac for a long time, but when I updated to 11 version it never worked right, and kept using older version to play games etc.. and I updated to flash 12, the flash program quits unexpectedly w

  • Avi & error -50

    What does error "-50" mean? In layman's terms, that is. I see that it has something to do with a user parameter list, but I don't know what that means. My problem is in trying to open an "avi" file. The file's icon is clearly visible: it's the regula