我目前使用abcPDF 7將HTML轉換爲PDF。這是通過一個ASPX頁面來完成的,我重寫了Render方法。abcPDF 7將HTML轉換爲PDF,但只獲得第一頁轉換
Doc theDoc = new Doc();
theDoc.SetInfo(0, "License", m_License);
theDoc.HtmlOptions.Paged = true;
theDoc.HtmlOptions.Timeout = 1000000;
string callUrl = "http:// my app page";
theDoc.AddImageUrl(callUrl);
Response.Clear();
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.AddHeader("Content-Disposition", "attachment; filename=" + sFile + ".pdf");
Response.ContentType = "application/octet-stream";
theDoc.Save(Response.OutputStream);
Response.Flush();
這適用於第一頁完美,但然後截斷頁面,並不會繼續呈現其餘頁面。
有沒有人知道它爲什麼停止一頁後?
schnaader提供的答案中的第二個包含peices中的代碼。感謝您發佈您的代碼。我肯定這會幫助很多人。 – 2009-11-13 02:10:42