Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Why is there a 255 character limit for JavaScript strings in the FormFieldJavaScriptAction function?

Question

Why is there a 255 character limit for JavaScript strings in the FormFieldJavaScriptAction function?

Answer

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>!");'

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum