Hi Paulo,

       Thanx for the help. I tried it but it didn't change the action-URL.
Please find the code below-

FDFInput is the form input received when the form was submitted, strFormName
is an internal variable used to denore the logical name of form,
strTemplatePath is the file path of PDF form template (the actual form,
which is rendered to users).

private String processFdfWithoutSignatures(FdfReader FDFInput,String
strFormName,String strTemplatePath, String strWorkingPath) throws
FormServerException
{
   strWorkingPath += String.valueOf((int)(Math.random() * 1000));
   String strOutPDF = strWorkingPath + strFormName + ".pdf";

    try
    {
       PdfReader reader = new PdfReader(strTemplatePath);
       PdfStamper stamp = new PdfStamper(reader, new
FileOutputStream(strOutPDF));
       AcroFields form = stamp.getAcroFields();

       HashMap hFields = null;
       Set setFieldNames = null;
       int nfieldCount = 0;

       hFields = FDFInput.getFields();

       nfieldCount = hFields.size();
       setFieldNames = hFields.keySet();

           String strFieldValue = null;
           String strFieldName = null;

           for(Iterator it = setFieldNames.iterator(); it.hasNext();)
           {
               strFieldName = (String)it.next();

                if(form.getFieldType(strFieldName) ==
AcroFields.FIELD_TYPE_PUSHBUTTON)
                {
                     AcroFields.Item objItem =
form.getFieldItem(strFieldName);
                     ArrayList objArrayList = objItem.widgets;
                     PdfDictionary objPdfDict =
(PdfDictionary)objArrayList.get(0);
                     PdfDictionary action =
(PdfDictionary)PdfReader.getPdfObject(objPdfDict.get(PdfName.A));
                     action.put(PdfName.URI, new
PdfString("http://mysite/go";));
                }
           } // End of for
      }
      stamp.close();
 }
 catch(Exception ex)
 {
  ex.printStackTrace();
 }
    return strOutPDF;
}

Thanx and Regards

Nitin
----- Original Message ----- From: "Paulo Soares" <[EMAIL PROTECTED]>
To: "Nitin Tomer" <[EMAIL PROTECTED]>;
<[email protected]>
Sent: Tuesday, January 17, 2006 4:01 PM
Subject: RE: [iText-questions] Changing Submit-Action of a PushButton in a
PDF Form


ArrayList objArrayList = objItem.widgets;
PdfDictionary dic = (PdfDictionary)objArrayList.get(0);
PdfDictionary action =
(PdfDictionary)PdfReader.getPdfObject(dic.get(PdfName.A));
action.put(PdfName.URI, new PdfString("http://mysite/go";));



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://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to