0

I need to create a java desktop application, the goal is to display documents(doc,xls,pdf) with free libraries.

I only could display *.ods documents with jOpenDocument and that's all that i got by the moment.

I was viewing pdfbox library, but i cannot find a single exemple anywhere to display the pdf inside a java application.

Can you help me please?

Marcelo
  • 11
  • 2
  • See also this answer https://stackoverflow.com/questions/23326562/apache-pdfbox-convert-pdf-to-images and/or look at the source code for PDFReader – Tilman Hausherr Mar 24 '15 at 10:54
  • I see your question was put on hold (I didn't complain). I suggest you try the link I posted and the answer that already exist, write some code, then delete your question and write a new one that deals with whatever is still unclear. Leave out doc, ods and xls from the question, it isn't relevant for the PDF question. – Tilman Hausherr Mar 24 '15 at 14:16

1 Answers1

2

One approach would be to add your application's components to an org.apache.pdfbox.PDFReader, which extends JFrame without modifying the default layout manager, BorderLayout. As shown in initComponents(), BorderLayout.CENTER and BorderLayout.SOUTH are occupied by the document and status panel, respectively, but you can add your application's containers to the remaining layout regions.

Alternatively, adapt the components and actions shown in initComponents() to your own application.

trashgod
  • 196,350
  • 25
  • 213
  • 918