Step by step - Learn how to use callas productscallas pdfToolbox Reports for ProfilesModify strings for internal syntax checks using Custom Dicts

Modify strings for internal syntax checks using Custom Dicts

If you are coming from the previous article, you might already know that you can use Custom Dict files to add or modify strings that are used in reports. In case you want to modify the strings for our internal syntax checks, this is also possible using custom dictionaries.

In order to modify the strings for the internal syntax checks, a custom dict (resulting in an xml file) is first created using --createcustomdict command, like below:

./pdfToolbox --createcustomdict ./Downloads/Only\ syntax\ checks.kfpx 

To modify the strings for our internal syntax checks, you will have to know our internal DictKeys, which you can find in the attached sample file. An example where the DictKey 'SyntaxCheckMissingFont' is added to the custom dict file is shown below:

<?xml version="1.0" encoding="UTF-8" ?>
<callas>
	<dict version="3.0" lang="en">
		<keys>
			<group key="PRCWzDocu">
				<entry key="SyntaxCheckMissingFont">
					<value var="long">Looks like there is a missing font</value>
					<value var="short">Missing font</value>
				</entry>
		.
     .
   .  

On executing a (faulty) PDF using --customdict like this: 

./pdfToolbox --report=XML --customdict=./Downloads/Only\ syntax\ checks.xml ./Downloads/Only\ syntax\ checks.kfpx ./Downloads/defect.pdf 

The result now shows the modified string:

Profile	./Downloads//Only syntax checks.kfpx	
Input	./Downloads//defect.pdf	
Pages	10	
Progress	1	%
Progress	19	%
Hit	Error	Looks like there is a missing font
Progress	22	%
.
.

Attached you will find a sample custom dict (Only_syntax_checks.xml) derived from a simple Profile that contains all possible Dict Keys

0 Comments

Send Your Comment

E-Mail me when someone replies to this comment