Class Executable

java.lang.Object
com.lowagie.tools.Executable

public class Executable extends Object
This class enables you to call an executable that will show a PDF file.
  • Field Details

    • acroread

      private static String acroread
      The path to Acrobat Reader.
  • Constructor Details

    • Executable

      public Executable()
  • Method Details

    • action

      private static Process action(String fileName, String parameters, boolean waitForTermination) throws IOException
      Performs an action on a PDF document.
      Parameters:
      fileName -
      parameters -
      waitForTermination -
      Returns:
      a process
      Throws:
      IOException
    • createCommand

      private static String[] createCommand(String... arguments)
      Creates a command string array from the string arguments.
      Parameters:
      arguments -
      Returns:
      String[] of commands
    • openDocument

      public static Process openDocument(String fileName, boolean waitForTermination) throws IOException
      Opens a PDF document.
      Parameters:
      fileName - the name of the file to open
      waitForTermination - true to wait for termination, false otherwise
      Returns:
      a process
      Throws:
      IOException - on error
    • openDocument

      public static Process openDocument(File file, boolean waitForTermination) throws IOException
      Opens a PDF document.
      Parameters:
      file - the file to open
      waitForTermination - true to wait for termination, false otherwise
      Returns:
      a process
      Throws:
      IOException - on error
    • openDocument

      public static Process openDocument(String fileName) throws IOException
      Opens a PDF document.
      Parameters:
      fileName - the name of the file to open
      Returns:
      a process
      Throws:
      IOException - on error
    • openDocument

      public static Process openDocument(File file) throws IOException
      Opens a PDF document.
      Parameters:
      file - the file to open
      Returns:
      a process
      Throws:
      IOException - on error
    • printDocument

      public static Process printDocument(String fileName, boolean waitForTermination) throws IOException
      Prints a PDF document.
      Parameters:
      fileName - the name of the file to print
      waitForTermination - true to wait for termination, false otherwise
      Returns:
      a process
      Throws:
      IOException - on error
    • printDocument

      public static Process printDocument(File file, boolean waitForTermination) throws IOException
      Prints a PDF document.
      Parameters:
      file - the File to print
      waitForTermination - true to wait for termination, false otherwise
      Returns:
      a process
      Throws:
      IOException - on error
    • printDocument

      public static Process printDocument(String fileName) throws IOException
      Prints a PDF document.
      Parameters:
      fileName - the name of the file to print
      Returns:
      a process
      Throws:
      IOException - on error
    • printDocument

      public static Process printDocument(File file) throws IOException
      Prints a PDF document.
      Parameters:
      file - the File to print
      Returns:
      a process
      Throws:
      IOException - on error
    • printDocumentSilent

      public static Process printDocumentSilent(String fileName, boolean waitForTermination) throws IOException
      Prints a PDF document without opening a Dialog box.
      Parameters:
      fileName - the name of the file to print
      waitForTermination - true to wait for termination, false otherwise
      Returns:
      a process
      Throws:
      IOException - on error
    • printDocumentSilent

      public static Process printDocumentSilent(File file, boolean waitForTermination) throws IOException
      Prints a PDF document without opening a Dialog box.
      Parameters:
      file - the File to print
      waitForTermination - true to wait for termination, false otherwise
      Returns:
      a process
      Throws:
      IOException - on error
    • printDocumentSilent

      public static Process printDocumentSilent(String fileName) throws IOException
      Prints a PDF document without opening a Dialog box.
      Parameters:
      fileName - the name of the file to print
      Returns:
      a process
      Throws:
      IOException - on error
    • printDocumentSilent

      public static Process printDocumentSilent(File file) throws IOException
      Prints a PDF document without opening a Dialog box.
      Parameters:
      file - the File to print
      Returns:
      a process
      Throws:
      IOException - on error
    • launchBrowser

      public static void launchBrowser(String url) throws IOException
      Launches a browser opening an URL.
      Parameters:
      url - the URL you want to open in the browser
      Throws:
      IOException - on error
    • isWindows

      public static boolean isWindows()
      Checks the Operating System.
      Returns:
      true if the current os is Windows
    • isWindows9X

      public static boolean isWindows9X()
      Checks the Operating System.
      Returns:
      true if the current os is Windows
    • isMac

      public static boolean isMac()
      Checks the Operating System.
      Returns:
      true if the current os is Apple
    • isLinux

      public static boolean isLinux()
      Checks the Operating System.
      Returns:
      true if the current os is Linux