Jesús María Nuñez Matos <nunmatje <at> jcyl.es> writes:
>
> Hi iText Gurus,
>
> I have a Servlet that opens an existing pdf form as template.
>
> PdfReader reader = new PdfReader("template.pdf");
>
> // setting some response headers
> response.setHeader("Expires", "0");
> response.setHeader("Cache-Control", "must-revalidate, post-check=0,
> pre-check=0");
> response.setHeader("Pragma", "public");
> // setting the content type
> response.setContentType("application/pdf");
> // the contentlength is needed for MSIE!!!
> response.setContentLength(reader.getFileLength());
> // write ByteArrayOutputStream to the ServletOutputStream
> ServletOutputStream out = response.getOutputStream();
>
> PdfStamper stamp = new PdfStamper(reader, out);
>
> stamp.close();
> out.flush();
>
> Before send the response to the client I need fill some fields in the form
> with values from DB.
> For simple fields it is posible with:
>
> stamp.setField(String name, String value);
>
> The problem is with Combo and List fields.
>
> Is there a easy way of dinamically fill a field of FIELD_TYPE_COMBO with a
> list of values in the stamp??
>
> I would like something like this:
>
> stamp.setField(String name, String[] value, String[] display)
>
> Best regards,
> Jesus
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
>
I'm having the same problem below.
Does anyone has a solution to that ?
My task is to populate fills in an existing pdf file and display it in a pop-up
browser.
For some of the text input field on the pdf, I also need to fill the field
value as a combo box to limit the user to only be able to select from the combo
box.
To display the pop-up browser, I use PdfReader to read the odf file, PdfStamper
to "direct" to a ByteArrayOutputStream, then direct the out put to the browser.
One work around I can think of is to read the original pdf file, create a new
temporary pdf file with the combobox that I needed using PdfWriter. Then use
PdfReader to read the odf file, PdfStamper
to "direct" to a ByteArrayOutputStream, then direct the out put to the browser.
Can anyone suggest a better solution ?
Thanks.
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions