Hi,
I’m converting some HTML to PDF & I found its taking hell of time, sometime 5 mins or 10 mins.
Here is code
private static void GeneratePDF()
{
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(“Aspose.Total.lic”);
license.Embedded = true;
// ExStart:HTMLToPDF
// The path to the documents directory.
string dataDir = @“E:\RND\HeaderAndFooter\42 (1).html”;
// com.aspose.pdf.HeaderFooter header = new com.aspose.pdf.HeaderFooter();
HtmlLoadOptions options = new HtmlLoadOptions();
options.CustomLoaderOfExternalResources = new LoadOptions.ResourceLoadingStrategy(SamePictureLoader);
Document pdfDocument = new Document(dataDir, options);
//
Aspose.Pdf.Forms.Form.FlattenSettings fl = new Aspose.Pdf.Forms.Form.FlattenSettings();
pdfDocument.Flatten(fl);
pdfDocument.Save(@"E:\RND\HeaderAndFooter\HTMLToPDF_out.pdf");
}