Can i use PDF Creator .Net to convert HTML source to PDF stream?
is there any sample? pls post.
HTML to PDF
-
- Posts: 4
- Joined: Mon Feb 22 2010
Re: HTML to PDF
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");
}
{
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");
}