Hi Team,
I have a PPTX (attached) with 1 slide. Slide has a Chart. When I try to get image of the slide, I see that the labels on the x-axis appear slanted while in the ppt they are straight.
The code I used:
using Aspose.Slides;
using Aspose.Slides.Export;
using Aspose.Slides.Animation;
using Aspose.Slides.Charts;
using Aspose.Slides.SmartArt;
using Aspose.Slides.Ink;
using System.Drawing;
using System.Drawing.Imaging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Collections;
using System.Xml;
using System.Threading;
using System.Reflection;
using System.IO;
using System.Drawing.Text;
class Program
{
static void Main(string[] args)
{
try
{
// Load the presentation
using (Presentation presentation = new Presentation("sample.pptx"))
{
Console.WriteLine("Number of slides in the presentation: " + presentation.Slides.Count);
// Create output directory if it doesn't exist
string outputDir = "slide_images";
if (!Directory.Exists(outputDir))
{
Directory.CreateDirectory(outputDir);
}
// Convert each slide to image
for (int i = 0; i < presentation.Slides.Count; i++)
{
ISlide slide = presentation.Slides[i];
// Create a full scale image
using (IImage image = slide.GetImage(1.0f, 1.0f))
{
string fileName = Path.Combine(outputDir, $"slide_{i + 1}.png");
image.Save(fileName, Aspose.Slides.ImageFormat.Png);
Console.WriteLine($"Saved slide {i + 1} as {fileName}");
}
}
Console.WriteLine($"\nAll slides exported to images in '{outputDir}' folder");
}
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}
}
}
I used Aspose version 25.5. Pls find attached the output image as well.
Could you pls help me resolve this issue ? Thank you,
slide_1.png (38.4 KB)
sample.zip (37.8 KB)