Hello team.
While evaluating Aspose.HTML for Java 26.3, we noticed that table borders styled with border-style: dashed are not rendered faithfully when converting HTML to PNG. The dashes in the output PNG appear significantly shorter and more densely packed compared to how the browser renders the same HTML. The dash length and gap rhythm are visually incorrect.
Steps to Reproduce
Create an HTML table with a dashed border, e.g.:
<table style="border: 5px dashed #000; border-collapse: collapse;">
<tr>
<td style="border: 5px dashed #000; padding: 8px;">Cell 1</td>
<td style="border: 5px dashed #000; padding: 8px;">Cell 2</td>
</tr>
</table>
Convert to PNG using the following code:
HTMLDocument htmlDoc = new HTMLDocument("Grid Dashed Border 5px Test.html");
ImageSaveOptions options = new ImageSaveOptions(ImageFormat.Png);
options.setHorizontalResolution(Resolution.to_Resolution(300d));
options.setVerticalResolution(Resolution.to_Resolution(300d));
options.getPageSetup().setPageLayoutOptions(
PageLayoutOptions.FitToContentWidth |
PageLayoutOptions.FitToContentHeight);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Converter.convertHTML(htmlDoc, options, outputStream);
byte[] imageBytes = outputStream.toByteArray();
Open the output PNG and compare the dashed borders against the browser rendering of the same HTML.
Expected Behavior
The dashed border in the PNG output should match the browser rendering — with dash lengths and gaps consistent with the standard border-style: dashed appearance.
Actual Behavior
The PNG output shows dashed borders where:
The individual dashes are shorter than expected
The dashes are more frequent (higher count per unit of border length)
The result is visually inconsistent with the browser and with the source HTML intent
Attached is a 7z archive
test_dashedBorder.7z (54.7 KB)
containing:
- The input Grid Dashed Border 5px Test.html file
- The output Grid Dashed Border 5px Test-v26.3.png file
- A screenshot or annotated comparison highlighting the difference
Please let us know if you need more information.
Thank you.