C# 从html页面呈现pdf
您好,我有以下代码,我正在尝试将html页面转换为pdf。我正在使用abcpdf 我的代码如下:C# 从html页面呈现pdf,c#,javascript,html,abcpdf,C#,Javascript,Html,Abcpdf,您好,我有以下代码,我正在尝试将html页面转换为pdf。我正在使用abcpdf 我的代码如下: Doc theDoc = new Doc(); theDoc.Rect.Inset(72, 144); theDoc.Page = theDoc.AddPage(); int theID; **theID = theDoc.AddImageUrl("http://www.templateworld.com/free_templates.html/");**
Doc theDoc = new Doc();
theDoc.Rect.Inset(72, 144);
theDoc.Page = theDoc.AddPage();
int theID;
**theID = theDoc.AddImageUrl("http://www.templateworld.com/free_templates.html/");**
while (true)
{
theDoc.FrameRect(); // add a black border
if (!theDoc.Chainable(theID))
break;
theDoc.Page = theDoc.AddPage();
theID = theDoc.AddImageToChain(theID);
}
for (int i = 1; i <= theDoc.PageCount; i++)
{
theDoc.PageNumber = i;
theDoc.Flatten();
}
theDoc.Save(Server.MapPath("pagedhtml.pdf"));
theDoc.Clear();
Doc theDoc=new Doc();
DOC.Rect.插图(72144);
theDoc.Page=theDoc.AddPage();
int theID;
**theID=doc.AddImageUrl(“http://www.templateworld.com/free_templates.html/");**
while(true)
{
theDoc.FrameRect();//添加黑色边框
如果(!theDoc.Chaineable(theID))
打破
theDoc.Page=theDoc.AddPage();
theID=DOC.AddImageToChain(theID);
}
对于(inti=1;i请查看另一篇关于堆栈溢出的文章。也许它会对您有所帮助
trueamerican420和McAden的回答都很有帮助
我正在Internet explorer 10上使用ABCPDF版本7。我删除了更新并降级为
internet explorer 9.现在一切正常运行您是否阅读并排除了其支持部分第6.7节中列出的故障排除步骤?ABCpdf.NET适用于当前版本的Windows和Acrobat。因此,最好在当前版本的Windows上使用当前版本的ABCpdf。使用多年前停止使用是不可取的。请使用当前版本。