Do you own a Quick PDF Library 7 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 8 today!

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

© 2012 Debenu. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum