Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Thu Jul 06, 2023 9:17 am

Hi E-ICEBLUE!

We have been using an older version of Spire.Presentation and .NET 3.1 on Linux and macOS to generate PNG images with good success. I'm testing the newest 8.7.0 release with .NET 7.0 and it looks like System.Drawing and libgdiplus are no longer supported.

Does Spire.Presentation support SkiaSharp or any other graphics engines for non-Windows platforms? If so, is there an example of how to set it up? Below is an example of an error I get on Linux.

Thanks!

Code: Select all
System.AggregateException: One or more errors occurred. (Microsoft PowerPoint 2007 file is corrpt.)
 ---> Spire.Presentation.DocumentUnkownFormatException: Microsoft PowerPoint 2007 file is corrpt.
 ---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
 ---> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information.
   at System.Drawing.LibraryResolver.EnsureRegistered()
   at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize()
   at System.Drawing.SafeNativeMethods.Gdip..cctor()
   --- End of inner exception stack trace ---
   at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, IntPtr scan0, IntPtr& bitmap)
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
   at spr᝿..ctor(spr᪕ A_0, spr᪔ A_1)
   at spr᪔.ᜀ()
   at spr᪔.ᜁ(spr㎜ A_0)
   at spr᪔..ctor(Stream A_0, Boolean A_1)
   --- End of inner exception stack trace ---
   at spr᪔..ctor(Stream A_0, Boolean A_1)
   at spr᝝.ᜁ(Stream A_0)
   at spr᝝.ᜃ(Stream A_0)
   at spr᝝..ctor(String A_0, sprᰮ A_1)
   at spr᝝..ctor(String A_0)
   at Spire.Presentation.Presentation.LoadFromFile(String file)

joelwmmd
 
Posts: 3
Joined: Thu Jul 06, 2023 9:09 am

Thu Jul 06, 2023 9:42 am

Hi,

Thank you for your inquiry.
Our Spire.Presentation provides NET 7 dll, which depends on System.Drawing.Common. This library is not supported on non-windows operating system from NET6.
Please note our netstandard dll in Spire.Presentation uses the SkiaSharp to replace the System.Drawing.Common. It can work with non-windows operating system, also it is compatible with the NET7 platform. To avoid your issue, please download the Spire.Presentation.zip from our website (https://www.e-iceblue.com/Download/download-presentation-for-net-now.html), and manually add the DLLs from the folder “netstandard2.0” into your project, then install the following dependencies from Nuget. Or you can directly install our Spire.Officefor.NETStandard via NuGet Manager, which has included all the following dll files.
SkiaSharp.NativeAssets.Linux.NoDependencies>= 1.68.1
System.Text.Encoding.CodePages >= 4.5.0
System.Security.Cryptography.Xml >=4.5.0
If you have any other questions, just feel free to contact us.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Fri Jul 07, 2023 3:16 am

Thank you Triste! It was a bit fiddly but I was eventually able get this to work. In case anyone else needs this information, I'l share it here.

I downloaded Spire.Presentation 7.8 from your link, then extracted the MSI file using msiextract.

Here's my csproj file:

Code: Select all
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp7.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <!-- Path is the location of the extracted msi archive -->
    <Reference Include="..\sp78\Program Files\e-iceblue\spire.presentation\Bin\netstandard2.0\Spire.Presentation.dll" />

    <PackageReference Include="SkiaSharp" Version="2.88.3" />
    <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.3" />
    <PackageReference Include="System.Resources.Extensions" Version="[4.6.0,)" />
    <PackageReference Include="System.Security.Cryptography.Xml" Version="[4.5.0,)" /> -->
  </ItemGroup>

</Project>

joelwmmd
 
Posts: 3
Joined: Thu Jul 06, 2023 9:09 am

Fri Jul 07, 2023 6:42 am

Dear joelwmmd,

Thank you very much for your feedback and sharing.
If you don't want to add it manually, you can also install Spire.Office for.NETStandard 8.6.0 directly using the NuGet tool. It only contains the netstandard2.0 dlls and relies on the SkiaSharp. But, Spire.Office for.NETStandard 8.6.0 does not include the latest Spire.Presentation v8.7.0 yet, it includes Spire.Presentation v8.6.0. However, its' next version will be updated to include the latest Spire.Presentation v8.7.0.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1271
Joined: Wed Apr 25, 2018 3:20 am

Fri Jul 07, 2023 7:51 am

Thanks Lisa! Yes - that sounds much easier! I will try that next.

Joel

joelwmmd
 
Posts: 3
Joined: Thu Jul 06, 2023 9:09 am

Fri Jul 07, 2023 10:15 am

Hello,

Thanks for your quick feedback.
We just updated the Spire.Officefor.NETStandard 8.7.0 which includes Spire.Presentation v8.6.0. You can test it.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1271
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.Presentation

cron