2005 IR Help Posted August 26, 2006 Share Posted August 26, 2006 By: Jorge - jorarcia autoprint pdf report 2004-05-10 03:00 I don't know if it's possible, but I want to redirect the pdf to the printer. Anybody know's how? Thanks in advice. By: akmal Sarhan - akmal88 RE: autoprint pdf report 2004-05-10 08:47 this might be what you are looking for: public void print() throws UnsupportedFormatException { save("./tmp.pdf"); try { String osName = System.getProperty("os.name"); //FOR WINDOWS 95 AND 98 USE COMMAND.COM if (osName.equals("Windows 95") || osName.equals("Windows 98")) { Runtime.getRuntime().exec("command.com /C start acrord32 /p " + "./tmp.pdf"); } //FOR WINDOWS NT/XP/2000 USE CMD.EXE else { Runtime.getRuntime().exec("cmd.exe /C Start acrord32 /p " + "./tmp.pdf"); } } catch (IOException IOE) { JOptionPane.showMessageDialog(null, IOE.getMessage(), "RuntimeException", JOptionPane.ERROR_MESSAGE); } } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now