How can i Convert from html to pdf for c# using Expert Pdf?

Posted by Shalini07 under C# on 9/9/2014 | Points: 10 | Views : 3578 | Status : [Member] | Replies : 8
Hi, I need help for converting html to pdf for asp.net. I have tried using Expert PDF as one of my friends told me its very good. Can anyone help me regarding this. You can check details here
http://www.html-to-pdf.net/Support.aspx




Responses

Posted by: Aliseif on: 10/24/2017 [Member] Starter | Points: 25

Up
1
Down
I am afraid it might be not the best solution to use now. If you need something easy to install and use, I recommend you to check easyPDF SDK (http://www.pdfonline.com/html-to-pdf-c%23/index.htm ) . The good think I can tell you about it, it has many templates with different features. All you need is just to insert the code.

Shalini07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ashok.S on: 9/9/2014 [Member] Starter | Points: 25

Up
0
Down
Hi,it seems pointless of your post because you dont place a specific question here ,so you can hardly get a certain answer.From the page mentioned above, it has complete steps to converting html to pdf using C# or VB.NET.However,if you still dont know to how to achieve the purpose with that page, you can alternatively check this mothed -http://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Convert-HTML-to-PDF-Customize-HTML-to-PDF-Conversion-by-Yourself.html Hope it can do you a bit fover.

Shalini07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raj.Trivedi on: 9/14/2014 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Shalini,

Itext sharp is better for your requirement

Here is it
http://www.dotnetfunda.com/articles/show/2326/converting-web-page-to-pdf-using-itextsharp

Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved

Shalini07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hasyim on: 3/19/2015 [Member] Starter | Points: 25

Up
0
Down
Saving PDF format is not natively supported by the default .NET classes. So you need to use a development toolkit (leadtools) that supports this feature.
I found the following thread that contains useful information about a similar requirement:
http://stackoverflow.com/questions/28832514/is-it-possible-to-convert-html-textstring-to-pdf-using-leadtools

Shalini07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yesi on: 3/25/2015 [Member] Starter | Points: 25

Up
0
Down
Convert Html to PDF ,why not try this free.NET API[ http://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Convert-HTML-to-PDF-Customize-HTML-to-PDF-Conversion-by-Yourself.html

/Create a pdf document.
PdfDocument doc = new PdfDocument();
String url = "http://www.london2012.com/news/articles/paralympic-torch-relay-route-revealed-1258473.html";
Thread thread = new Thread(() =>
{ doc.LoadFromHTML(url, false, true, true);});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
//Save pdf file.
doc.SaveToFile("sample.pdf");
doc.Close();
//Launching the Pdf file.
System.Diagnostics.Process.Start("sample.pdf");


Shalini07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ebjorn on: 9/19/2016 [Member] Starter | Points: 25

Up
0
Down
I recommend you a free html to pdf converter from http://www.hiqpdf.com/free-html-to-pdf-converter.aspx . You can also download a full C# html to pdf example for ASP.NET from http://hiqpdf.codeplex.com

Shalini07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Alanbrost on: 7/13/2019 [Member] Starter | Points: 25

Up
0
Down
try this. https://zetpdf.com/ ZetPDF is a .net SDK for adding PDF render and print support in .net applications. It is designed to solve most developer’s needs with regards to PDF rendering.

Shalini07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Purvi on: 7/18/2019 [Member] Starter | Points: 25

Up
0
Down
There is the direct functionality for convert html to pdf is jsPDF

Generate PDF Function:

generate = function()
{
var pdf = new jsPDF('p', 'pt', 'a4');
pdf.setFontSize(18);
pdf.fromHTML(document.getElementById('yourIdName'),
margins.left, // x coord
margins.top,
{
// y coord
width: margins.width// max width of content on PDF
},function(dispose) {
headerFooterFormatting(pdf)
},
margins);

var iframe = document.createElement('iframe');
iframe.setAttribute('style','position:absolute;right:0; top:0; bottom:0; height:100%; width:650px; padding:20px;');
document.body.appendChild(iframe);

iframe.src = pdf.output('datauristring');
};


Shalini07, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response