Creation of a pdf from an html file or stream
I can create a stream or html file easily enough however when using the
BindHTML method the resulting XML file is void of anything that resembles
the html file and hence the pdf is also. Code below:
try
{
Pdf pdf1 = new Pdf();
pdf1.Security = new Security();
pdf1.Security.UserPassword = “TEST”;
string licenseFile = MapPath(“License”) + \Aspose.Pdf.lic;
Aspose.Pdf.License pdflicense = new Aspose.Pdf.License();
pdflicense.SetLicense(@licenseFile);
pdf1.CompressionLevel=9;
string htmlFile = Server.MapPath("~/ASPOSE/PDF/TESTPAGE.htm");
// Create a html file
StreamWriter sw = File.CreateText(htmlFile);
sw.Write(RadEditor1.Html);
sw.Close();
pdf1.BindHTML(htmlFile);
pdf1.Save(Server.MapPath("~/ASPOSE/PDF/") + @“Test.pdf”);
System.IO.File.Delete(htmlFile);
}
catch(Exception ex)
{
Response.Write (ex.Message);
}
Html file is a simple
This changes the actual Page code Cool
Kind regards
Gareth