如何在pdf中下载html文件 [英] how to download html file in pdf

查看:83
本文介绍了如何在pdf中下载html文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有一个html文件pass.html,我想以pdf格式下载它目前我正在使用此代码bt它是在html下载格式



<前lang =cs> 字符串 filePath = Passcode.htm;
Response.ContentType = pdf;
Response.AddHeader( Content-Disposition attachment; filename = \ + filePath + \ );
Response.TransmitFile(Server.MapPath(filePath));
Response.End();









如何以pdf格式下载





谢谢

Srishti

解决方案

首先尝试此代码

 DocumentModel.Load(  Document.html )。保存(  Document.pdf); 





尝试此代码链接[^]



并查看此链接 ...这个.. [^]


Hello ,

I have a html file pass.html and i want to download it in pdf format currently i am using this code bt it is download in html format

string filePath = "Passcode.htm";
        Response.ContentType = "pdf";
        Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
        Response.TransmitFile(Server.MapPath(filePath));
        Response.End();





How to download it in pdf


Thanks
Srishti

解决方案

first try this code

DocumentModel.Load("Document.html").Save("Document.pdf");



try this code link[^]

and also check this link ...this..[^]


这篇关于如何在pdf中下载html文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆