Hi Aspose,
When I loaded and processed hang.html using Aspose words to create jpg image, “doc.PageCount” changed when i call doc.save. As a result, a lot of duplicate image is created.
I attached sample.zip and this worked fine with firefox. I used
Aspose Word (16.8.0).
NOTE: It’s INFECTED html
My code is:
HtmlLoadOptions loadOption = new HtmlLoadOptions();
loadOption.WebRequestTimeout = 60000;
// Clean outputFile
Document doc = new Document(inputFile, loadOption);
Aspose.Words.Saving.ImageSaveOptions options;
options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Jpeg);
options.PageCount = 1;
for (int i = 0; i < doc.PageCount; i++) // doc.PageCount CHANGED THERE
{
options.PageIndex = i;
string pageName = "Page" + "_" + (i + 1) + ".jpg";
doc.Save(pageName, options);
}
Please help.