0

How do i print an ODF file using the java print api framework? i can't seem to find any info on printing odf file using the java print api.

java accept postscript and convert it into doc for printing.

  FileInputStream fis = new FileInputStream("example.ps");
                        Doc doc = new SimpleDoc(fis, psFlavor, null);
                        pj.print(doc, aset);

how do i do the same for ODF file?

  • Is javax.print.* a firm requirement. Maybe you could try `Desktop.getDesktop().print(new File("example.odf"));` instead? Also there is https://wiki.openoffice.org/wiki/API/Samples/Java/Office/DocumentHandling#DocumentPrinter which gives example for OpenOffice type files. – demongolem Apr 15 '14 at 17:15
  • @demongolem thanks for your response, i change to system to print pdf instead of ODF file. – user2829721 May 09 '14 at 01:09

0 Answers0