General technical notes
This documentation explains how the Pdftools SDK interacts with your local operating system to locate fonts, locate color profiles, and to store temporary files and cache files.
Locating fonts
Some Pdftools SDK features require fonts to be installed locally.
For example, the PDF/A standard requires all fonts to be embedded in the PDF file. If non-embedded fonts are used in the original PDF, the fonts must be embedded during conversion to PDF/A. To embed fonts, a matching font has to be located in the font directories.
Font directories
The location of the font directories depends on the operating system.
Font directories are traversed recursively in the order specified. If two fonts with the same name are found, the latter takes precedence, i.e. user fonts always take precedence over system fonts.
- Windows
- Linux
- macOS
Installing fonts in Windows
When a font is installed, it is installed by default only for a particular user. It is important to either install fonts for all users or make sure the Pdf Tools SDK is run under that user and the user profile is loaded.
The font directories for Windows are:
%SystemRoot%\Fonts
- User fonts listed in the registry key
\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts
. This includes user specific fonts fromC:\Users\<user>\AppData\Local\Microsoft\Windows\Fonts
and app specific fonts fromC:\Program Files\WindowsApps
Fonts
directory, which must be a direct subdirectory of wherePdfToolsSdkAPI.dll
resides.
The directories are transversed recursively in this order.
Installing fonts in Linux and Debian systems
In Linux, it is recommended that you install the Liberation fonts, Google Noto CJK fonts, and the OpenSymbol font.
On Debian-based systems, the packages are fontsliberation2
, fontsnotocjk
, and fonts opensymbol
.
Many PDF documents use Microsoft core fonts such as Arial, Times New Roman, and other fonts commonly used on Windows. Therefore, it is recommended that you install these fonts to your default font directories.
Many Linux distributions offer an installable package for Microsoft TrueType core fonts. For instance, on Debian-based systems, the package is ttfmscorefontsinstalller
. Alternatively, you can download the fonts from http://corefonts.sourceforge.net/
For more information on Microsoft core fonts and licensing, see Font redistribution FAQ for Windows.
/usr/share/fonts
/usr/local/share/fonts
~/.fonts
$PDFFONTDIRor/usr/lib/X11/fonts/Type1
The directories are transversed recursively in this order.
Installing fonts in macOS
In macOS, it is recommended that you install the Liberation fonts, Google Noto CJK fonts, and the OpenSymbol font.
Many PDF documents use Microsoft core fonts such as Arial, Times New Roman, and other fonts commonly used on Windows. Therefore, it is recommended that you install these fonts to your default font directories.
Many Linux distributions offer an installable package for Microsoft TrueType core fonts. For instance, on Debian-based systems, the package is ttfmscorefontsinstalller
. Alternatively, you can download the fonts from http://corefonts.sourceforge.net/
For more information on Microsoft core fonts and licensing, see Font redistribution FAQ for Windows.
/System/Library/Fonts
/Library/Fonts
The directories are transversed recursively in this order.
Font cache
A cache of all fonts in all font directories is created. If fonts are added or removed from the font directories, the cache is updated automatically.
To achieve optimal performance, make sure that the cache directory is writable for the Pdftools SDK. Otherwise, the font cache cannot be updated and the font directories have to be scanned on each program startup.
The font cache is created in the subdirectory <CacheDirectory>/Installed Fonts
of the cache directory.
Locating color profiles
If no color profiles are available, default profiles for both RGB and CMYK are generated on the fly by the Pdftools SDK. If no specific color profiles are set, default profiles are used. By default, the SDK uses the color profile "sRGB Color Space Profile.icm" for device RGB colors, and "USWebCoatedSWOP.icc" for device CMYK. It searches for these profiles in the specified directories:
- Windows
- Linux
- macOS
%SystemRoot%\System32\spool\drivers\color
- directory
Icc
, which must be a direct sub-directory of where thePdfToolsSdkAPI.dll
resides.
$PDF_ICC_PATH
if the environment variable is defined- the current working directory
$PDF_ICC_PATH
if the environment variable is defined- the current working directory
Most systems have pre-installed color profiles. For example, on Windows at %SystemRoot%\sys- tem32\spool\drivers\color\
.
You can download color profiles from the links provided in the bin\Icc\
directory or from these websites:
- http://www.pdf-tools.com/public/downloads/resources/colorprofiles.zip
- http://www.color.org/srgbprofiles.html
- https://www.adobe.com/support/downloads/iccprofiles/iccprofiles_win.html
Special Directories
Special directories are used by the Pdftools SDK during file processing. For optimal performance, the application should have write access to these directories.
Temporary files directory
The directory of temporary files is used for data specific to one instance of a program. The data is not shared between different invocations and is deleted after the program is terminated. The directory is determined as follows. The product checks for the existence of environment variables in the following order and uses the first path found:
- Windows
- Linux
- macOS
- The path specified by the
%TMP%
environment variable. - The path specified by the
%TEMP%
environment variable. - The path specified by the
%USERPROFILE%
environment variable. - The Windows directory.
- The path specified by the
$PDFTMPDIR
environment variable. - The path specified by the
$TMP
environment variable. - The
/tmp
directory.
- The path specified by the
$PDFTMPDIR
environment variable. - The path specified by the
$TMP
environment variable. - The
/tmp
directory.
Cache directory
The cache directory is used for data that is persisted and shared between different invocations of a program. The actual caches are created in subdirectories. The content of this directory can safely be deleted to clean all caches. This directory must be writable by the application. Otherwise, caches cannot be created or updated leading to significantly decreased performance.
- Windows
- Linux
- macOS
If the user has a profile:
%LOCAL_APPDATA%\PDF Tools AG\Caches
If the user has no profile:
<TempDirectory>\PDF Tools AG\Caches
If the user has a home directory:
~/.pdf-tools/Caches
If the user has no home directory:
<TempDirectory>/pdf-tools/Caches
The <TempDirectory>
refers to the directory for temporary files.
If the user has a home directory:
~/.pdf-tools/Caches
If the user has no home directory:
<TempDirectory>/pdf-tools/Caches
The <TempDirectory>
refers to the directory for temporary files.