0 Replies Latest reply on Apr 8, 2008 2:43 PM by 807591

    javax print :  printing a text file

      Hello all,
      I want to print a text file using Java Print Service. This is the code I use :
      PrintService printService = PrintServiceLookup.lookupDefaultPrintService();
      DocPrintJob job = printService.createPrintJob();
      FileInputStream fin = new FileInputStream("C:/tmp/printTests/outputsettings.xml");
      DocAttributeSet attributes = new HashDocAttributeSet();
      Doc doc = new SimpleDoc(fin, DocFlavor.INPUT_STREAM.AUTOSENSE, attributes);
      PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
      pras.add(new Copies(1));
      job.print(doc, pras);
      I would like to customize the output : change the used font (or just font size), and moreover cut the lines larger than the print media size to print the entire document on the sheet. How can I do that ?

      Thanks in advance.