TextBox Is Not Rendered Correctly When Converting to PPTX to PDF in C#

We have a PowerPoint presentation with several text boxes that aren’t converting correctly to PDF. In some cases, the text wraps and displays outside the bounding box.

I’ve attached both the PowerPoint and the converted PDF for your review. If you compare the two, you’ll notice the issue with the text box content in the PDF.

Additionally, we need to add spacing around the borders of these PowerPoint files before conversion. I’ve included the code that handles the conversion and adds the border below.

public static void ConvertPresentationToPdf(bool adjust_border, string inputFile, string outputFile)
{
    string results = String.Empty;
    try
    {
        using (Presentation presentation = new Presentation(inputFile))
        {
            PdfOptions saveOptions = new PdfOptions
            {
                EmbedFullFonts = true // Embed all fonts in the PDF
            };

            presentation.Save(outputFile, Aspose.Slides.Export.SaveFormat.Pdf, saveOptions);
            results = "SUCCESS";
        }
        if (adjust_border)
        {
            using (Document pdfDocument = new Document(outputFile))
            {
                //One inch is equal to 72 points

                double horizontalPadding = (.3 * 72); // (new width - old width) / 2
                double verticalPadding = (.3 * 72); // (new height - old height) / 2

                // Iterate through all the pages
                foreach (Page page in pdfDocument.Pages)
                {
                    // Adjust the MediaBox and CropBox
                    page.MediaBox = new Rectangle(
                        page.MediaBox.LLX - horizontalPadding,
                        page.MediaBox.LLY - verticalPadding,
                        page.MediaBox.URX + horizontalPadding,
                        page.MediaBox.URY + verticalPadding
                    );

                    page.CropBox = new Rectangle(
                        page.CropBox.LLX - horizontalPadding,
                        page.CropBox.LLY - verticalPadding,
                        page.CropBox.URX + horizontalPadding,
                        page.CropBox.URY + verticalPadding
                    );

                    // Move the content to center it on the new page size
                    // By default, content will appear centered due to equal padding
                }

                // Save the updated PDF document
                pdfDocument.Save(outputFile);
                results = "SUCCESS";
            }

        }
        Console.WriteLine(results);
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Failure|{ex.Message}");
    }
    return;
}

Do you have any suggestions on how we can resolve this issue?

Thank you for your help!

Aspose-graphic_aid.pdf (3.6 MB)

Aspose-graphic_aid.zip (3.6 MB)

@david_j_meyer2_boeing_com,
Thank you for describing the issue. I need some time to check the issue. I will get back to you as soon as possible.

@david_j_meyer2_boeing_com,
Thank you for your patience. I’ve reproduced the problem with displaying the text when converting the PowerPoint presentation to a PDF document.

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): SLIDESNET-44953

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.

Please also share the following additional information if it is possible:

  • OS version on which the conversion was performed
  • .NET target platform in your application project

Could you please describe the expected result in more detail?

Do you know what release the fix will be made available?

@david_j_meyer2_boeing_com,
Our developers are already working on the issue. Unfortunately, I don’t have any additional information yet. Thank you for your patience.

Has any progress been made on this issue? Do you have a targeted release date that will include the fix? It is impacting our production process at times.

thanks for your help in resolving this matter.

@david_j_meyer2_boeing_com,
We expect this issue to be resolved in Aspose.Slides for .NET 25.6. This release will be published in the second half of June.