Hi Team,
I have a sample PPTX with a single slide. The slide has a text with an underline. When I get the image of this text using Aspose, I see that the underline is partially cut. I am using Aspose 25.5 version.
The code:
using Aspose.Slides;
using Aspose.Slides.Export;
using System.Drawing.Imaging;
class Program
{
static void Main(string[] args)
{
try
{
// Load the presentation
using (Presentation presentation = new Presentation("sample.pptx"))
{
int shapeCounter = 1;
// Loop through all slides
for (int slideIndex = 0; slideIndex < presentation.Slides.Count; slideIndex++)
{
// Get current slide
ISlide slide = presentation.Slides[slideIndex];
// Process each shape in the current slide
foreach (var curShape in slide.Shapes)
{
using (var curImage = curShape.GetImage())
{
// Save the image with a unique name including slide number
string fileName = $"slide_{slideIndex + 1}_shape_{shapeCounter}.png";
curImage.Save(fileName, Aspose.Slides.ImageFormat.Png);
Console.WriteLine($"Image saved successfully as {fileName}");
shapeCounter++;
}
}
}
}
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}
}
}
sample.zip (36.3 KB)
Screenshot (111).png (56.7 KB)
Pls help us resolve this issue. Thanks,