Rendering a large html document to jpeg in Aspose.Html 24.9 throws the following exception:
System.Runtime.InteropServices.ExternalException: ‘A generic error occurred in GDI+.’
Sample code (note that page height over 65500 will cause the exception):
AsposeGDIException.zip (1.6 KB)
HTMLDocument doc = new HTMLDocument(@“Hello World”, “.”);
HtmlRenderer renderer = new HtmlRenderer();
ImageRenderingOptions options = new ImageRenderingOptions(ImageFormat.Jpeg);
options.PageSetup.AnyPage.Size = new Aspose.Html.Drawing.Size(1080, 100000);
MemoryStream screenshotStream = new MemoryStream();
ImageDevice idv = new ImageDevice(options, screenshotStream);
doc.RenderTo(idv);