Class Library

java.lang.Object
com.datalogics.PDFL.Library

public class Library extends Object
Used to create a new instance of a library object or change properties. A Library object can be used to create a new instance of a library or change the properties of an existing library.
  • Constructor Details

    • Library

      public Library(String[] fontPaths)
      Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

      Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

      Parameters:
      fontPaths - list of directories to search for fonts
    • Library

      public Library(String[] fontPaths, EnumSet<LibraryFlags> flags)
      Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

      Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

      Parameters:
      fontPaths - list of directories to search for fonts
      flags - PDF Library initialization flags, optional
    • Library

      public Library()
      Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

      Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

    • Library

      public Library(EnumSet<LibraryFlags> flags)
      Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

      Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

      Parameters:
      flags - PDF Library initialization flags, optional
    • Library

      public Library(List<String> fontPaths)
      Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

      Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

      Parameters:
      fontPaths - list of directories to search for fonts
    • Library

      public Library(List<String> fontPaths, EnumSet<LibraryFlags> flags)
      Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

      Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

      Parameters:
      fontPaths - list of directories to search for fonts
      flags - PDF Library initialization flags, optional
    • Library

      public Library(List<String> fontPaths, String CMapPath, String UnicodePath, EnumSet<LibraryFlags> flags)
      Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

      Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

      Parameters:
      fontPaths - list of directories to search for fonts
      CMapPath - directory to search for CMap files (pass an empty string to use the default)
      UnicodePath - directory to search for Unicode mapping files (pass an empty string to use the default)
      flags - PDF Library initialization flags, optional
    • Library

      public Library(List<String> fontPaths, String CMapPath, String UnicodePath, String ColorProfilePath, EnumSet<LibraryFlags> flags)
      Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

      Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

      Parameters:
      fontPaths - list of directories to search for fonts
      CMapPath - directory to search for CMap files (pass an empty string to use the default)
      UnicodePath - directory to search for Unicode mapping files (pass an empty string to use the default)
      ColorProfilePath - directory to search for Color Profile files (pass an empty string to use the default)
      flags - PDF Library initialization flags, optional
  • Method Details

    • delete

      public void delete()
      Destroy this handle to the PDF Library. Also terminate the library if this is the last Library object on this thread.

    • terminate

      public void terminate()
      Terminate the library with regard to this handle. (Note that if there are other Library objects in this thread, they may keep the library initialized.

    • initialized

      public static boolean initialized()
      Check to see if the library is initialized

      Returns:
      true if the PDF Library is initialized on this thread
    • enableLicensedBehavior

      public static boolean enableLicensedBehavior(String arg0)
      This is used to turn on licensed behaviors in DLE. The function parameter is a base64-encoded string containing the encrypted licensed key.
      Returns:
      true if the licensed behavior has been successfully enabled. NOTE: When using the Render bypass key, this requires you also set the BypassCopyPerm property to true of the DrawParams or PageImageParams classes for it to work.
    • getDLEVersion

      public static String getDLEVersion()
      The version of the .NET/Java SDK, as reported in legacy versions of APDFL.

      E.g., 18.0.5.0

    • getAPDFLVersion

      public static String getAPDFLVersion()
      The version of the C/C++ SDK, as reported in legacy versions of APDFL.

      E.g., 18.0.5P1a

    • getInstallLocation

      public static String getInstallLocation()
      The installation location.

      This is inferred from the location of the native code.

      Returns:
      the installation location as a path.
    • getResourceDirectory

      public static String getResourceDirectory()
      The resource directory.

      Returns:
      the resource directory as a path
    • setLicenseKey

      public static void setLicenseKey(String licenses)
      A string containing a license, as an alternative to using a license file. Only applicable to License-Managed versions.
    • getLicenseKey

      public static String getLicenseKey()
      A string containing a license key, as an alternative to using a license file. Only applicable to License-Managed versions.
    • getAllowOpeningXFA

      public boolean getAllowOpeningXFA()
      Allow opening PDF files that contain XFA forms. By default, an exception will be raised when attempting to open this type of document.
    • setAllowOpeningXFA

      public void setAllowOpeningXFA(boolean xfaSetting)
      Allow opening PDF files that contain XFA forms. By default, an exception will be raised when attempting to open this type of document.
    • getDefaultTempPath

      public String getDefaultTempPath()
      Gets the default temporary directory.
      Returns:
      string with current default directory for temporary files, or null if none was set by the user.
    • setDefaultTempPath

      public void setDefaultTempPath(String defTempPath)
      Sets the default temporary path to the directory indicated by the specified path name. Pass null as the path to use the system default temporary file directory.

    • getDefaultTempStore

      public TempStoreType getDefaultTempStore()
      Gets default temporary storage. PDFL uses Disk storage type by default.
      Returns:
      current temporary storage type.
    • setDefaultTempStore

      public void setDefaultTempStore(TempStoreType tempStore)
      Allows to switch between different types of temporary storages. Use Disk type to turn off in-memory file system usage. Use Memory type to turn on in-memory file system with unlimited RAM amount by default.

      Parameters:
      tempStore - temporary storage type.
    • getDefaultTempStoreMemLimit

      public int getDefaultTempStoreMemLimit()
      Gets current memory limit.
      Returns:
      current memory limit. It returns zero value for cases when unlimited memory amount is used or when current storage type is Disk. Call DefaultTempStore to get the exact meaning of the zero value
    • setDefaultTempStoreMemLimit

      public void setDefaultTempStoreMemLimit(int memoryLimit)
      Sets memory limit for Memory storage type. Accepts any positive integer to set threshold for using RAM in kilobytes. When occupied memory exceeds specified threshold, temporary files creation will be redirected to physical disk.

      Throws an exception if current storage type is Disk. Throws an exception if input value less than 0;

      Parameters:
      memoryLimit -
    • getLogParams

      public LogParams getLogParams()
      Gets LogParams object with preferences for logging.
      Returns:
      The LogParams object which contains currently used logging settings.
    • setLogParams

      public void setLogParams(LogParams logParams)
      Sets LogParams object with preferences for logging.
      Parameters:
      logParams - the new parameters for logging.
    • getAllowRelaxedSyntax

      public boolean getAllowRelaxedSyntax()
      Check to see if minor parsing errors are ignored while opening PDF files.
      Returns:
      true if these minor errors are ignored.
    • setAllowRelaxedSyntax

      public void setAllowRelaxedSyntax(boolean allowRelaxedSyntax)
      Ignore minor parsing errors while opening PDF files. By default, exceptions are raised when such errors occur.
    • changeWorkingSpaceRGB

      public void changeWorkingSpaceRGB(String profilePath)
      Sets the current RGB working space to the specified ICC profile.
      Parameters:
      profilePath - The path on disk of the Color Profile to be used.
    • changeWorkingSpaceRGB

      public void changeWorkingSpaceRGB(ColorProfile colorProfile)
      Sets the current RGB working space to the specified ICC profile.
      Parameters:
      colorProfile - The Color Profile to be used.
    • changeWorkingSpaceCMYK

      public void changeWorkingSpaceCMYK(String profilePath)
      Sets the current CMYK working space to the specified ICC profile.
      Parameters:
      profilePath - The path on disk of the Color Profile to be used.
    • changeWorkingSpaceCMYK

      public void changeWorkingSpaceCMYK(ColorProfile colorProfile)
      Sets the current CMYK working space to the specified ICC profile.
      Parameters:
      colorProfile - The Color Profile to be used.
    • changeWorkingSpaceGray

      public void changeWorkingSpaceGray(String profilePath)
      Sets the current Gray working space to the specified ICC profile.
      Parameters:
      profilePath - The path on disk of the Color Profile to be used.
    • changeWorkingSpaceGray

      public void changeWorkingSpaceGray(ColorProfile colorProfile)
      Sets the current Gray working space to the specified ICC profile.
      Parameters:
      colorProfile - The Color Profile to be used.
    • isFormsExtensionAvailable

      public boolean isFormsExtensionAvailable()
      Validate the Forms Extension dependencies are present. Indicates if all of the necessary dependencies are present for the Forms extension.

      Returns:
      true if the Forms Extension dependencies are present, and false if they are not.
    • getFormsExtensionVersion

      public static String getFormsExtensionVersion()
      Forms Extension Version

      Returns:
      The Forms Extension Version