Frequently Asked Question:
Why is there a 255 character limit for JavaScript strings in the FormFieldJavaScriptAction function?
Why is there a 255 character limit for JavaScript strings in the FormFieldJavaScriptAction function?
Delphi, the programming language that Quick PDF Library is written in, has a 255 character limit for string constants, which means that strings longer than 255 characters can't be used. The easiest way around this when inserting JavaScript into a PDF with the FormFieldJavaScriptAction function is to break the long string into multiple strings. An example of this is provided here:
LongString := 'app.alert("This is a Long message window ' +
'which can be displayed because the string Literal is ' +
'bigger than 255 characters long <spacefiller><spacefiller>' +
'<spacefiller><spacefiller><spacefiller><spacefiller>' +
'<spacefiller><spacefiller><spacefiller><spacefiller>' +
'<spacefiller><spacefiller><spacefiller>!");'