I'm using iText, and I'm trying to have a generic PDFServlet that's able to
create a PDF from a selection of text files.  The issue I ran into yesterday
is that some of them need to be landscape, and some portrait.  The flow is
through a Struts-based webapp where users make selections, the report (text
file) gets created, then they get redirected to PDFServlet.  Prior to the
redirect, the 'filename' is put into the session to allow the PDFServlet to
retrieve it.  At that point I also know the orientation.

What would you place into the session to tell PDFServlet whether to make a
portrait or landscape report?  I don't want to couple the Struts app to
lowagie classes, so I don't want to place a Rectangle (PageSize.LETTER) in
the session.

Just define my own (Integer?) constants, put one of those in the session and
then use a switch statement to pick between:
         doc.setPageSize( PageSize.LETTER );
or
         doc.setPageSize( PageSize.LANDSCAPE );
?

Thanks for any other ideas!

-- 
Wendy Smoak



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to