That's because there aren't any fields in this PDF.

I don't know how you produced this document - but it only has page annotations but NOT the associated AcroForm objects. Thus, getField () can't find anything.

Leonard

On Mar 29, 2007, at 8:47 AM, Aristide Di Lauro wrote:

Hi, Leonard

This is the problem!

One of the main problem.

The message in Italian is mine.

I show the message when the script return null.

In this case, the script abort in this section:



  var buttonSave = this.getField("Salva");

  if (buttonSave == null) {

app.alert({cMsg: "Attenzione probabile problema con questo reader, non è stato in grado di leggere il campo 'Salva'",cTitle: "Acrobat reader Problem..."});

  }

  else {

    buttonSave.value="";

  }



I try to read the button named "Salva" but this return "null".

I think because that object is out of the visible part of the screen!



This happen when we open this file with Reader 8.0, if I try to open with other reader, sometimes work, and sometimes work in the same 8.0. It’s random?



In this case, with reader 8.0, if enable the console I see this message:



NotAllowedError: Security settings prevent access to this property method.

Filed.borderColor:249:Page undefined:Open





Thanks,

Aristide



----------------------------------------------------------------------



Message: 1

Date: Thu, 29 Mar 2007 07:57:12 -0400

From: Leonard Rosenthol <[EMAIL PROTECTED]>

Subject: Re: [iText-questions] R: Javascript

To: [EMAIL PROTECTED], Post all your questions about iText here

      <[email protected]>

Message-ID: <[EMAIL PROTECTED]>

Content-Type: text/plain; charset="windows-1252"



I opened this document and received two alerts (in Italian) which I suspect are yours and what I should be seeing. Yes?



So what is the problem? When it "doesn't work" - what happens instead?



Leonard





-----Messaggio originale-----
Da: [EMAIL PROTECTED] [mailto:itext- [EMAIL PROTECTED] Per conto di itext- [EMAIL PROTECTED]
Inviato: giovedì 29 marzo 2007 11.52
A: [email protected]
Oggetto: iText-questions Digest, Vol 10, Issue 136



Send iText-questions mailing list submissions to

      [email protected]



To subscribe or unsubscribe via the World Wide Web, visit

      https://lists.sourceforge.net/lists/listinfo/itext-questions

or, via email, send a message with subject or body 'help' to

      [EMAIL PROTECTED]



You can reach the person managing the list at

      [EMAIL PROTECTED]



When replying, please edit your Subject line so it is more specific

than "Re: Contents of iText-questions digest..."





Today's Topics:



   1. R: Javascript (Aristide Di Lauro)





----------------------------------------------------------------------



Message: 1

Date: Thu, 29 Mar 2007 11:49:49 +0200

From: "Aristide Di Lauro" <[EMAIL PROTECTED]>

Subject: [iText-questions] R: Javascript

To: <[email protected]>

Message-ID: <[EMAIL PROTECTED]>

Content-Type: text/plain; charset="iso-8859-1"



Hi Alexis, thanks for you quick response.







Yesterday I have upgrade the library to the version 1.4 (by lowagie.com)



But nothing change. Sometimes the javascript fails when the document is

open, in the version 8.0 but regularly fails in 7.0 not in 6.0.



We have only use simple script that normally you can add with Acrobat

Professional. This script run when the document is open.







My suppose : we have this problem only because we are running into the

browser.







But I have hear one interview release from Bruno Lowagie on JavaPolis and we

have produced an application like the application written for the ghent

university.



We use PDF with AcroForm, fill that from servlet, send to the browser, plug

in open the document, start with javascript than interact before the user

fill some fields and then submit the data to the same servlet.



I think is a problem of openpage() action. Because I have insert in the

template PDF a start function called ?init();?, and with iText put the

script with



writer.addJavaScript(?function init() { ?. }?);







we have resolved with workaround but i don?t understand this bug!



I attach a simple test page, generate from my servlet, with the workaround.







Thanks.



Aristide















  _____



Da: Aristide Di Lauro [mailto:[EMAIL PROTECTED]

Inviato: mercoled? 28 marzo 2007 16.01

A: '[email protected]'

Oggetto: Javascript







We have use PDF for an application input, generating from a servlet, this

application is used in 50.000 clients.







With the iText library we put in FIELDS of a different template document

(designed with Acrobat Professional 6.0) the correct value, this value is

readed from DB.



For the presentation, with javascript we force different command for modify

the background color, the visibility / enable / disable of fields and button

than send this FIELDS to the same SERVLET, like a HTML FORM application.







This work fine width ?Acrobat professional 5/6? and with ?Acrobat Reader

versions 6?, but with some other release we have a strange behaviors.







like this, look this javascriptscript :







var objText=app.getField(?textFieldName?);







this start at the open document, I have put the commands using the

writer.addJavaScript(??the script??);



that script return the real object only if the object is really showed in

the visible scroll region of the reader, this is contained in a browser

window.



Return null, if this object is outside the visible scroll region.







This behaviour is normal with acrobat reader 7.0, & incredible also, 8.0.







I have find a workaround : copy the fields in the upper region of the

document and reduce the size to 0,0 & visibility:true;



In this case the script run in the correct way, but I don?t understand why

this don?t work naturally?



The same problem appears when use the combo object, check option, radio

option, set a value from the iText api (from.setField(?)), but in this case,

in the showed window, the combo is positioned on the default value, but

internally the value is correct!







We use the iText version r1.01;p126







Do you any idea?







Thanks a lot, for all.



Aristide











-------------- next part --------------

An HTML attachment was scrubbed...

-------------- next part --------------

A non-text attachment was scrubbed...

Name: testCombo.pdf

Type: application/pdf

Size: 284209 bytes

Desc: not available



------------------------------



---------------------------------------------------------------------- ---

Take Surveys. Earn Cash. Influence the Future of IT

Join SourceForge.net's Techsay panel and you'll get the chance to share your

opinions on IT & business topics through brief surveys-and earn cash

http://www.techsay.com/default.php? page=join.php&p=sourceforge&CID=DEVDEV



------------------------------



_______________________________________________

iText-questions mailing list

[email protected]

https://lists.sourceforge.net/lists/listinfo/itext-questions





End of iText-questions Digest, Vol 10, Issue 136

************************************************



---------------------------------------------------------------------- ---
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php? page=join.php&p=sourceforge&CID=DEVDEV________________________________ _______________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to