1

How can i print Ms Office documents using Apache POI ?Can u provide me an example?

Danilo Piazzalunga
  • 7,590
  • 5
  • 49
  • 75
Harinder
  • 11,776
  • 16
  • 70
  • 126

2 Answers2

5

You can't. POI is a text extraction/load/save/manipulator of data. It isn't designed for rendering a graphical rendition, and hence cannot print.

MJB
  • 9,352
  • 6
  • 34
  • 49
2

Does it have to be Apache POI? Can you use Apache FOP instead.

Piyush Mattoo
  • 15,454
  • 6
  • 47
  • 56
  • can you provide me any example? – Harinder Jun 10 '11 at 05:42
  • docx4j uses fop to print docx, so see that for an example. you'd have considerable work to do to achieve the same for pptx and xlsx however. If Microsoft Office is not installed, you might consider using LibreOffice. – JasonPlutext Jun 10 '11 at 23:33