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.

Wed Jul 20, 2022 7:41 am

Hi,

Following code throws Exception on Ubuntu operating system.

Code is:
Code: Select all
 PdfDocument document = new PdfDocument();
                document.LoadFromFile(@".\1.pdf");

                foreach (PdfPageBase page in document.Pages)
                {
                    string pageText = page.ExtractText();
                }


Operating system is: Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-159-generic x86_64)

Error is:
System.PlatformNotSupportedException: System.Drawing is not supported on this platform.
at System.Drawing.Drawing2D.GraphicsPath..ctor()
at spr㪻..ctor(PdfPageBase A_0, spr㠍 A_1, spr㗳 A_2, spr㪪 A_3)
at spr㪽.ᜀ(spr㠍 A_0, spr㗳 A_1)
at spr㪽.ᜀ()
at spr㪶.ᜁ(PdfPageBase A_0)
at Spire.Pdf.Texts.PdfTextExtractor.ᜀ(PdfTextExtractOptions A_0)
at Spire.Pdf.Texts.PdfTextExtractor.ExtractText(PdfTextExtractOptions options)

I am using latest version of Spire.Office package from nuget.

Do you know how can I resolve this issue?

Best regards,
Filip

filipfilipfilip
 
Posts: 45
Joined: Mon Jun 14, 2021 10:27 am

Wed Jul 20, 2022 10:20 am

Hi,

Thank you for your inquiry.
Please note that Spire.Office installed directly from nuget is for .NETCore dll, and it has the dependency System.Drawing.Common. But now the dependency is no longer supported on non-windows systems. To solve your issue, please install Spire.Officefor.NETStandard v7.7.2 from nuget.
Please feel free to contact us if you have any questions.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Return to Spire.PDF