If you use a servlet to create the HTML via "plain
iText" in the first place, the result should be almost
completely portable to PDF, merely by repeating the
creation process and using a PdfWriter instead of an
HtmlWriter.  Or you could create the PDF and HTML
simultaneously by attaching both DocWriters to the
same Document, but this would of course leave you with
a lot of PDFs you might not need...

-Matt

--- Richard Elsberry <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I've been experimenting with iText for about 4 days
> and have come close 
> to my solution but keep getting stumped. I have a
> web page that displays 
> database info and I want to have the option for
> users to generate a pdf 
> version if needed. I am using Java and there are two
> places where I keep 
> getting stuck::
> 
> 1. GRAB THE HTML THAT THE JSP GENERATES ON THE FLY
> - have tried  a URLConnection (problems with
> re-login here)
> - playing with a custom tag that incases the page
> then saving it to a 
> string using the doAfterBody() method. This hasen't
> been working too 
> well. The jsp has several layers of includes and may
> be too complex for 
> this.
> 
> 2. CONVERT THE HTML TO A ITEXT DOCUMENT
> -Once I grap the html, how do I convert the HTML
> that the JSP creates 
> over to an iText Document object so that I can use
> the PDFWriter to 
> write it out as a ByteArrayOutputStream. I am still
> searching the 
> archives and using the tutorial provided.
> 
> Has anybody had to develop a similar solution. It
> seems like this would 
> be a common need. Perhaps I am approachng this the
> wrong way or don't 
> understand iText enough yet.
> 
> Any input would be GREATLY appleciated.
> 
> Thanks, Richard
> 
> 
>
_______________________________________________________________
> 
> Don't miss the 2002 Sprint PCS Application
> Developer's Conference
> August 25-28 in Las Vegas --
> http://devcon.sprintpcs.com/adp/index.cfm
> 
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/itext-questions


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to