Class PDFC
Example 1: "java -cp "java/inetcore.jar" com.inet.Start cmd c:\folder1 c:\folder2 -c c:\myconfig.xml"
Compares all PDF files in the two folders which have the same name, using
the configuration file to pre-configure PDFC.
Example 2: "java -cp "java/inetcore.jar" com.inet.Start cmd c:\folder1\report1.pdf
c:\folder2\report1.pdf"
Compares the two PDF files, using the standard configuration settings.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
This class gathers the configuration parameters to run a comparison, except the files to compare.protected static enum
Enum of all known command line switches and options, along with their long and short for and info about their default value and whether they require a parameter -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final void
activateLicense
(String activationOrLicenseKey) This method activates an activation key or a license key.protected PDFComparer
createComparer
(boolean setRetryFlag) Applies the parsed properties and creates the comparerstatic String
getVersion
(boolean appendBeta, boolean appendValidTime) Returns the current version of PDFC as a String in the format: MAJOR.MINOR.Build numberstatic void
Starts i-net PDFC with the given arguments - either two folders or two files.static final void
Deprecated.As of i-net PDFC 4.3, a trial license will automatically acquired if possible.protected void
Runs the comparison or executes the non-comparing command line arguments
-
Constructor Details
-
PDFC
Creates the command line executor- Parameters:
original
- the original / first file to be compared, may benull
toCompare
- the new / second file to be compared, may benull
props
- the additional valid command line properties, may benull
- Since:
- 3.5
-
-
Method Details
-
main
Starts i-net PDFC with the given arguments - either two folders or two files. Optionally you can set the location of the config.xml with "-c", if you does not use the default config.xml. With the argument "-i" you can specify, that an image with the differences will be created for each page of the PDF files. If the argument "-o" is specified, then an image for each compared page of the PDF files will be created. For request and activate a trial license is the argument -a. If missing a license it get an exit code 2.Example 1: new String[] { "c:\folder1", "c:\folder2", "-c c:\myconfig.xml" }
Compares all PDF files in the two folders which have the same name, using the configuration file to pre-configure PDFC.Example 2: new String[] { "c:\folder1\report1.pdf", "c:\folder2\report1.pdf" }
Compares the two PDF files, using the standard configuration settings.- Parameters:
args
- arguments to start PDFC with - either two folders or two files, and optionally the "-c" and "-i" parameter.- Throws:
InvalidPropertiesFormatException
- if the configuration file (config.xml) has a wrong format- Since:
- 1.0
-
runComparison
Runs the comparison or executes the non-comparing command line arguments- Throws:
InvalidPropertiesFormatException
- if the file is not a valid xml configuration file.- Since:
- 1.0
-
createComparer
protected PDFComparer createComparer(boolean setRetryFlag) throws IllegalArgumentException, InvalidPropertiesFormatException Applies the parsed properties and creates the comparer- Parameters:
setRetryFlag
-true
to advice the comparer to set theComparatorProperty.retryOnLowMemory
flag- Returns:
- the configured comparer
- Throws:
IllegalArgumentException
- if the configuration file does not exist.InvalidPropertiesFormatException
- if the file is not a valid xml configuration file.- Since:
- 1.0
-
getVersion
Returns the current version of PDFC as a String in the format: MAJOR.MINOR.Build number- Parameters:
appendBeta
- iftrue
the word "BETA" will be appended in case of a beta versionappendValidTime
- iftrue
, the expiration will be appended in case of a beta version- Returns:
- the current version of PDFC
- Since:
- 1.0
-
requestAndSetTrialLicenseIfRequired
@Deprecated public static final void requestAndSetTrialLicenseIfRequired() throws IOException, com.inet.pdfc.generator.InvalidLicenseExceptionDeprecated.As of i-net PDFC 4.3, a trial license will automatically acquired if possible. If the automatic attempt is not successful, useactivateLicense(String)
to activate a license via API.This method will check for an valid, active license and request a trial license, if there is none. This request is blocking and will only return successfully if there was no trial license requested yet for this system and i-net PDFC version or, if the trial for this system and i-net PDFC version was requested within the last 30 days.
NOTE: This method establishes a connection to the license server for i-net PDFC. It may block up until the HTTP connection timeout. Calling this method in a GUI thread is discouraged!- Throws:
IOException
- thrown on connection or encryption errorscom.inet.pdfc.generator.InvalidLicenseException
- thrown in case there already is a purchased but expired license or, if a trial license was acquired but the trial period is expired- Since:
- 4.0
-
activateLicense
This method activates an activation key or a license key. The two types of key have a different purpose:- Activation key:
Can be used on any system to set a license. The activation requires an active Internet connection and will bind the key to the current system. - License key
A license key contains the license data and the system ID of the system it is valid for. So it does not require an Internet connection to activate, but it's only valid on one system.
- Parameters:
activationOrLicenseKey
- the activation or license key to be set- Throws:
IOException
- thrown if an activation key was passed to the function but the connection to the license server could not be establishedcom.inet.pdfc.generator.InvalidLicenseException
- in case the activated license is invalid- Since:
- 4.0
- Activation key:
-