Created
March 15, 2012 18:35
-
-
Save jamesmorgan/2045900 to your computer and use it in GitHub Desktop.
How to manually print through Adobe Reader on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AdobeReaderPrinting { | |
public static void main(final String[] args) { | |
final File file = new File("src/test/resources/tests/Sample_Printing.pdf"); | |
final Runtime r = Runtime.getRuntime(); | |
Process p = null; | |
try { | |
// Information about command line printing flags can be foud at http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat10_SDK_HTMLHelp&file=DevFAQ_UnderstandingSDK.22.31.html | |
final String printing = | |
"C:\\Program Files (x86)\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe /s /h /t " + file.getCanonicalPath() | |
+ " \"\\\\My_Remote_Or_Locally_Installed_Printer\""; | |
p = r.exec(printing); | |
} | |
catch (final Exception e) { | |
System.out.println("Exception thrown: " + e.getMessage()); | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment