It is the .net maui project. On macos, Aspose.Words.Pdf2Word is used. When converting pdf to docx, an exception occurs

It is the net maui 8.0 project. On macos, Aspose.Words.Pdf2Word is used. When converting pdf to docx, an exception occurs.
Exception has been thrown by the target of an invocation.
The type initializer for ‘Aspose.Words.Pdf2Word.PdfDocumentReaderPlugin’ threw an exception.

exception infomation:
2024-07-0212:34:42.545Info]>ConvertPdfToDocx 33 filename
=/Users/hotsoon
Documents/LW LAB190027 D0R Consumer Brochure_V24_spreads.pdf
2024-07-02 12:34:42.546Info]>ConvertPdfToDocx newfilename = /Users/hotsoon
Documents/LW LAB190027 D0R Consumer Brochure_V24_spreads.docx
2024-07-02 12:34:42.631 Info]>[DocumentFormatConvert]ConvertFile Failed! ex
=Exception has been thrown by the target of an invocation.
2024-07-02 12:34:42.633 [Info]>[DocumentFormatConvert]ConvertFile Failed! St
ackTrace =
at Aspose.Words.Document.v(Stream d,LoadOptionsv)
at Aspose.Words.Document.d(Stream d,LoadOptionsv)
at Aspose.Words.Document..ctor(String fileName, LoadOptions loadOptions)
at Aspose.Words.Document..ctor(String fileName)
at DemoMauiApp.Common.DocumentFormatConvert.ConvertPdfToDocx(String filename
String newfilename)in /Users/hotsoon/program/DemoMauiApp/Common/Doc
umentFormatConvert.cs:line 95
2024-07-02 12:34:42.633 [Info]>[DocumentFormatConvert]ConvertFile Failed! ex
InnerException.Message=The type initializer for 'Aspose.Words.Pdf2Word.PdfDoc
umentReaderPlugin'threwanexception.
2024-07-02 12:34:42.634[Info]>[DocumentFormatConvert]ConvertFile Failed! ex
InnerException.StackTrace=
at System.Reflection.MethodBaseInvoker.Interpret
edInvoke Constructor(0bject obj,IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFl
ags invokeAttr)

@chen_xulin Please make sure Aspose.Words.Pdf2Word.dll is deployed properly with your application. If possible, could you please attach a sample project that will allow us to reproduce the problem? We will check the issue and provide you more information.

TestMauiApp.zip (223.9 KB)

dotnet build -f net8.0-maccatalyst -c Debug

Sample project is attached.

@chen_xulin Thank you for providing us with a sample project, we will check it.

@chen_xulin
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27164

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thank you very much.

1 Like