New Forum | Previous | Next | (P-PDF) Developers
Topic: Java PDF Printing/Viewing on Windows, 1 Attachments
Conf: (P-PDF) Developers, Msg: 98958
Date: 10/23/2003 05:05 AM
An example of viewing/printing PDF or other file types from Java on Windows.
Uses Windows ShellExecute function, with "print", "printto" or "open" verbs. ShellExecute will associate file with its viewer using the file's extension.
Viewers (Adobe Reader, Word, Excel, etc.) must be installed for this to work.
Extract ShellExec.dll from the attached jar to the current directory, then test with:
java -cp ShellExec.jar Test mypdf.pdf
Which will open "mypdf.pdf" in Adobe Reader. Change Test.java to "print" or "printto" to test printing.