Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] Re Get a Blank page after submit a form.

Arshak, Arshak

2007-07-16

Replies:

Hi,

 

I get a blank page after I submit an AcroForm by using a submit button. 

This occurs when the pdf is opened in a browser window (and not in standalone Acrobat Reader).

The HTML POST action is carried out correctly, but then I get the blank page instead of the pdf document being re-displayed.

 

Can any one please point me to the data or supply an example where I can do the HTML POST without then going to a blank page.

 

I am using iText library version 2.0.4 and JDK 1.4.2 and Acrobat V 6 and 7.

 

Below is the sample code where it is occurring.

 

              PdfWriter writer = stamp.getWriter();

 

              PushbuttonField button = new PushbuttonField(writer, new Rectangle(250, 40, 300, 70), "Accept");

              button.setText("Accept");

              button.setOptions(PushbuttonField.VISIBLE_BUT_DOES_NOT_PRINT);

              button.setBackgroundColor(Color.LIGHT_GRAY);

              button.setTextColor(Color.RED);

              button.setBorderColor(Color.RED);

 

              PdfFormField submit = button.getField();

             

              int iNumPages    = 0;

              String servletLocation = "http://www.somesite.com/pdfPostServlet" + "?unique_id=105";

                           

              submit.setAction(PdfAction.createSubmitForm(servletLocation, null, PdfAction.SUBMIT_HTML_FORMAT));             

             

              //** Attach the button to the bottom of last page in the document.  ****

              iNumPages = pdfDoc.getNumberOfPages();

              stamp.addAnnotation(submit, iNumPages);

 

 

 

 

Arshak S. Arshak

Java Developer

Insuresuite Inc.

aarshak@insuresuite.com

 

 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
©2008 junlu.com - Jax Systems, LLC, U.S.A.