Package com.lowagie.tools
Class Executable
java.lang.Object
com.lowagie.tools.Executable
This class enables you to call an executable that will show a PDF file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Process
Performs an action on a PDF document.private static String[]
createCommand
(String... arguments) Creates a command string array from the string arguments.static boolean
isLinux()
Checks the Operating System.static boolean
isMac()
Checks the Operating System.static boolean
Checks the Operating System.static boolean
Checks the Operating System.static void
launchBrowser
(String url) Launches a browser opening an URL.static Process
openDocument
(File file) Opens a PDF document.static Process
openDocument
(File file, boolean waitForTermination) Opens a PDF document.static Process
openDocument
(String fileName) Opens a PDF document.static Process
openDocument
(String fileName, boolean waitForTermination) Opens a PDF document.static Process
printDocument
(File file) Prints a PDF document.static Process
printDocument
(File file, boolean waitForTermination) Prints a PDF document.static Process
printDocument
(String fileName) Prints a PDF document.static Process
printDocument
(String fileName, boolean waitForTermination) Prints a PDF document.static Process
printDocumentSilent
(File file) Prints a PDF document without opening a Dialog box.static Process
printDocumentSilent
(File file, boolean waitForTermination) Prints a PDF document without opening a Dialog box.static Process
printDocumentSilent
(String fileName) Prints a PDF document without opening a Dialog box.static Process
printDocumentSilent
(String fileName, boolean waitForTermination) Prints a PDF document without opening a Dialog box.
-
Field Details
-
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
Creates a command string array from the string arguments.- Parameters:
arguments
-- Returns:
- String[] of commands
-
openDocument
Opens a PDF document.- Parameters:
fileName
- the name of the file to openwaitForTermination
- true to wait for termination, false otherwise- Returns:
- a process
- Throws:
IOException
- on error
-
openDocument
Opens a PDF document.- Parameters:
file
- the file to openwaitForTermination
- true to wait for termination, false otherwise- Returns:
- a process
- Throws:
IOException
- on error
-
openDocument
Opens a PDF document.- Parameters:
fileName
- the name of the file to open- Returns:
- a process
- Throws:
IOException
- on error
-
openDocument
Opens a PDF document.- Parameters:
file
- the file to open- Returns:
- a process
- Throws:
IOException
- on error
-
printDocument
Prints a PDF document.- Parameters:
fileName
- the name of the file to printwaitForTermination
- true to wait for termination, false otherwise- Returns:
- a process
- Throws:
IOException
- on error
-
printDocument
Prints a PDF document.- Parameters:
file
- the File to printwaitForTermination
- true to wait for termination, false otherwise- Returns:
- a process
- Throws:
IOException
- on error
-
printDocument
Prints a PDF document.- Parameters:
fileName
- the name of the file to print- Returns:
- a process
- Throws:
IOException
- on error
-
printDocument
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 printwaitForTermination
- true to wait for termination, false otherwise- Returns:
- a process
- Throws:
IOException
- on error
-
printDocumentSilent
Prints a PDF document without opening a Dialog box.- Parameters:
file
- the File to printwaitForTermination
- true to wait for termination, false otherwise- Returns:
- a process
- Throws:
IOException
- on error
-
printDocumentSilent
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
Prints a PDF document without opening a Dialog box.- Parameters:
file
- the File to print- Returns:
- a process
- Throws:
IOException
- on error
-
launchBrowser
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
-