Class TestPrint

Sets up to easily print HTML documents. It is not necessary to call any of the setter * methods as they all have default values, they are provided should you wish to change * any of the default values.

Synopsis

 public class TestPrint {
  public static int DEFAULT_DPI ;
  public static float DEFAULT_PAGE_WIDTH_INCH ;
  public static float DEFAULT_PAGE_HEIGHT_INCH ;
  public TestPrint();
  public void setGraphicsConfiguration(GraphicsConfiguration gc);
  public void setServices(javax.print.PrintService[] services);
  public void setDefaultService(PrintService service);
  public void setDocFlavor(DocFlavor flavor);
  public void setPrintRequestAttributes(PrintRequestAttributeSet attributes);
  public void setPrintDialogLocation(int x,
                                     int y);

  public void addPrintJobListener(PrintJobListener pjl);
  public void removePrintJobListener(PrintJobListener pjl);
  public void addPrintServiceAttributeListener(PrintServiceAttributeListener psal);
  public void removePrintServiceAttributeListener(PrintServiceAttributeListener psal);
  public boolean printJEditorPane(JEditorPane jep,
                                  PrintService ps);

  public boolean printDocument(Doc doc,
                               PrintService ps)
    throws PrintException;

  public PrintService showPrintDialog();
}

Methods inherited from java.lang.Object: clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait

Inheritance Path. java.lang.Object-> practicaltest.TestPrint

printDocument(Doc, PrintService)

Synopsis: public boolean printDocument(javax.print.Doc doc, 
                                       javax.print.PrintService ps) 
              throws javax.print.PrintException;

Parameters

return

false if no PrintService is selected in the dialog, true otherwise

Print the document to the specified PrintService. * This method cannot tell if the printing was successful. You must register a PrintJobListener

setGraphicsConfiguration(GraphicsConfiguration)

Synopsis: public void setGraphicsConfiguration(java.awt.GraphicsConfigurati\
on gc);

Set the GraphicsConfiguration to display the print dialog on. * * @param gc a GraphicsConfiguration object