jqueryでもhtmlページを解析してpdfに変換できるhtmlパーサーを探しています。
以前は、次のコードを使用して html ファイルを pdf にエクスポートしていました。
using System;using System.Web;
using System.Web.UI;
using System.Data;
using System.IO;using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html.simpleparser;
protected void btnPDF_Click(object sender, EventArgs e)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=UserDetails.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(PageSize.A4, 10f, 10f, 100f, 0.0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
}
しかし、 iTextSharp dll を使用すると、Jquery UI を含む html ページを pdf に変換できますか?
私はアイデアを使い果たしました。どうすればこれを達成できるか、意見や提案を教えてください。
まず、これが達成できるかどうかを知りたいですか?HTML ページ (Jquery UI) を pdf に変換する機能を持つ dll はありますか?