Hi All,

I am totaly stuck now. I couldn't find any document relating to my requirement. I have an object of AcroFields, from that I am able to get an object of AcroFields.Item which is a push-button. From this object I got an arraylist of PdfDictionary; which contains the entry for Action. How to modify this Action. I am listing the code snippet here, please help me -

if(form.getFieldType(strFieldName) == AcroFields.FIELD_TYPE_PUSHBUTTON)
{
         AcroFields.Item objItem = form.getFieldItem(strFieldName);
        ArrayList objArrayList = objItem.widgets;
        Iterator iter1 = objArrayList.iterator(),iter2;
        String strName;
        PdfDictionary objPdfDict = null;
        PdfName objName = null;
        PdfObject objObject = null;

       while(iter1.hasNext())
        {
             objPdfDict = (PdfDictionary)iter1.next();
             Set objSet = objPdfDict.getKeys();
             for(iter2 = objSet.iterator(); iter2.hasNext();)
             {
                  objName = (PdfName)iter2.next();
                  objObject = objPdfDict.get(objName);

                   if(objObject.isDictionary())
                  {
                       Set objSet2 = ((PdfDictionary)objObject).getKeys();
                       PdfObject objObject2;
                       PdfName objName2;
for(Iterator iter3 = objSet2.iterator(); iter3.hasNext();)
                       {
                            objName2 = (PdfName)iter3.next();
objObject2 = ((PdfDictionary)objObject).get(objName2);
                       }
              }
         }
    }
}

Thanx

Nitin
----- Original Message ----- From: "Paulo Soares" <[EMAIL PROTECTED]>
To: "Nitin Tomer" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Monday, January 09, 2006 4:10 PM
Subject: RE: [iText-questions] Making fields in a form read only


(Reply to the mailing list)

It's the /A key. You must refer to the pdf reference for more
information.

-----Original Message-----
From: Nitin Tomer [mailto:[EMAIL PROTECTED]
Sent: Monday, January 09, 2006 10:35 AM
To: Paulo Soares
Subject: Re: [iText-questions] Making fields in a form read only

Hi Paulo,

        I got the ArrayList widgets from AcroFields.Item; it
contained only
one object of OdfDictionary. I created a set of keys using
the getkeys()
method of PdfDictionary; and printed all PdfName and
PdfObject objects'
toString values. I got the following output.

objName: /AP - objObject: [EMAIL PROTECTED]
objName: /MK - objObject: [EMAIL PROTECTED]
objName: /P - objObject:
[EMAIL PROTECTED]
objName: /Parent - objObject:
[EMAIL PROTECTED]
objName: /H - objObject: /P
objName: /F - objObject: 4
objName: /BS - objObject: [EMAIL PROTECTED]
objName: /Subtype - objObject: /Widget
objName: /A - objObject:
[EMAIL PROTECTED]
objName: /Type - objObject: /Annot
objName: /Rect - objObject: [EMAIL PROTECTED]

In this output I didn't get any PdfName - Action. Is it OK?
and if it is OK,
how do I manipulate the Action's value.

Regards

Nitin

----- Original Message ----- From: "Paulo Soares" <[EMAIL PROTECTED]>
To: "Nitin Tomer" <[EMAIL PROTECTED]>; "Bruno Lowagie"
<[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Monday, January 09, 2006 2:06 PM
Subject: Re: [iText-questions] Making fields in a form read only


> There's no PdfFormField in AcroFields, you must manipulate
the action
> dictionary directly through Item.widget.
>
> ----- Original Message ----- > From: "Nitin Tomer" <[EMAIL PROTECTED]>
> To: "Bruno Lowagie" <[EMAIL PROTECTED]>
> Cc: <[email protected]>
> Sent: Monday, January 09, 2006 8:28 AM
> Subject: Re: [iText-questions] Making fields in a form read only
>
>
>> Hi Bruno,
>>
>>        I am able to get the name of fileds of type -
>> FIELD_TYPE_PUSHBUTTON. And I also know how to set the
action of a push
>> button type field. But I don't know how to get the
PdfFormField object
>> from AcroFields, please help me on this.
>>
>> Thanx
>>
>> \N
>> ----- Original Message ----- >> From: "Bruno Lowagie" <[EMAIL PROTECTED]>
>> To: "Nitin Tomer" <[EMAIL PROTECTED]>
>> Cc: <[email protected]>
>> Sent: Monday, January 09, 2006 1:28 PM
>> Subject: Re: [iText-questions] Making fields in a form read only
>>
>>
>>> Nitin Tomer wrote:
>>>
>>>> Thanx Bruno,
>>>>
>>>> I used partialFormFlattening method of PDFStamper, and
it worked like
>>>> a charm. Now I hae run into another problem, how to
change the submit
>>>> action (URL) of a form.
>>>
>>> I don't think this is supported directly (Paulo can
confirm or deny
>>> this).
>>> You could add a method to AcroFields that looks for the
(PushButton?)
>>> Field
>>> that has the submit action and changes the action.
>>> br,
>>> Bruno
>>>
>>
>>
>>
>> Disclaimer :- This e-mail message including any attachment
may contain
>> confidential, proprietary or legally privileged
information. It should
>> not be used by who is not the original intended recipient.
If you have
>> erroneously received this message, you are notified that
you are strictly
>> prohibited from using, coping, altering or disclosing the
content of this
>> message. Please delete it immediately and notify the
sender. Newgen
>> Software Technologies Ltd and / or its subsidiary
Companies accept no
>> responsibility for loss or damage arising from the use of
the information
>> transmitted by this email including damage from virus and further
>> acknowledges that any views expressed in this message are
those of the
>> individual sender and no binding nature of the message
shall be implied
>> or assumed unlessthe sender does so expressly with due
authority of
>> Newgen Software TechnologiesLtd and / or its subsidiary
Companies, as
>> applicable.
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc. Do you grep
through log
>> files
>> for problems?  Stop!  Download the new AJAX search engine
that makes
>> searching your log files as easy as surfing the  web.
DOWNLOAD SPLUNK!
>> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>> _______________________________________________
>> iText-questions mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>



Disclaimer :- This e-mail message including any attachment
may contain confidential, proprietary or legally privileged
information. It should not be used by who is not the original
intended recipient. If you have erroneously received this
message, you are notified that you are strictly prohibited
from using, coping, altering or disclosing the content of
this message. Please delete it immediately and notify the
sender. Newgen Software Technologies Ltd and / or its
subsidiary Companies accept no responsibility for loss or
damage arising from the use of the information transmitted by
this email including damage from virus and further
acknowledges that any views expressed in this message are
those of the individual sender and no binding nature of the
message shall be implied or assumed unlessthe sender does so
expressly with due authority of Newgen Software
TechnologiesLtd and / or its subsidiary Companies, as applicable.





Disclaimer :- This e-mail message including any attachment may contain 
confidential, proprietary or legally privileged information. It should not be 
used by who is not the original intended recipient. If you have erroneously 
received this message, you are notified that you are strictly prohibited from 
using, coping, altering or disclosing the content of this message. Please 
delete it immediately and notify the sender. Newgen Software Technologies Ltd 
and / or its subsidiary Companies accept no responsibility for loss or damage 
arising from the use of the information transmitted by this email including 
damage from virus and further acknowledges that any views expressed in this 
message are those of the individual sender and no binding nature of the message 
shall be implied or assumed unlessthe sender does so expressly with due 
authority of Newgen Software TechnologiesLtd and / or its subsidiary Companies, 
as applicable.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to