wood burning stoves 2.0*
The moose likes Struts and the fly likes iText in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "iText in Struts" Watch "iText in Struts" New topic
Author

iText in Struts

Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
I am using iText in Struts to produce pdf. I know want my pdf to be editable.
Does anybody know how to do it.
Note: I only need to edit the text. I am only displaying some palin text(the purpose is for letter generation)
I also don't need to retrive back the editable information.
All I need is to make the content(text) editable

Please advice me what I am missing

Code:
public ActionForward doGenerateLeterPDF(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse response) throws WebException {
try{
Document document = new Document();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfWriter writer = PdfWriter.getInstance(document, baos);
document.open();
document.add(new Paragraph("Hello World"));
document.close();

response.setContentType("application/pdf");
response.setContentLength(baos.size());
ServletOutputStream out = response.getOutputStream();
baos.writeTo(out);
}catch(Exception e)
{
logger.error("Exception: " + e);
throw new WebException(e);
}

return null;

}

[ February 02, 2007: Message edited by: Vani D Bandargal ]

[ February 02, 2007: Message edited by: Vani D Bandargal ]
[ February 02, 2007: Message edited by: Vani D Bandargal ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41600
    
  55
Please don't post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread, where you have an answer already.
[ February 02, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: iText in Struts