Creating online help in a Java Swing application - using user pdfs

I am trying to associate some user documents with my Java Swing application. User documents are pdf, and I would like to be able to click on a button in my application that opens some kind of PDF rendering to display my userdoc.pdf.

I do not want to use the runtime exec command

I tried the following with little success -

pdfRenderer - this does not seem to work for the current version of pdf files (it seems old pdf files are needed)

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

JPedal pdfHelp - Sounds great, and if it works, it will be better for me. But for some reason I cannot open any file here. There is no PDF file that I load in the window (the pdfHelp panel contains a list of pdf files, as promised, but when I click one of them and say "OpenPDF", I just get a progress bar and the file does not load, I tried several files on this and checked file permissions)

JPedal SimpleViewer - While this seems like the most promising. I would like to remove some functions of this viewer, although I can not edit xml for this. When I edit xml, I seem to get XML parsing errors.

Has anyone done something like this that worked? help me please

PS. I need this to work on Linux machines (IcePDF seems to work only for Windows). I would really prefer something free!

+4
source share
4 answers

Update: pdfHelp from IDR solutions (creators of JPedal) is working now. The latest version (4.0) fixed the error and it reads my pdf files (and I'm sure more of the latest PDF files). Just play with the product today and it's great! There are a few minor errors, but I really appreciate how quickly Mark Stevens (?) Answered the first error. Good guys!

+1
source

Will the Java Desktop API meet your requirements? It starts another process, but not through a call to Runtime.exec ().

The Desktop API uses host operating system file associations to run applications associated with specific file types.

+2
source

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

0
source

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

-one
source

Source: https://habr.com/ru/post/1299457/


All Articles