Using Aspose.Pdf to convert from Html to Pdf showing error in .Net

I am using the Aspose library to convert HTML code to PDF Document in Dotnet. In Windows, this is working perfectly but in the docker image, it is showing an error in the third line -
using Document = Aspose.Pdf.Document;
var options = new HtmlLoadOptions();
var pdfDocument = new Document(stream, options);
Here Document is using from Aspose and the steam is -
var stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(HtmlData)
do I need any configuration for Aspose in the docker file?

@anik00

Please try to use Aspose.Pdf.Drawing instead of Aspose.PDF for .NET and make sure that you install msttcorefonts package as well. In case you still notice any issues, please share your sample HTML with us along with your docker file and complete stack trace information. We will further proceed accordingly.

issue solved. Thank you.

1 Like

@asad.ali Can you tell me what modifications happened in Aspose.pdf 24.6? cause when I am using 24.3, I am getting an error. But in 24.6 it’s working.

@anik00
Perhaps there was some kind of error that the developers just fixed. If the result changes when only the library is changed, this is the most obvious assumption. But perhaps you changed Aspose.Pdf to Aspose.Pdf.Drawing, added fonts in the container, or made some other changes - and they had an effect.

@sergei.shibanov drawing is independent from Aspose.Pdf? I mean if I want to buy a license what library should I buy? Aspose.Pdf or Aspose.Pdf.Drawing?

@anik00
Look what I wrote in these posts (topics).

If you have any more questions, please ask.

This is confusing cause I found something different from the docs.


Licensing

There is no additional license for Aspose.PDF.Drawing, use the same as for Aspose.PDF. Check the Aspose PDF License section.


You can read this from here

@anik00
I will refrain from explaining for now.
Please describe in detail what you see as a discrepancy so that we can evaluate how the description is perceived and take appropriate action.

@sergei.shibanov
just tell me what license should i buy? Aspose.Pdf or Aspose.drawing?

@anik00

Please do not confuse, this is another library.

You need to use Aspose.Pdf, Aspose.Pdf.Drawing - the same license is suitable for both of these libraries.

1 Like

Thank you so much :blush: