开发者

Creating online help in Java Swing application - using pdf user docs

I am trying to link some user docs to my Java Swing application. The user docs are pdf and I would like to be able to click on a button in my application which opens up some sort of pdf renderer to display my userdoc.pdf.

I do not want to use the runtime exec command

I have tried the following with not much success --

pdfRenderer -- this seems to not work for the current version of pdfs (seems to want older pdfs)

acrobat viewer -- I keep getting font errors (the document is displayed but everytime I go to a new page, I get an error)

JPedal pdfHelp - This sounds cool and if it will work, it would be the best for me. But for some reason, I am unable to open any file here. No pdf file that I have loads in th开发者_如何转开发e window (The pdfHelp panel comes up with a list of pdfs as promised, but when I right click one of them and say "OpenPDF", I just get a progress bar and the file does not load, I have tried a few files on this and checked file permissions)

JPedal SimpleViewer -- So far this one seems to be the most promising. I would like to remove some of the functionality of this viewer though and am not able to edit the xml to do this. When I edit the xml, then I seem to get xml parsing errors.

Has anybody done anything similar that worked? Help please

PS. I need this to work on Linux machines (IcePDF seems to works only for Windows). I would very much prefer something that is free!


Would Java's Desktop API meet your requirements? It does launch another process, but it's not through you calling Runtime.exec().

The Desktop API uses your host operating system's file associations to launch applications associated with specific file types.


Update: pdfHelp from IDR solutions (creators of JPedal) works now. The latest version (4.0) has fixed the bug and it reads my pdf files (and I am sure more of the latest pdf files). Just playing around with the product today and it is great! There are few minor bugs but I really appreciate how quickly Mark Stephens(?) responded to the first bug. Good work guys!


I chose pdfbox for a similar use case - it's not perfect with every PDF, but works pretty well and is under active development. From the PDDocument you can get a list of PDPage objects, which have a convertToImage() method that gives you a BufferedImage you can draw on screen. I switched to this from pdf-renderer because I felt it gave better results in general.


PdfHelp has moved to its own domain at http://www.pdfhelp.org and have been updated to fix your issues and add some other improvements...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜