Convert HTML to PDF is very very very long

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

Hi Emmanuel,


Thanks for contacting support.

I have tested the scenario using latest release of Aspose.Pdf for .NET 11.1.0 and have observed that HTML to PDF conversion is being completed in 40 seconds when testing on Windows 8 machine using VisualStudio 2015. However I have managed to notice that some special characters are not properly being rendered and they appear as squares inside PDF file. For the sake of correction, I have logged it as PDFNENET-40073 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Hello,


I am having the same issue with v11.1.1 as well when I try the following code:

stream.Seek(0, SeekOrigin.Begin);
var pdfDocument = new Document(stream, htmlLoadOptions)
{
PageInfo = { IsLandscape = isLandscape }
};

The stream contains the Html that I would like to conver to PDF. It takes over 2 minutes just to stream it through.

Once the pdf has been generated, it is about 60 pages long…

Is there an ETA on the resolution of this issue; or perhaps a workaround? Please advise.

Thanks!

Nacreous:
Hello,

I am having the same issue with v11.1.1 as well when I try the following code:

stream.Seek(0, SeekOrigin.Begin);
var pdfDocument = new Document(stream, htmlLoadOptions)
{
PageInfo = { IsLandscape = isLandscape }
};

The stream contains the Html that I would like to convert to PDF. It takes over 2 minutes just to stream it through.

Once the pdf has been generated, it is about 60 pages long…
Hi Jamie,

Thanks for contacting support.

The time taken by API to perform conversion depends upon the structure and complexity of input document and the issue logged earlier in this thread is based on input file shared by customer who initiated this thread. Now concerning to your problem, can you please share your resource/input file, so that we can test the scenario in our environment. We are sorry for this inconvenience.

Could you tell me if you have found a solution for this issue ?


crap2003:
Could you tell me if you have found a solution for this issue ?

Hi Emmanuel,

Thanks for your patience.

The issue reported earlier is still pending for review and is not yet resolved. However the team will surely consider fixing it as per their schedule and as soon as we have some definite updates regarding its resolution, we will let you know. We are sorry for your inconvenience.

Hi,


Has there been any further progress with this issue?

Regards,
Charles

Hi Emmanuel,


Thanks for your patience.

I am afraid the issue is still pending for review and is not yet resolved. As soon as we have some further updates, we will let you know.

Please be patient and spare us little time.

Hi,


Can we be expecting this issue to be addressed in the foreseeable future? There has been zero feedback on this issue and it has been outstanding for months.

Hope to hear good news,
Charles

Hi Charles,


Thanks for your inquriy. I am afraid the issue is still not resolved, as product team is busy in resolving other issues in the queue, reported earlier. However we have increased the issue priority and requested our product team to investigate and share an ETA at their earliest. We will notify you as soon as we made some significant progress towards issue resolution.

Furthermore, I have noticed that processing time is improved in Aspose.Pdf for .NET 11.5.0, I have tested the HTML to PDF scenario with your shared HTML and it took almost 33 seconds.

Thanks for your patience and cooperation.

Best Regards,

Hi Charles,


Thanks for your patience. We have investigated the issue and would like to suggest you to use “windows-1252” encoding as following, it will resolve the issue.

// instantiate HtmlLoadOptions object
and set desrired properties.
<o:p></o:p>

Aspose.Pdf.HtmlLoadOptions htmlLoadOptions = new Aspose.Pdf.HtmlLoadOptions(basePath);

htmlLoadOptions.InputEncoding = "windows-1252";

....


Please feel free to contact us for any further assistance.

Best Regards,