It seems you’re experiencing issues with text underlining and positioning when saving a range as an image in Aspose.Cells. Here are a few suggestions to address these problems:
Image Type: Consider using a different image type, such as ImageType.Png or ImageType.Jpeg, as they may handle text rendering differently and could improve the appearance of underlines.
Text Formatting: Ensure that the text formatting in your Excel range is correctly set before rendering. Discrepancies can arise from how the text is formatted in the original document.
Image Options: Adjust the ImageOrPrintOptions settings. For example, setting OnlyArea to false might help capture the entire area of the range, which could affect how the text is rendered.
Here’s a modified version of your code snippet with a different image type:
private static ImageOrPrintOptions _options = new ImageOrPrintOptions()
{
HorizontalResolution = 300,
VerticalResolution = 300,
OnePagePerSheet = true,
OnlyArea = false, // Change this to false
ImageType = ImageType.Png // Try using PNG
};
Testing Different Resolutions: Experiment with different resolutions to see if that affects the rendering of the underline and overall text appearance.
If these suggestions do not resolve the issue, consider exploring the Aspose.Cells documentation for more detailed options related to image rendering and text formatting.
Feel free to reach out if you have more questions!