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.

Tue Feb 14, 2023 7:08 am

I am using spire pdf for Watermark functionality in .net 6.0.
I am getting the below error when I run the application in a Linux container

"System.Drawing.Common is not supported on non-Windows platforms."

sterlingfordev
 
Posts: 13
Joined: Wed Jan 25, 2023 5:31 am

Tue Feb 14, 2023 9:25 am

Hi,

Thanks for your inquriry.
Our Spire.PDF provides NET6 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.PDF uses the SkiaSharp to replace the System.Drawing.Common. It can work with non-windows operating system, also it is compatible with the NET6 platform. To avoid your issue, please download the Spire.PDF from our website (the latest version is Spire.PDF Pack(Hot Fix) Version:9.2.2), 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 >= 1.68.0
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 Jun 16, 2023 8:26 pm

Greetings,

We've been using Spire.PDF tools for a few years now and have been pretty happy with the results. We have a build of our product that is a Docker instance (Linux) that was able to print on non-Windows systems for some time. We have been using Spire.PDF.NETCore when it was initially released. When doing vulnerability scans, we noticed that this package has not been updated since 2021 so there's no way to correct those.

Flash forward, we decided to build against the Spire.PDF, added the appropriate SkiaSharp package references (were already there in this case), linux dependencies, and have even tried manually copying the Spire.Pdf.dll from the netstandard20 directory as suggested.

No matter what we try, we continue to get the non-Windows error pertaining to the loading of System.Drawing.dll.

Is there going to be any update where these native dependencies can be corrected and just added to a nuget package with native dependencies based on the platform?

Has anyone else here actually succeeded (with Spire.PDF) using the suggestions posted here in this thread?

Thank you.

rcichielo
 
Posts: 4
Joined: Thu Dec 10, 2020 12:44 pm

Mon Jun 19, 2023 8:26 am

Hello,

Sorry for the late reply due to the weekend.
Please remove all dll files related to our product from your project first, and then install Spire.Office for .NET Standard and SkiaSharp.NativeAssets.Linux.Nodependencies via Nuget. If your issue still exists after trying, and we will investigate further.

Sincerely,
Swain
E-iceblue support team
User avatar

Swain.Wang
 
Posts: 34
Joined: Thu Jun 01, 2023 3:55 am

Wed Jun 21, 2023 3:06 pm

Swain,

We replaced/added our references with Spire.PDF, Spire.Office for .NET Standard and the SkiaSharp.NativeAssets.Linux.Nodependencies packages, but now we're no longer seeing definitions for PrintSettings, PdfPaperSizes, etc. so our compilation now fails.

Examining the Spire.Pdf.PdfDocument class, there doesn't appear to be a PrintSettings member, though I do see it referenced in recent posts in this forum.

Something simple we're missing here?

Regards,

Rob

rcichielo
 
Posts: 4
Joined: Thu Dec 10, 2020 12:44 pm

Thu Jun 22, 2023 1:51 am

Hi Rob,

Thanks for your feedback.
Our .NET Standard package uses SkipSharp to replace System.Drawing and does not support the PrintSettings class. Sorry for the inconvenience caused.

Best regards,
Triste
E-iceblue support team
User avatar

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

Thu Jun 22, 2023 1:57 am

So… the printing functions are now deprecated? Are there any plans to restore these functions? This was the primary reason for licensing the Spire.PDF product.

rcichielo
 
Posts: 4
Joined: Thu Dec 10, 2020 12:44 pm

Thu Jun 22, 2023 2:11 am

Hi,

Since we are on the Chinese Dragon Boat Festival holiday , when we get back to the office after this weekend holiday, I will consult our developers and give you feedback as soon as possible. Apologize for the inconvenience caused.

Best regards,
Triste
E-iceblue support team
User avatar

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

Fri Jun 23, 2023 12:15 pm

Update: we've updated our project to use the latest Spire.PDF and related packages and we can build by removing references to the PrintSettings and the page size attributes. Since we print via IPP, many of these properties can be delivered to the print device in that manner.

We use the Spire.PDF library mainly to convert PDF into PCL, PS or XPS so we can send to a printer. We find that many printers do not accept the output from the Spire.PDF library. If we go back to the Spire.PDF.NETCore (no longer supported and based on libgdiplus), PCL, PS and XPS output is as expected and is supported by the many printers we've tried. These are not $99 printers, they are office-class Lexmark, Xerox, Sharp, Minolta and other products that now fail.

What's the best way forward? Should we provide documents that fail for your dev team?

Thank you.

rcichielo
 
Posts: 4
Joined: Thu Dec 10, 2020 12:44 pm

Sun Jun 25, 2023 9:28 am

Hi,

Thanks for your feedback.
Apologize for my mistake, our Spire.PDF.NETCORE is currently constantly being updated, due to some changes, we have integrated it into our Spire.PDF, you can directly install the Spire.PDF via nuget in your .nercore application or manually add the dll in the .netcoreapp 2.0 (or 3.0) folder.

If you have any further questions, just feel free to contact us.

Best regards,
Triste
E-iceblue support team
User avatar

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

Return to Spire.PDF