HTML to PDF

The PDF Creator .NET Library enables you to create secure PDF documents on the fly and to view, print and process existing PDF documents. If you have any questions about PDF Creator .Net, please post them here.
Post Reply
htmltopdf
Posts: 1
Joined: Wed Aug 03 2005

HTML to PDF

Post by htmltopdf »

Can i use PDF Creator .Net to convert HTML source to PDF stream?
is there any sample? pls post.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

No, the PDF Creator enables you to view and edit existing pdf files and to create new PDFs from scratch.

If you wish to convert HTML documents to PDF you need to use our PDF Converter. This is a printer driver to which you can print your HTML file to get PDF output.

Hope this helps.
asuwandarathne
Posts: 4
Joined: Mon Feb 22 2010

Re: HTML to PDF

Post by asuwandarathne »

private void button2_Click(object sender, EventArgs e)
{
acPDFCreatorLib.Initialize();
acPDFCreatorLib.SetLicenseKey("string company", "string license id");
string inFile = Application.StartupPath + @"\docs\" + "Html.html";
string outFile = Application.StartupPath + @"\docs\" + "Html.pdf";

SetupPrinter("Html.pdf");

Process pr = new Process();

pr.StartInfo.FileName = "Html2PDF.exe";
pr.StartInfo.Arguments = string.Format(@"""{0}"" ""{1}"" ""SWPC Field Report Writer PDF Converter""", inFile, outFile);

MessageBox.Show("HTML - PDF created");
}


private static void SetupPrinter(string fileName)
{

gPDF = new CDIntfEx.CDIntfEx();

gPDF.DriverInit("SWPC Field Report Writer PDF Converter");

gPDF.DefaultDirectory = Application.StartupPath;

gPDF.DefaultFileName = Application.StartupPath + @"\docs\" + fileName;

gPDF.SetDefaultPrinter();

gPDF.EnablePrinter("string company", "string license");
}
Post Reply