Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Is there any way to directly obtain CSS for grid that is exported to PDF using iTextSharp? Right now, I am using the following code to generate a pdf. I haven't given CSS explicitly. I am directly exporting.. GridView is the grid I am exporting. Grid in PDF is obtained but there is no CSS and even alignment is not proper.
Plz find the code below
MemoryStream m = new MemoryStream();
Document document = new Document(PageSize.LETTER);
StringWriter sw = new StringWriter();
HtmlTextWriter hTextWriter = new HtmlTextWriter(sw);
string html = sw.ToString();
Response.ContentType = "application/pdf";
PdfWriter writer = PdfWriter.GetInstance(document, m);
writer.CloseStream = false;
StringReader sr = new StringReader(html);
XmlTextReader xtr = new XmlTextReader(sr);
// Write pdf bytes to outputstream
Response.OutputStream.Write(m.GetBuffer(), 0, m.GetBuffer().Length);
Any answers would be greatly helpful.