I am working on a JavaFX desktop project in which I have to upload the documents of an individual on the server. In order to view the document, I do not want to first download the PDF file to client machine and then view the PDF file. Is there any way I can view the PDF file without downloading it just like how it opens in the browser.
Asked
Active
Viewed 235 times
0
-
2No, that is impossible. Even in the browser, you are still downloading the file; it's just done in the background to a temporary folder. – Zephyr Feb 08 '19 at 21:12
-
Maybe this article can help you: [https://stackoverflow.com/questions/45062293/javafx-display-pdf-in-webview](https://stackoverflow.com/questions/45062293/javafx-display-pdf-in-webview) – flaxel Feb 08 '19 at 21:14
-
@flaxel - That won't work with an FTP server. You cannot open files directly from an FTP server. It's called File **Transfer** Protocol for a reason :) – Zephyr Feb 08 '19 at 21:24
-
As you _must_ transfer the file to view its contents, use `File.createTempFile()` and `deleteOnExit()` to avoid clutter. – trashgod Feb 09 '19 at 08:46