I am using iTextSharp.dll to print my page to a pdf. The only issue I am having is that the pdf displays the CSS and JavaScript that I have on the page. Is there a way that I can set iTextSharp to NOT display the CSS/JS?
And yes, I have my CSS/JS typed directly into the .aspx page - as this is a small project. Of course for a large project I would seperate it out.
EDIT
This is my current syntax that writes to the page
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
this.Page.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(iTextSharp.text.PageSize.A4.Rotate(), 10, 10, 10, 10);
pdfDoc.SetPageSize(iTextSharp.text.PageSize.A4);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();