Hi Team,
I’m facing an issue where PPT/PPTX → PDF conversion works correctly on Windows, but fails on Linux.
Below are my environment details:
- .NET Core: 3.1
- OS: Linux (Amazon EC2)
- Aspose.Slides version: 22.12.0
- License: Valid Aspose license is applied
- Code: Using standard Presentation → Save(Pdf) API call
- Windows Result: Works fine
- Linux Result: Fails / produces empty or corrupted PDF
Questions
- Is there any additional dependency required for Aspose.Slides PDF export on Linux?
I found some references to SkiaSharp dependencies. Do we need these for Aspose.Slides on Linux?
- If SkiaSharp is required, should we use:
SkiaSharp.NativeAssets.Linux
- or
SkiaSharp.NativeAssets.Linux.NoDependenciesWhich one is recommended for Amazon Linux EC2?
- Can you please share the correct / recommended sample code for converting PPT/PPTX → PDF using Aspose.Slides in .NET Core (Linux compatible)?
- Does version 22.12 have known issues on Linux?
Is an upgrade required?
Additional Notes
If there are specific Linux packages that must be installed (freetype, libfontconfig, cairo, etc.), please share the list required for Aspose.Slides PDF rendering.
Thank you.
Looking forward to your guidance.
@ragu2736
Summary
Converting PPT/PPTX to PDF works on Windows but produces an empty or corrupted PDF on your Amazon Linux EC2 instance. This usually means that the native rendering components required by Aspose.Slides for PDF export are not available on the Linux machine.
Why it happens
- On non‑Windows platforms Aspose.Slides uses a native graphics engine (Skia) for PDF rendering.
- The Skia native binaries are not part of the .NET runtime; they must be supplied either via the appropriate SkiaSharp native‑assets NuGet package or by installing the corresponding system libraries yourself.
- If the native libraries cannot be loaded, Aspose.Slides falls back to a stub implementation that results in an empty or corrupted PDF.
What to do next
- Add the SkiaSharp native assets
- Add a SkiaSharp native‑assets package to your project (e.g.,
SkiaSharp.NativeAssets.Linux). This package bundles the required .so files for Linux.
- If you prefer to provide the native libraries yourself, use the
SkiaSharp.NativeAssets.Linux.NoDependencies package and place the appropriate .so files on the system.
- Make sure basic graphics/font libraries are present
- Install the common Linux graphics/font packages (such as
fontconfig, freetype, cairo, pango, etc.) that Skia depends on. The exact package names depend on your Linux distribution.
- Enable Aspose.Slides internal logging to see which native library fails to load:
Aspose.Slides.Logging.Logger.SetLogLevel(Aspose.Slides.Logging.LogLevel.Debug);
Aspose.Slides.Logging.Logger.SetLogFile("slides.log");
Review slides.log for messages about missing DLLs or other errors.
4. Test with a minimal reproducible sample
using Aspose.Slides;
using Aspose.Slides.Export;
class Program
{
static void Main()
{
// Apply license
var license = new License();
license.SetLicense("Aspose.Slides.NET.lic");
// Load presentation
using var pres = new Presentation("sample.pptx");
// Save as PDF
pres.Save("output.pdf", SaveFormat.Pdf);
}
}
Run the program on the EC2 instance (dotnet run). If the PDF is still empty, capture any exception (e.g., DllNotFoundException) and include the log output when seeking further help.
5. Consider upgrading
- If you are able to test a newer Aspose.Slides version, do so – newer releases often improve native‑asset handling on Linux.
- Collect diagnostic information if the problem persists
- Exact exception text and stack trace.
- Output of
dotnet --info.
- List of installed graphics/font packages (
rpm -qa | grep -E 'fontconfig|freetype|cairo|pango').
- A small PPTX file that reproduces the issue.
Note: There is no publicly documented bug specific to version 22.12 on Linux at the time of writing. Verify the above steps and, if the issue remains, provide the diagnostic details to Aspose support for deeper investigation.
I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.
@ragu2736,
Thank you for contacting free support. Please note the following.
Currently, there are two main builds of Aspose.Slides for .NET:
This is the main version of the product. It uses the standard .NET graphics engine.
- On non-Windows platforms, you may need to install the
libgdiplus library and its dependencies.
- Prior to version Aspose.Slides 25.3, for non-Windows platforms, it was necessary to use the .NET Standard 2.0 DLL from the Aspose.Slides ZIP package.
- Starting from version Aspose.Slides 25.3, the NuGet package can be used directly even on non-Windows systems.
- When running on non-Windows systems, your application must include the following line at startup:
AppContext.SetSwitch("System.Drawing.EnableUnixSupport", true);
- Starting from version 25.3, you can use this package on platforms that support .NET, such as Linux aarch64 (ARM64).
This is the version of Aspose.Slides using a proprietary cross-platform graphics engine developed by the Aspose.Slides team.
On non-Windows platforms, the fontconfig library may be required.
Supported Platforms
- Windows: x86, x86_64
- Linux: x86_64
- macOS: x86_64, ARM64
Planned for Future Support
- Linux: aarch64 (ARM64) — ETA: end of 2025
Not Planned
- Windows 11 ARM (ARM64) — Not currently under consideration
We hope this information is sufficient.
System Requirements|Aspose.Slides Documentation