Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

C#
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
Posted

1 solution

first try this code
C#
DocumentModel.Load("Document.html").Save("Document.pdf");


try this code link[^]

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900