Hello,
I currently have a professional license of Merger.Net 4.0. I'm evaluating the Enterprise version's JavaScript capabilities.
I wrote a script that runs fine in Acrobat, but when I add it to a MergeDocument using DynamicPDF, something goes wrong and the script becomes unreadable inside Acrobat. After banging my head for a few hours trying to figure out what was going on (character encoding? syntax error?), I realized there seems to be a character limit on the Javascript contents. For instance the following script gets added just fine:
var s0="This is a sentence used for testing.";
var s1="This is a sentence used for testing.";
var s2="This is a sentence used for testing.";
var s3="This is a sentence used for testing.";
but the following completely breaks:
var s0="This is a sentence used for testing.";
var s1="This is a sentence used for testing.";
var s2="This is a sentence used for testing.";
var s3="This is a sentence used for testing.";
var s4="This is a sentence used for testing.";
Is this a limitation of the Evalution version of your product, a bug or a "feature"???
I really need this to work. The script MUST be added dynamically as it contains variables that depend on the context in which the file gets downloaded, importing it by merging a document containing the script is not really an option.
The script length is about 1000 characters.
Thanks
Javascript size limit
Re: Javascript size limit
Forum member · Jul 21, 2006I figured out a work around. Created a one page document containing a few functions (bulk of the logic). I used Merger to import that document without actually appending any pages from it. Finally I used the Javascript object to include the parameters and function calls, and everything is - almost - working.
Now I'm stuck with the following problem: the Javascript function uses the SOAP object to make a call to our server and check for an updated version of the document. All this works fine in Acrobat Standard and Professional, but not in Reader. I get the following error:
NotAllowedError: Security settings prevent access to this property or method.
SOAP.connect:32:Document-Level:Doc/Open
The PDF JavaScript documentation mentions that for SOAP requests to work in Reader, the document must have "Forms rights". How can I set these rights using DynamicPDF?
Thank you
Re: Javascript size limit
Support · Jul 21, 2006Hello,
We have never experienced this error before. You can try using the HighSecurity object and setting the AllowFormFilling property to true and that might solve your problem.
Also can you please make sure that you are using the latest DLL files from the web site because the error with JavaScript limit had been addressed in the latest DLL files.
If you continue getting the error, please send over your PDF document to our [^a|mailto:support@cete.com|Support Team^] and we will be happy to look into it further.
Thanks,
ceTe Software Support Team
Re: Javascript size limit
Forum member · Jul 21, 2006I installed the latest build, it didn't fix the javascript problem. I still have to use the workaround mentioned above.
I applied the HighSecurity settings, didn't fix the problem either.
I'll send the document to your support team.
Thx