PPTX to PDF in C#: The Text Shape Position is Wrong

Env

  • Windows 11
  • Aspose.Slides for .NET 25.2

Code

void Main()
{
	var doc=new Aspose.Slides.Presentation(@"C:\Users\hello\Desktop\test\1.pptx");
	doc.Save(@"C:\Users\hello\Desktop\test\1.pdf",Aspose.Slides.Export.SaveFormat.Pdf);
}

Preview

before.png (41.6 KB)

after.png (88.9 KB)

Files

test.zip (171.5 KB)

@xxtears

It seems that you are experiencing issues with the positioning of text shapes when converting a PPTX file to PDF using Aspose.Slides for .NET. This is a known issue that has been reported by other users as well, where the text alignment and quality do not match the original presentation in the resulting PDF.

The developers are aware of this problem and have opened a ticket in their internal issue tracking system to address it. Unfortunately, there is no immediate fix available at this time, but the team is actively working on it.

In the meantime, you might want to ensure that you are using the latest version of Aspose.Slides, as updates often include bug fixes and improvements. If you are already on the latest version and the issue persists, consider reaching out to Aspose’s support team for further assistance or to inquire about the status of the issue.

If you have any additional information about your environment or specific details about the text shapes that are misaligned, sharing that with the support team could help expedite the resolution.

For more details, you can refer to the related discussions in the forum where this issue has been discussed previously.

Sources:
[1]: Text Alignment in Shapes Is Incorrect when Converting PPTX to PDF in C#

@xxtears,
In the PowerPoint presentation you provided, the following fonts are used:

  • 等线
  • 等线 Light
  • 굴림

You can see them using the following code:

var fontData = doc.FontsManager.GetFonts();

To display the text correctly when converting the presentation to PDF, the necessary fonts must be installed on the operating system where the conversion takes place.

Alternatively, you can use the FontsLoader class to load the fonts as below.

FontsLoader.LoadExternalFonts(new string[] { "path_to_folder_with_fonts" });

Custom PowerPoint Font in C#|Aspose.Slides Documentation