On Vacation for 10 days
Just a quick note to say that I’ll be on vacation for the next 10 days which means it’ll take me longer than usual to respond to your comments. Thank you for your understanding — this will be a much-needed time of rest!
Posted by Stefan Cameron on June 30th, 2007
Filed under General
Both comments and pings are currently closed.
Not sure if you can help me out. I have a PDF generated from an XDP by our Adobe Form Server. I’m attempting to embed JavaScript at the document level in order to gain silent print functionality when viewing the PDF through a web page. However, in Acrobat I can’t edit any of the JavaScript for the PDF. I attempted to use iText to embed the JavaScript but only get the following. “NotAllowedError: Security settings prevent access to this property or method. Doc.print:1:Document-Level:0”. Funny thing is that it works just fine with Acrobat Reader 7.0 installed, but Acrobat 8.0 results in the error.
Oh, and I hope your vacation was nice 🙂
Stefan,
If you have time I have a second question for you, after holidays…
I have a multiline field with XHTML data (bold, italic, etc). When a user change the value I would like to validate the input data. Accordingly to this validation, I would like to keep the previous value or not. In case to keep the previous value, the data must keep formated as well. I think there is 2 possible approaches:
1 – Cancel the change action… I wasn´t able to do this..
2 – Copy the value (rawvalue) for a variable or a hidden filed, and then copy it back to the changed field. However, in this case, I lost the data format (bold, italic, etc.).
Any ideas on this?
Thank you.
JonR,
Unfortunately, I don’t think I can be of much help in this case. It’s possible that certain security enhancements introduced in Acrobat/Reader 8.0 are now preventing you from printing without the print dialog. The “Doc.print” method is certainly documented, in the JavaScript for Acrobat API Reference, as being subject to certain security restrictions.
You may want to post your question to one of the Acrobat Forums instead.
sergio,
I believe what you need to do is use the “xfa.event.change” property in the text field’s Change event to do the validation. This property will contain the character that was just typed (or an empty string if the user hit the backspace key). If you don’t want to allow that character to be entered, you simply need to set the property to an empty string.
For example, the following JavaScript prevents the user from entering the letter “a” into a text field and doesn’t affect any rich formatting that has already been specified by the user:
Stefan,
Welcome back. I have a simple question, I wanted to know if adobe acrobat 8 could be run from WSH or DOS using command line parameters. Basically, I’d like to call Adobe acrobat from another programming language, load a PDF file, then export its contents. It’s just a few clicks and I was hoping there was a way to do this.
Scott
Scott Sheck,
Based on Thom Parker’s reply to a post on the same topic at AcrobatUsers.com, it looks like you can!
Stefan,
Sorry about my post to this topic, but I didn´t found any topic about schemas and I think it is an important functionality of Livecycle Designer.
Can you tell me where can I read more about them? The point is to know how far can we go configuring the fields of a form outside the actual form. I believe the designer of the form should not decide about some characteristics of the fields (like name, length,etc). So, someone should define them and the designer should just drag and drop them to the form.
Well, there is a problem with this approch. As far as I understand, if the designer will drag the fields how can one use the library functionality. For instance, if we have a telephone number field inside the library with the call to some script (or even the script itself), if the designer drag and drop the field from the schema, this field will not have the function call. Or is anyway for mixing the two?
Thank you
Sergio,
Schemas are certainly a very important part of Designer. I’ll make a note about writing an article on creating data connections to schemas at some point in the future.
I’m quite certain you can work both with the Data View and the Library palettes at the same time. For instance, you can drag & drop a data item from the Data View palette onto an existing field on your form and Designer will automatically bind that field to the data item without replacing the field object. In later versions of Designer (I believe it’s as of version 8.0), a Data Binding Wizard feature was introduced and appears when you drag & drop a data item onto an existing field: It lets you specify how much of the schema information you wish to apply to the existing field. In any case, if you added a field to your form from the Library palette and this field contained some script(s), dragging and dropping a data item from the Data View palette wouldn’t affect the script(s) already applied to the field.