Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Sep 19, 2022 12:07 am

Microsoft no longer supports System.Drawing library which appears to be core to the Spire Pdf library.
Since I can't post a URL here you can search for '.net core 6 linux system-drawing-common-windows-only' and should find references to this issue.

This affects the latest Ubuntu which has .Net Core 6.0 built in. You cannot run .Net Core 5 on the latest nor do I want to.

Do you have any updates for the Spire.PDF library which do not depend on SystemDrawing?

barbedcoil
 
Posts: 2
Joined: Sun Sep 18, 2022 11:59 pm

Mon Sep 19, 2022 3:26 am

Hello barbedcoil,

Thanks for your inquiry.
Yes, Microsoft made a statement that there will be errors when using System.Drawing library on non-Windows operating systems from .NET6.0 onwards. Kindly note that our NetStandard dlls are not dependent on System.Drawing.Common, they are dependent on SkiaSharp library. You can install the latest Spire.Officefor.NETStandard 7.9.0 via NuGet installation. It includes our Spire.PDF product. If you have any problems after testing, please feel free to contact us.
https://www.nuget.org/packages/Spire.Of ... dard/7.9.0

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Mon Sep 19, 2022 10:55 am

Hi,
I have also the drawing issue on Linux.
See my stacktrace.
I use the "FreeSpire.PDF" Version="8.6.0" and the compile target is .net 6.0.
Do I use the right version or is this an issue?

Error Message:
Test method DigitalSales.Shared.Helper.Pdf.Tests.PdfConversion.PdfConverterTests.Shrink_Valid_Pdf_To_Two_Pages threw exception:
System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See ... for more information.
Stack Trace:
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 System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at sprᦥ.ᜁ(Int32 A_0, Int32 A_1, Int32 A_2, Int32 A_3)
at sprᦥ.ᜁ(Int32 A_0, Int32 A_1, Int32 A_2)
at Spire.Pdf.PdfDocumentBase.ᜀ(Int32 A_0, Int32 A_1, Int32 A_2)
at Spire.Pdf.PdfDocumentBase.ᜁ(Int32 A_0)
at Spire.Pdf.PdfDocument.SaveAsImage(Int32 pageIndex)

rolandjoe
 
Posts: 1
Joined: Mon Sep 19, 2022 10:48 am

Mon Sep 19, 2022 1:12 pm

I do not need the entire Office package, I just need to fill out a simple pdf form.
Thanks anyway

Simple.Li wrote:Hello barbedcoil,

Thanks for your inquiry.
Yes, Microsoft made a statement that there will be errors when using System.Drawing library on non-Windows operating systems from .NET6.0 onwards. Kindly note that our NetStandard dlls are not dependent on System.Drawing.Common, they are dependent on SkiaSharp library. You can install the latest Spire.Officefor.NETStandard 7.9.0 via NuGet installation. It includes our Spire.PDF product. If you have any problems after testing, please feel free to contact us.


Sincerely,
Simple
E-iceblue support team

barbedcoil
 
Posts: 2
Joined: Sun Sep 18, 2022 11:59 pm

Tue Sep 20, 2022 7:03 am

Hello rolandjoe,

Thanks for your inquiry.
As for your situation, you can download our MSI Free Spire.PDF for .NET Version:8.6, after you install it, you will find the netstandard2.0 folder from the installation directory, you need to manually reference the dlls from this folder and add the following dependency libraries to use it.
SkiaSharp >= 1.68.0
System.Text.Encoding.CodePages >= 4.5.0
System.Memory >= 4.5.0
System.Buffers >= 4.5.0
System.Runtime.CompilerServices.Unsafe >= 4.5.0
Meanwhile, kindly note that our Free version is limited to 10 pages of PDF. This limitation is enforced during loading and creating files. When converting PDF to Image, the first 3 pages of PDF files will be converted to Image format successfully. If your document exceeds the limitation, you can upgrade to install our commercial version (Spire.Officefor.NETStandard 7.8.4) via Nuget. We are willing to provide a temporary license (one month free) of Spire.PDF for .NET to help you remove the warning message and evaluate our commercial version better. If you need it, please feel free to write back.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Tue Sep 20, 2022 7:10 am

Hello barbedcoil,

Thanks for your feedback.
Sorry there isn't the separate Spire.PDFfor.NETStandard package. You also can download our Spire.PDF Pack(Hot Fix) Version:8.9.2, manually reference the dlls from the netstandard2.0 folder, and then add the following dependency libraries to use it.
SkiaSharp >= 1.68.0
System.Text.Encoding.CodePages >= 4.5.0
System.Memory >= 4.5.0
System.Buffers >= 4.5.0
System.Runtime.CompilerServices.Unsafe >= 4.5.0
If there is any other issues, just feel free to contact.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Mon Mar 13, 2023 9:11 pm

Tried installing the latest Spire.Officefor.NETStandard 8.22 via NuGet installation as suggested in this post in order to use Spire.PDF.

The project is an Azure Function (4.1.3) that needs to fill in some PDF form fields from a template PDF.

However, when trying to set the text of a textBoxField it fails with the following error:

System.Private.CoreLib: Exception while executing function: freespire. SkiaSharp: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibSkiaSharp, 0x0001): tried: 'liblibSkiaSharp' (no such file), '/usr/local/lib/liblibSkiaSharp' (no such file), '/usr/lib/liblibSkiaSharp' (no such file), '/Users/bsinz/code/services/pdfboss/bin/Debug/net6.0/liblibSkiaSharp' (no such file), '/usr/local/lib/liblibSkiaSharp' (no such file), '/usr/lib/liblibSkiaSharp' (no such file).

Any help is appreciated!

pdfgenerator
 
Posts: 1
Joined: Mon Mar 13, 2023 9:02 pm

Tue Mar 14, 2023 7:12 am

Hello pdfgenerator,

Thanks for your inquiry.
According to your description, I guess your test environment is Linux. Please note that when testing on Linux, you need to install "SkiaSharp.NativeAssets.Linux.NoDependencies 2.88.3" through NuGet to avoid program running errors.
If the issue still exists, please offer us a sample project which could reproduce your issue directly. You could upload it here or send us(support@e-iceblue.com) via email.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF