Wrong Text Box Position when Expoting a Presentation Slide to Image in Java

Hi,
I have tested this with aspose-slides 22.10 and 22.12 versions. When parsing uploaded pptx file(example-slide.pptx) and export slide to images. Slide has a chart with table of data, but exported image have text box in wrong possition.
Example of result image slide-result.jpg​​
Capture.PNG (89.3 KB)

example-slide.zip (217.6 KB)

slide-result.jpg (185.3 KB)

Image created:

ISlide​ slide = ......;
slide.getImage​(renderingOptions​, new Dimension(IMAGE_WIDTH, height));

Can you take a look why this is happening and how we could fix that?

@ANDREA.FARRIS

It seems you are experiencing an issue with the positioning of text boxes when exporting slides to images using Aspose.Slides. This can sometimes occur due to the way the text boxes and shapes are rendered during the export process.

To troubleshoot and potentially resolve this issue, consider the following steps:

  1. Check Text Box Properties: Ensure that the text boxes in your PPTX file are correctly defined. You can use the is_text_box property to verify that the shapes are indeed text boxes. This can help confirm that the shapes are being recognized correctly by the Aspose.Slides library.

  2. Adjust Rendering Options: When exporting the slide to an image, you might want to experiment with different rendering options. The renderingOptions parameter can be adjusted to see if it affects the output.

  3. Update Aspose.Slides Version: Since you mentioned testing with versions 22.10 and 22.12, consider checking if there are any newer versions available. Sometimes, issues are resolved in later releases, so updating to the latest version might help.

  4. Review the Export Code: Ensure that the code used for exporting the slide is correctly implemented. Here’s a basic example of how to export a slide to an image:

    from aspose.slides import Presentation
    from aspose.slides.export import ImageOptions
    
    presentation = Presentation("example-slide.pptx")
    slide = presentation.slides[0]  # Access the first slide
    image_options = ImageOptions()  # Set your image options here
    slide.get_image(image_options, new Dimension(IMAGE_WIDTH, height))
    
  5. Test with Different Slides: If possible, try exporting other slides or presentations to see if the issue is specific to the example-slide.pptx file. This can help determine if the problem lies within the specific content of that slide.

If the issue persists after trying these suggestions, consider reaching out to the Aspose support team with detailed information about your findings, including the specific versions used and any error messages encountered.

Feel free to share any additional details or screenshots that might help in diagnosing the problem further.

Sources:
[1]: Manage TextBox|Aspose.Slides for Python Documentation

I have tried all these options and results are the same.

@ANDREA.FARRIS,

Thanks for the Presentation file and screenshots.

After initial testing, I am able to reproduce the issue as you mentioned by using your Pesentation file and following sample code. I found wrong text box position rendered in the exported image.

Presentation pres = new Presentation("d:\\files\\example-slide.pptx");
Dimension size = new Dimension(960, 720);
        try {
            for (int index = 0; index < pres.getSlides().size(); index++)
            {
                ISlide slide = pres.getSlides().get_Item(index);
                IImage slideImage = slide.getImage(size);
                try {
                      slideImage.save("d:\\files\\image_java_1" + index + ".png");
                } finally {
                     if (slideImage != null) slideImage.dispose();
                }
            }
        } finally {
            if (pres != null) pres.dispose();
        }

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39612

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.