Skip to main content
Version: 10.0

Text and syntax highlighter

webPDF also uses the text.ftl template to convert text documents that, for example, contain source code or a script language and accordingly use a “language syntax.” You can use the useSyntaxDetection element in text to enable the use of the syntax and text highlighter in the Converter web service.

{
"converter": {
"text": {
"syntaxHighlight": {
"available": "",
"fontFamily": "",
"fontOrigin": "system",
"fontSize": "10px",
"language": "",
"lineHeight": "12px",
"lineNumbers": true,
"relevance": 90,
"wordBreak": "auto"
},
"textHighlight": {
"color": "#000000",
"fontFamily": "",
"fontOrigin": "system",
"fontSize": "10px",
"lineHeight": "12px",
"lineNumbers": false,
"wordBreak": "auto"
},
"useSyntaxDetection": false
}
}
}

textHighlighter will be applied to text files without any additional syntax, while syntaxHighlighter will be applied to source code and script files. The specific settings for the conversion can be configured with the parameters for the "Converter" web service.