Hi,
I try to convert an html file (or string) into pdf
i use the aspose.pdf library and i am very surprise with the duration of the conversion process
it takes more than 1.5 minute. others products take from 4 to 8 secondes !!
note that there are some miscates in the result pdf file
perhaps there are some parameters or solution… or bug ?..
please help !!
another question : in the html string, there are many input tag elements
how can i convert them in pdf without textbox (like all other convertors) ?
my code :
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(“Aspose.Total.lic”);
string basePath = string.Empty;
// instantiate HtmlLoadOptions object and set desrired properties.
Aspose.Pdf.HtmlLoadOptions htmlLoadOptions = new Aspose.Pdf.HtmlLoadOptions(basePath);
htmlLoadOptions.InputEncoding = “UTF8”;
string html = File.ReadAllText(inputFilename);
htmlLoadOptions.PageInfo.Margin.Bottom = 10;
htmlLoadOptions.PageInfo.Margin.Top = 10;
htmlLoadOptions.PageInfo.Margin.Left = 10;
htmlLoadOptions.PageInfo.Margin.Right = 10;
string outputFilename = “aspose-file.pdf”;
//Load HTML string
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(html)), htmlLoadOptions);
//Save PDF file
doc.Save(outputFilename);
my html file in attachment