Class Sdk
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.Sdk
-
public class Sdk extends NativeObject
Initialize the Toolbox add-on, manage its licensing, font directories, and get the value that will be written to the Producer metadata.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addFontDirectory(java.lang.String directory)
Add custom font directorystatic java.net.URI
getLicensingService()
Licensing service to use for all licensing requests (Getter)static java.lang.String
getProducerFullName()
The value that will be written by default to the Producer property of a document that is created with the Sdk.static java.lang.String
getVersion()
The version of the Toolbox add-on (Getter)static void
initialize(java.lang.String license, java.lang.String producerSuffix)
Initialize the Toolbox add-on, providing a license key and default Producer value.static void
setLicensingService(java.net.URI value)
Licensing service to use for all licensing requests (Setter)-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
initialize
public static void initialize(java.lang.String license, java.lang.String producerSuffix) throws LicenseException, UnknownFormatException, CorruptException, HttpException
Initialize the Toolbox add-on, providing a license key and default Producer value.- Parameters:
license
-producerSuffix
-- Throws:
UnknownFormatException
- if the format (version) of thelicense
argument is unknown.CorruptException
- if thelicense
argument is not a correct license keyLicenseException
- if thelicense
argument can be read but the license check failedHttpException
- A network error occurred.java.lang.IllegalArgumentException
- iflicense
isnull
-
addFontDirectory
public static void addFontDirectory(java.lang.String directory) throws NotFoundException
Add custom font directory
- Parameters:
directory
- The path of the directory which contains additional font files to be considered during processing.- Throws:
NotFoundException
- The given directory path does not exist.java.lang.IllegalArgumentException
- ifdirectory
isnull
-
getVersion
public static java.lang.String getVersion()
The version of the Toolbox add-on (Getter)
-
getProducerFullName
public static java.lang.String getProducerFullName()
The value that will be written by default to the Producer property of a document that is created with the Sdk.
-
getLicensingService
public static java.net.URI getLicensingService()
Licensing service to use for all licensing requests (Getter)
This property is relevant only for page-based licenses and is used to set the Licensing Gateway Service.
The default is
"https://licensing.pdf-tools.com/api/v1/licenses/"
for the online Pdftools Licensing Service. If you plan to use the Licensing Gateway Service instead of the Pdftools Licensing Service, the property’s value must be a URI with the following elements:http[s]://[‹user›[:‹password›]@]‹host›[:‹port›]
Where:
-
http/https
: Protocol for connection to the Licensing Gateway Service. -
‹user›:‹password›
(optional): Credentials for connection to the Licensing Gateway Service (basic authorization). -
‹host›
: Hostname of the Licensing Gateway Service. -
‹port›
: Port for connection to the Licensing Gateway Service.
Example:
"http://localhost:9999"
-
-
setLicensingService
public static void setLicensingService(java.net.URI value)
Licensing service to use for all licensing requests (Setter)
This property is relevant only for page-based licenses and is used to set the Licensing Gateway Service.
The default is
"https://licensing.pdf-tools.com/api/v1/licenses/"
for the online Pdftools Licensing Service. If you plan to use the Licensing Gateway Service instead of the Pdftools Licensing Service, the property’s value must be a URI with the following elements:http[s]://[‹user›[:‹password›]@]‹host›[:‹port›]
Where:
-
http/https
: Protocol for connection to the Licensing Gateway Service. -
‹user›:‹password›
(optional): Credentials for connection to the Licensing Gateway Service (basic authorization). -
‹host›
: Hostname of the Licensing Gateway Service. -
‹port›
: Port for connection to the Licensing Gateway Service.
Example:
"http://localhost:9999"
- Throws:
java.lang.IllegalArgumentException
- The URI is invalid.java.lang.IllegalArgumentException
- ifvalue
isnull
-
-
-