This is a multi-part message in MIME format.

------=_NextPart_000_03C8_01C2B00A.DB91C440
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

JSP, PDF, taglibsI have not tested to insert this in a servlet, and do =
not have the possibility right now.=20

As I said, i forward from a jsp-page via a java-script to the =
pdf-jsp-page.=20

Sorry if I could not help you further!

Regards,=20
/Fredrik=20
  ----- Original Message -----=20
  From: Daniel Kalcevich=20
  To: [EMAIL PROTECTED]=20
  Sent: Friday, December 27, 2002 4:52 PM
  Subject: RE: [iText-questions] JSP, PDF, taglibs


  Fredrik,

  When you run my example are you forwarding from a Servlet to get to =
that page, or are you just entering the url to the jsp into the address =
line?  Because when I view the JSP by typing into the address it comes =
up fine.  But when I forward to the JSP, it doesn't work.  I keep =
getting that Illegal State Exception for calling both the getWriter and =
getOutputStream.  If I could get away with using the writer to print the =
PDF, then thats fine, but I don't know how to achieve this.  Any ideas?  =
I'd Appreciate it.  Right now I am just having trouble writing my file =
to the client after a forward.  I haven't even gotten to start making my =
tags yet, so any help would greatly help...

  Daniel
    -----Original Message-----
    From: Fredrik Nilsson [mailto:[EMAIL PROTECTED]]
    Sent: Friday, December 27, 2002 6:51 AM
    To: [EMAIL PROTECTED]
    Subject: Re: [iText-questions] JSP, PDF, taglibs


    Daniel,=20

    Both your code and my code-snippet works just fine for me:=20
    Try to open them in a new window by using the javascript below.=20

    ****** freniltest.jsp *****
    <%@ page import=3D"com.lowagie.text.*" %><%@ page =
import=3D"java.io.*" %><%@ page =
import=3D"com.lowagie.text.pdf.PdfWriter"%><%@ page impo
    rt=3D"com.lowagie.text.pdf.ColumnText"%><%@ page =
import=3D"com.lowagie.text.pdf.PdfContentByte"%><%@ page =
import=3D"com.lowagie.text.pdf.BaseFont"%><%                    =20
                                                                         =
                                                              =20
    java.awt.Color border =3D new java.awt.Color(0xED, 0x1C, 0x24);      =
                                                                =20
    Font font1 =3D new Font(Font.HELVETICA, 14, Font.NORMAL, border);    =
                                                                =20
    Font font2 =3D new Font(Font.HELVETICA, 24, Font.BOLD, border);      =
                                                                =20
    Font font3 =3D new Font(Font.HELVETICA, 12, Font.NORMAL, border);    =
                                                                =20
    Document document =3D new Document(PageSize.A4, 30, 30, 80, 50);     =
                                                                =20
    document.addSubject("Test");                                         =
                                                              =20
    java.io.ByteArrayOutputStream baos =3D new =
java.io.ByteArrayOutputStream();                                         =
                 =20
    PdfWriter writer =3D PdfWriter.getInstance(document, baos);          =
                                                                =20
    document.open();                                                     =
                                                              =20
    Paragraph p =3D new Paragraph("Hello world",font1);                  =
                                                                =20
    document.add(p);                                                     =
                                                              =20
    document.newPage();                                                  =
                                                              =20
    document.close();                                                    =
                                                              =20
    response.setContentType("application/pdf");                          =
                                                              =20
    response.setContentLength(baos.size());                              =
                                                              =20
    ServletOutputStream myOut =3D response.getOutputStream();            =
                                                                =20
    baos.writeTo(myOut);                                                 =
                                                              =20
    myOut.flush();                                                       =
                                                              =20
    %>                   =20
    ******SNIPP!*****

    ******** SNIPP! index.jsp ****
    <html>                                                   =20
    <head>                                                   =20
    <script>                                                 =20
    function showPrintFrenilTest()                           =20
    {                                                        =20
            window.open("freniltest.jsp","myWin");           =20
    }                                                        =20
    </script>                                                =20
    </head>                                                  =20
    <body>                                                   =20
    <br>                                                     =20
    <a href=3D"javascript:showPrintFrenilTest()">Freniltest</a>=20
    <br>
    </body>                                                  =20
    </html>                                                  =20
    ******* SNIPP! *********

    I use the index.jsp to call on the freniltest.jsp via a javascript =
showPrintFrenilTest()
    I also noticed that you do not use the setContentLength()

    Regards,=20
    /Fredrik

                                                                         =
                                        =20
    ----- Original Message -----=20
      From: Daniel Kalcevich=20
      To: [EMAIL PROTECTED]=20
      Sent: Friday, December 27, 2002 3:18 PM
      Subject: RE: [iText-questions] JSP, PDF, taglibs


      Fredrik,

      Here is the contents of my JSP so far...

      <%
      response.setContentType("application/pdf");
      java.io.ByteArrayOutputStream buffer =3D new =
java.io.ByteArrayOutputStream();
      com.lowagie.text.Document document =3D new =
com.lowagie.text.Document();
      com.lowagie.text.pdf.PdfWriter writer =3D =
com.lowagie.text.pdf.PdfWriter.getInstance( document, buffer );
      document.open();
      document.add(new com.lowagie.text.Paragraph("Hello World"));
      document.close();
      byte[] bytes =3D buffer.toByteArray();
      response.setContentLength(bytes.length);
      for(int i =3D 0; i < bytes.length; i++)
      {
          out.write(bytes[i]);
      }
      %>

      Although when I write out to the screen, all I get is....

      %PDF-1.4 %???? 3 0 obj <> stream x?+?r ?26S?00S=08I?2P?5?1?? =15 =
?=14B??4> /ProcSet [/PDF /Text] >> /Parent 1 0 R /MediaBox [0 0 595 842] =
/Contents 3 0 R /Type /Page >> endobj 2 0 obj <> endobj 1 0 obj <> =
endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f =
0000000386 00000 n 0000000290 00000 n 0000000015 00000 n 0000000145 =
00000 n 0000000442 00000 n 0000000490 00000 n trailer <> startxref 600 =
%%EOF=20

      I have to use the "out" because for some reason when I forward to =
my JSP from a servlet, if I then try to call response.getOutputStream() =
is throws an Illegal State Exception saying that the getWriter has =
already been called. (I am using JBoss 3.0.2/Tomcat 4.0.4)  Is there any =
way that I use the write method to display the file? Have you had any =
luck with that?  I mean, another way would be to prompt the user to =
download the file to their computer, but then again, I had no luck with =
that as well.  Anyways, thanks in advance.

      Daniel
        -----Original Message-----
        From: Fredrik Nilsson [mailto:[EMAIL PROTECTED]]
        Sent: Thursday, December 26, 2002 10:59 PM
        To: [EMAIL PROTECTED]
        Subject: Re: [iText-questions] JSP, PDF, taglibs


         Hi Daniel,=20

        It is pretty straight forward as in the java code.=20

        One thing to be careful about is that you cannot have any =
newlines ("enters") outside of the jsp-tags.=20
        (I.e. the import page in the beginning of the jsp-file must be =
on the same row)

        Regards,=20
        Fredrik=20

          ----- Original Message -----=20
          From: Daniel Kalcevich=20
          To: '[EMAIL PROTECTED]'=20
          Sent: Friday, December 27, 2002 12:01 AM
          Subject: [iText-questions] JSP, PDF, taglibs


          Hi,=20

          I am trying to use iText with taglibs and am wondering if =
anyone has ever played with that before.  I basically want to have iText =
created a PDF document using taglibs from a JSP page, and then just =
write the document to the browser and let the browser deal with =
opening/downloading it, etc.  I am wondering if anyone has ever done =
something like this before?  The context in which this would be used is =
that a Servlet would forward a request to the JSP, and the JSP would =
create a PDF using JSP tags based upon the information in the request.  =
Thanks in advance for any help provided.

          Daniel=20

------=_NextPart_000_03C8_01C2B00A.DB91C440
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>JSP, PDF, taglibs</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I have not tested to insert this in a =
servlet, and=20
do not have the possibility right now. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>As I said, i forward from a jsp-page =
via a=20
java-script to the pdf-jsp-page. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Sorry if I could not help you =
further!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards, </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>/Fredrik </FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A [EMAIL PROTECTED]=20
  href=3D"mailto:[EMAIL PROTECTED]";>Daniel Kalcevich</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  [EMAIL PROTECTED]=20
  =
href=3D"mailto:[EMAIL PROTECTED]";>itext-questions@lis=
ts.sourceforge.net</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, December 27, 2002 =
4:52=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> RE: [iText-questions] =
JSP, PDF,=20
  taglibs</DIV>
  <DIV><BR></DIV>
  <DIV><SPAN class=3D441354015-27122002><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2>Fredrik,</FONT></SPAN></DIV>
  <DIV><SPAN class=3D441354015-27122002><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D441354015-27122002><FONT face=3DArial =
color=3D#0000ff size=3D2>When=20
  you run my example are you forwarding from a Servlet to get to that =
page, or=20
  are you just entering the url to the jsp into the address line?&nbsp; =
Because=20
  when I view the JSP by typing into the address it comes up fine.&nbsp; =
But=20
  when I forward to the JSP, it doesn't work.&nbsp; I keep getting that =
Illegal=20
  State Exception for calling both the getWriter and =
getOutputStream.&nbsp; If I=20
  could get away with using the writer to print the PDF, then thats =
fine, but I=20
  don't know how to achieve this.&nbsp; Any ideas?&nbsp; I'd Appreciate=20
  it.&nbsp; Right now I am just having trouble writing my file to the =
client=20
  after a forward.&nbsp; I haven't even gotten to start making my tags =
yet, so=20
  any help would greatly help...</FONT></SPAN></DIV>
  <DIV><SPAN class=3D441354015-27122002><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D441354015-27122002><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2>Daniel</FONT></SPAN></DIV>
  <BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
    <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
    size=3D2>-----Original Message-----<BR><B>From:</B> Fredrik Nilsson=20
    [mailto:[EMAIL PROTECTED]]<BR><B>Sent:</B> Friday, =
December 27,=20
    2002 6:51 AM<BR><B>To:</B>=20
    [EMAIL PROTECTED]<BR><B>Subject:</B> Re:=20
    [iText-questions] JSP, PDF, taglibs<BR><BR></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>Daniel, </FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>Both your code and =
my&nbsp;</FONT><FONT=20
    face=3DArial size=3D2>code-snippet works just fine for me: =
</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>Try to open them in a new window by =
using the=20
    javascript below. </FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>****** freniltest.jsp =
*****</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>&lt;%@ page =
import=3D"com.lowagie.text.*"=20
    %&gt;&lt;%@ page import=3D"java.io.*" %&gt;&lt;%@ page=20
    import=3D"com.lowagie.text.pdf.PdfWriter"%&gt;&lt;%@ page=20
    impo<BR>rt=3D"com.lowagie.text.pdf.ColumnText"%&gt;&lt;%@ page=20
    import=3D"com.lowagie.text.pdf.PdfContentByte"%&gt;&lt;%@ page=20
    =
import=3D"com.lowagie.text.pdf.BaseFont"%&gt;&lt;%&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;=20
    =
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;=20
    <BR>******* SNIPP! *********</DIV>
    <DIV>&nbsp;</DIV>
    <DIV>I use the index.jsp to call on the freniltest.jsp via a =
javascript=20
    showPrintFrenilTest()</DIV>
    <DIV>I also noticed that you do not use the setContentLength()</DIV>
    <DIV>&nbsp;</DIV>
    <DIV>Regards, </DIV>
    <DIV>/Fredrik</DIV>
    <DIV>&nbsp;</DIV>
    =
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
    <BR></FONT>----- Original Message ----- </DIV>
    <BLOCKQUOTE dir=3Dltr=20
    style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
      <DIV=20
      style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
      <A [EMAIL PROTECTED]=20
      href=3D"mailto:[EMAIL PROTECTED]";>Daniel =
Kalcevich</A>=20
</DIV>
      <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
      [EMAIL PROTECTED]=20
      =
href=3D"mailto:[EMAIL PROTECTED]";>itext-questions@lis=
ts.sourceforge.net</A>=20
      </DIV>
      <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, December 27, =
2002 3:18=20
      PM</DIV>
      <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> RE: =
[iText-questions] JSP,=20
      PDF, taglibs</DIV>
      <DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
      size=3D2></FONT><BR></DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2>Fredrik,</FONT></SPAN></DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2></FONT></SPAN>&nbsp;</DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2>Here is the contents of my JSP so =
far...</FONT></SPAN></DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2></FONT></SPAN>&nbsp;</DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      =
size=3D2>&lt;%<BR>response.setContentType("application/pdf");<BR>java.io.=
ByteArrayOutputStream=20
      buffer =3D new =
java.io.ByteArrayOutputStream();<BR>com.lowagie.text.Document=20
      document =3D new=20
      com.lowagie.text.Document();<BR>com.lowagie.text.pdf.PdfWriter =
writer =3D=20
      com.lowagie.text.pdf.PdfWriter.getInstance( document, buffer=20
      );<BR>document.open();<BR>document.add(new=20
      com.lowagie.text.Paragraph("Hello =
World"));<BR>document.close();<BR>byte[]=20
      bytes =3D=20
      =
buffer.toByteArray();<BR>response.setContentLength(bytes.length);<BR>for(=
int=20
      i =3D 0; i &lt; bytes.length; i++)<BR>{<BR>&nbsp;&nbsp;&nbsp;=20
      out.write(bytes[i]);<BR>}<BR>%&gt;</FONT></SPAN></DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2></FONT></SPAN>&nbsp;</DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2>Although when I write out to the screen, all I get=20
      is....</FONT></SPAN></DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2></FONT></SPAN>&nbsp;</DIV>
      <DIV><SPAN class=3D136361314-27122002>%PDF-1.4 %???? 3 0 obj =
&lt;</FILTER 60=20
      Length FlateDecode>&gt; stream x?+?r ?26S?00S=08I?2P?5?1?? =15=20
      ?=14B??4<RSR?=15???RR4C??\C?=02?X? R 0 2 F1 << Font Resources obj =
4 endobj=20
      endstream ->&gt; /ProcSet [/PDF /Text] &gt;&gt; /Parent 1 0 R =
/MediaBox [0=20
      0 595 842] /Contents 3 0 R /Type /Page &gt;&gt; endobj 2 0 obj=20
      &lt;</SUBTYPE Font Type WinAnsiEncoding Encoding Helvetica =
BaseFont=20
      Type1>&gt; endobj 1 0 obj &lt;</KIDS 0 Type Pages 1 Count R] =
[4>&gt;=20
      endobj 5 0 obj &lt;</PAGES R 0 Type 1 Catalog>&gt; endobj 6 0 obj=20
      &lt;</PRODUCER - (D:20021227060956-08?00?) CreationDate p106\)) =
\(r0.96=20
      lowagie.com by (iText>&gt; endobj xref 0 7 0000000000 65535 f =
0000000386=20
      00000 n 0000000290 00000 n 0000000015 00000 n 0000000145 00000 n=20
      0000000442 00000 n 0000000490 00000 n trailer &lt;</INFO R 0 7 =
Size 5 Root=20
      6>&gt; startxref 600 %%EOF </SPAN></DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial=20
      size=3D2></FONT></SPAN>&nbsp;</DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2>I have to use the "out" because for some reason when I =
forward to=20
      my JSP from a servlet, if I then try to call =
response.getOutputStream() is=20
      throws an Illegal State Exception saying that the getWriter has =
already=20
      been called. (I am using&nbsp;JBoss 3.0.2/Tomcat 4.0.4)&nbsp; Is =
there any=20
      way that I use the write method to display the file? Have you had =
any luck=20
      with that?&nbsp; I mean, another way would be to prompt the user =
to=20
      download the file to their computer, but then again, I had no luck =
with=20
      that as well.&nbsp; Anyways, thanks in =
advance.</FONT></SPAN></DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2></FONT></SPAN>&nbsp;</DIV>
      <DIV><SPAN class=3D136361314-27122002><FONT face=3DArial =
color=3D#0000ff=20
      size=3D2>Daniel</FONT></SPAN></DIV>
      <BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
        <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
        size=3D2>-----Original Message-----<BR><B>From:</B> Fredrik =
Nilsson=20
        [mailto:[EMAIL PROTECTED]]<BR><B>Sent:</B> Thursday, =
December=20
        26, 2002 10:59 PM<BR><B>To:</B>=20
        [EMAIL PROTECTED]<BR><B>Subject:</B> Re:=20
        [iText-questions] JSP, PDF, taglibs<BR><BR></FONT></DIV>
        <DIV><FONT face=3DArial size=3D2>&nbsp;Hi Daniel, </FONT></DIV>
        <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
        <DIV><FONT face=3DArial size=3D2>It is pretty straight forward =
as in the=20
        java code. </FONT></DIV>
        <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
        <DIV><FONT face=3DArial size=3D2>One thing to be careful about =
is that you=20
        cannot have any newlines ("enters") outside of the jsp-tags.=20
        </FONT></DIV>
        <DIV><FONT face=3DArial size=3D2>(I.e. the import page in the =
beginning of=20
        the jsp-file must be on the same row)</FONT></DIV>
        <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
        <DIV><FONT face=3DArial size=3D2>Regards, </FONT></DIV>
        <DIV><FONT face=3DArial size=3D2>Fredrik </FONT></DIV>
        <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
        <BLOCKQUOTE dir=3Dltr=20
        style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
          <DIV style=3D"FONT: 10pt arial">----- Original Message ----- =
</DIV>
          <DIV=20
          style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
          <A [EMAIL PROTECTED]=20
          href=3D"mailto:[EMAIL PROTECTED]";>Daniel =
Kalcevich</A>=20
          </DIV>
          <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
          [EMAIL PROTECTED]=20
          =
href=3D"mailto:'[EMAIL PROTECTED]'">'itext-questions@=
lists.sourceforge.net'</A>=20
          </DIV>
          <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, December =
27, 2002=20
          12:01 AM</DIV>
          <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> =
[iText-questions] JSP,=20
          PDF, taglibs</DIV>
          <DIV><FONT face=3DArial size=3D2></FONT><BR></DIV>
          <P><FONT face=3DArial size=3D2>Hi,</FONT> </P>
          <P><FONT face=3DArial size=3D2>I am trying to use iText with =
taglibs and=20
          am wondering if anyone has ever played with that before.&nbsp; =
I=20
          basically want to have iText created a PDF document using =
taglibs from=20
          a JSP page, and then just write the document to the browser =
and let=20
          the browser deal with opening/downloading it, etc.&nbsp; I am=20
          wondering if anyone has ever done something like this =
before?&nbsp;=20
          The context in which this would be used is that a Servlet =
would=20
          forward a request to the JSP, and the JSP would create a PDF =
using JSP=20
          tags based upon the information in the request.&nbsp; Thanks =
in=20
          advance for any help provided.</FONT></P>
          <P><FONT face=3DArial size=3D2>Daniel</FONT>=20
    =
</P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BO=
DY></HTML>

------=_NextPart_000_03C8_01C2B00A.DB91C440--



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to