Print a PDFTag(s): IO Open Source

[Windows only]
You can launch the Acrobat Reader to print a PDF to the default printer.

More infos the "unsupported" command-line switches for the Acrobat reader : (page 27).


public class PdfUtils {
  static final String WIN_COMSPEC = System.getenv("comspec");
  static final String WIN_ACROBAT = "acrord32.exe";
  public static void print(String pdf) throws IOException
    String[] commands =
     pdf };


  public static void main(String[] args) throws IOException {
Unfortunately, Acrobat Reader stays opened (but minimized because of the /h switch) after the printing operation :-(

You can use a special wrapper to force the closing the Acrobat Reader after the print operation. See (acrowrap.exe).

blog comments powered by Disqus