> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of vadim zabejinsky > Sent: Sunday, January 30, 2005 11:25 AM > To: itext-questions@lists.sourceforge.net > Subject: [iText-questions] acroForm problem > > when submit button is pressed > the document is being opened from temp file > ( I>E> c:\temp\paXXXXXX.pdf ) > and not with context-root URL > like http://mySite:8888/servlet > > here is the code > > public void doPost(HttpServletRequest request, > HttpServletResponse response) throws > ServletException, IOException > { > Document document = new Document(PageSize.A4, > 5, 10, 5, 5); > ByteArrayOutputStream baos = new > ByteArrayOutputStream(); > try > { > pdfWriter = > PdfWriter.getInstance(document, baos); > PdfAcroForm acroForm = > pdfWriter.getAcroForm(); > document.open(); > PdfContentByte cb = new > PdfContentByte(pdfWriter); > BaseFont helv = > BaseFont.createFont("Helvetica", "winansi", false); > int port = request.getServerPort(); > String host = request.getServerName(); > String appname = request.getRequestURI(); > String appAddress = "http://" + host + ":" > + port + appname; > int fontSize=12; > acroForm.addSingleLineTextField("name", > "your name", helv, fontSize, 171, 800, 350, 820); > acroForm.addHtmlPostButton("btn", > "SUBMIT", "noValue", appAddress, helv, fontSize, 355, > 700, 420, 725); > document.close(); > > }catch (DocumentException de) > { > String str = de.getMessage(); > } > > response.setContentType(CONTENT_TYPE); > ServletOutputStream bos = > response.getOutputStream(); > baos.writeTo(bos); > bos.flush(); > } >
I've no idea, works for me. > 2. when the content type is set to "application/pdf" > the servlet is execute twice. why? > http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792 > thanks > Vadim > > > > > __________________________________ > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard. > http://promotions.yahoo.com/new_mail > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive > Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions