HTML to PDF Conversion | Scale High Resolution Embedded Image to Fit within Page | C# .NET

Hello. I am using Aspose.Words v21.7.0 library to convert html file to pdf. My source html file has embedded high resolution image(4032x3024). When I convert it as pdf it does not fit pdf page.

I do not see any scale or fit load/save option when I use document save method.

I do use instance of Aspose.Words.Document and it Save method.

var loadOptions = new HtmlLoadOptions();
loadOptions.Encoding = Encoding.UTF8;
loadOptions.WebRequestTimeout = ConfigHelper.GetAsposeWebRequestTimeout();

Document doc = new Document(ms, loadOptions);

var res = new MemoryStream();
doc.Save(res, SaveFormat.Pdf);

How can I make the image fit to the output pdf page?

I have attached source html file in zip archive (4.8 MB)

Thank you for any ideas that may help.


We have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-22652. We will further look into the details of this problem and will keep you updated here on the status of this issue. We apologize for your inconvenience.