Command line options for multi-language support (10.0)
- Until the last version of pdfToolbox 9, all reports in a call needed to have the same language, for example --language=en. From the new pdfToolbox 10 onwards, the use of different languages in reports created on the same pdfToolbox run is possible. For example
--report=XML,language=en,path=<output path> --report=MASK,language=fr,path=<output path>
- While six languages are completely localized: English, German, French,Spanish, Italian and Japanese in pdfToolbox 9, it led to a problem of appearance of DictKeys for unknown languages in pdfToolbox reports. In pdfToolbox 10, DictKey mechanism has been extended, which allows customers to add translations to inactive languages and allows creation, maintenance and use of custom dicts with additional strings for any Profiles (or other objects) for active, inactive or any other language. More about custom dicts below:
Custom Dict files
Custom Dict files can be used to add or modify strings that are used in reports. Since pdfToolbox 10.0 it is allowed for custom dicts to cover strings for custom profiles or unknown Dictkeys in a particular language.
Creation of custom dicts
In the following example, a custom dict is created for strings of a non localised language to be added/replaced in a predefined Profile (kfpx). This can be achieved using the command line argument:
--createcustomdict <Path to Profile file>
./pdfToolbox --createcustomdict /var/Profiles/PDF analysis/List potential font problems.kfpx
This creates an XML for the profile (kfpx).
<?xml version="1.0" encoding="UTF-8" ?> <callas> <dict version="3.0" lang="en"> <keys> <group key="P"> <entry key="8_Listpotentialfontproblems"> <value var="long">List potential font problems</value> <value var="short">Lists possible font issues.</value> </entry> </group>
A user can add his own custom language and values (long for Name and short for Comment as in this example).
<?xml version="1.0" encoding="UTF-8" ?> <callas> <dict version="3.0" lang="in"> <keys> <group key="CUSTOMDICT"> <entry key="भारत"> <value var="long">भारत</value> <value var="short">भारतभारतभारत</value> </entry> </group>
The custom dictionary can now be used while generating reports using --customdict
./pdfToolbox --report=xml --customdict=./List potential font problems.xml --language=in ./List potential font problems.kfpx ./123.pdf
Profile name and comment without the appearance of DictKeys in the XML report (other report types will work as well of course):