Reputation: 75
Is it possible to open or create a PDF file in a Java desktop application just like we can create text file?
From my search I got that it is possible only with web java. Is that true?
Upvotes: 3
Views: 4267
Reputation: 3184
There is an OS PDF plugin for Netbeans at http://www.jpedal.org/support_siNetBeans.php
Upvotes: 1
Reputation: 37566
You can not create PDF just like a normal Text file, you will need PDF Library to create one. Opening an existing PDF is possible like *a_horse_with_no_name* mentioned in his answer.
You can find some PDF Libraries here.
Upvotes: 0
Reputation:
To open an existing PDF file in the desktop default reader you can use the following code:
File pdf = new File("/path/to/your.pdf"); Desktop.getDesktop().open(pdf);
(needs Java 6)
Upvotes: 5