Search code examples
c#asp.net-core-3.1system.drawingspiresystem.drawing.common

Spire.PDF.PdfDocument.print() throws System.NotImplementedException on Ubuntu LTS 20.04


Edit:I contacted the developer team. They created issue for that. I will update this post if there is any improvement. Issue Link

The project have coded using by .netCore3.1. Also I used FreeSpire.PDF v5.4. I convert the incoming pdf data to pdf using Spire.Pdf.PdfDocument and trigger the printing process.All tests on windows is successful. On Linux, it was able to convert the data(base64String) to pdfDocument. But during print it threw the NotImplementedException(You can see in SS).

message: The method or operation is not implemented.

source: System.Drawing.Common

System.Drawing.Common is used in Spire.PDF. I have not included this in the project references. (I added it later but the result is the same.)

I could not understand what to do at this stage. All the DLLs I use are compatible with .net standard or .netCore. Also i am not getting any errors in windows either.How can i solve the problem?

As an additional point of view, can I print by triggering a printer without using the Spire.PDF.PdfDocument.print () method?

NotImplementedException


Solution

  • PlatformNotSupportedException has nothing to do with any version of .NET. It is not an exception that is automatically thrown, it is one that the person writing the library chooses to throw to signify that the platform the code running on has not been catered for by that code.

    The only solution is to update to a newer version of the library, that hopefully will implement the functionality for that platform.