Flying Saucer ITextRenderer rendering problem
Hi,
Am trying to generate Pdf from a html file, using Flying saucer apis for that. I can able to generate the pdf, but the content is not rendeing with table elements,
My sample html is,
<html>
<head>
<body><TABLE width='100%' border='1' cellspacing='0' cellpadding='3'> <TR> <TD> <TABLE width='100%' border='1' cellspacing='0' cellpadding='5' bordercolor='#000000'><TR align='center' valign='middle' bgcolor='#CCCCCC'> <TH width='3%' ><FONT size='2'>S/No</FONT></TH> <TH width='60%'><FONT size='2'>Issuerrr Payment Date</FONT></TH><TH width='60%'><FONT size='2'>Actual Payment Date</FONT></TH><TH width='60%'><FONT size='2'>Client Delivered Date</FONT></TH><TH width='3%'><FONT size='2'>RT</FONT></TH><TH width='3%'><FONT size='2'>Customer Short Name</FONT></TH><TH width='3%'><FONT size='2'>Cust. Id</FONT></TH><TH width='3%'><FONT size='2'>Cust. Name</FONT></TH></TR></TABLE></TD> </TR></TABLE> </body> </html>
But after generated the pdf file contains the follwoing,
S/No Issuerrr Payment DateActual Payment DateClient Delivered DateRTCustodian Short Name
Cust. IdCust. Name
Without the table formatting etc.. I tried with css also, that too is not working,
String fileName = request.getParameter("fileName");
fileName = fileName+".pdf";
response.setHeader("Content-type","application/pdf; charset=UTF-8");
response.setHeader("Content-disposition","attachment; filename="+fileName);
ITextRenderer renderer = new ITextRenderer();
OutputStream output = response.getOutputStream();
renderer.layout();
renderer.createPDF(output);
The ablove is the code am using, anything need to be changed here?
Am new to Itext, please help me to resolve this.
Thanks a lot.
Regards
Subash