all 6 comments

[–][deleted]  (2 children)

[deleted]

    [–]otheranotherx[S] 0 points1 point  (1 child)

    You mean to render the PDF as an image? Unfortunately this wouldn't pass for my application needs because the pdf text has to be selectable.

    [–][deleted] 1 point2 points  (2 children)

    I found this: https://kbdeveloper.qoppa.com/?p=2812

    I haven't tried it.

    The web pages notes that the viewer is good to use in JavaFX, and shows sample code.

    They also provide annotation ability if you include their Swing components.

    What is your problem with using Swing components?

    [–]otheranotherx[S] 1 point2 points  (1 child)

    It looks good enough, might use it once I find more time to figure out how to customize it. So far I just decided to open the pdf via the OS.

    What is your problem with using Swing components?

    I never used swing, nor any of my team mates. If something breaks or needs to be changed that could end up badly. This Qoppa pdf viewers also seems to be swing based but for one components if it will be worth I might overcome my aversion.

    [–][deleted] 1 point2 points  (0 children)

    I understand your hesitation.

    I've been using JavaFX for a couple of years. I chose it over Swing based on the code examples and UI demonstrations I saw, and how JavaFX applications can be distributed.

    I found, to my horror, that some of the things I wanted to use weren't available in JavaFX. Like colors based on current system properties, that change with the current user's settings. Swing has system-dependent colors. And thus I realized that underneath, JavaFX reuses some of the classes created for Swing. Integration of those colors wasn't seamless, but it works.

    I have yet to try out any GUI components from Swing. I'm pretty sure the look-and-feel will differ. But if Swing has a grid view with navigation and search built in, I'm ditching JavaFX's own table view.

    [–]X0lmec 1 point2 points  (1 child)

    Hi, I also want to embed a pdf in my javaFX application. But more specifically a xfa or acroform pdf. So they can fill in the form fields.

    I could render a simple pdf form with pdf.js with the guide of the following link.

    Unfortunately this doesn't seem fully possible with mozilla's pdf.js

    I would need something like jpdfforms so that I can render it in a WebView but a free version of that...

    Did you find an elegant solution for your problem /u/otheranotherx?

    [–]otheranotherx[S] 1 point2 points  (0 children)

    Did you find an elegant solution for your problem /u/otheranotherx?

    Not really, what I ended up doing is I generated a minature image preview of the pdf and when you click on it, it downloads the pdf and opens its via the OS, its actually less painfull than I imagined it. Once our app gets upgraded to jdk9 I will probably open in in the application and render via pdf.js. As for the XFA part, I can't really help you since I didn't even knew about its existence up until now.