Hello team.
While evaluating Aspose.HTML for Java for conversion of HTML table to PNG, we noticed converted PNG has bigger dimensions (width and height) than the input table in HTML, even though the page layout has
PageLayoutOptions.FitToContentWidth | PageLayoutOptions.FitToContentHeight
Attached is the zip arhive containing the input HTML that represents the table with dimensions 430px by 260px, PNG image that has dimensions 794px x 1123 px, as well as expected image.
Below is the following code snippet:
ImageSaveOptions options = new ImageSaveOptions(ImageFormat.Png);
options.setHorizontalResolution(Resolution.to_Resolution(96d));
options.setVerticalResolution(Resolution.to_Resolution(96d));
// Core layout options
options.getPageSetup().setPageLayoutOptions(
PageLayoutOptions.FitToContentWidth |
PageLayoutOptions.FitToContentHeight);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Converter.convertHTML(htmlDoc, options, outputStream);
byte[] imageBytes = outputStream.toByteArray();
Are there any other options that need to be set?
Thank you.
BandingStyle1.zip (40.4 KB)