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 10, 2024 6:07 pm

Hello,

I have an issue with the last version of Spire.PDF .NET Library (not the free one), when i am calling the SaveAsImage method from the PdfDocument Object, it throws at runtime a System.MissingMethodException (no error during the compiling).

This problem occurs only on the Spire.PDF Library, but with the FreeSpire.Pdf, i don't have the problem, can you tell me why ?
=> I am using it inside a .net standard 2.0 project.

Thanks in advance for your help.

Johnatan.Carlin
 
Posts: 9
Joined: Wed Jul 10, 2024 6:01 pm

Thu Jul 11, 2024 3:22 am

Hi,

Thanks for your inquiry.
I used our Spire.PDF 10.6.25 to test the code below, but didn't encounter the issue you mentioned. If you didn't use our latest version, I suggest you update to it. If the issue still persists, please provide your document for our investigation and testing. Thanks in advance!

Code: Select all
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile("GetZoomFactor.pdf");
Stream stream = pdf.SaveAsImage(0);
SKBitmap bitmap = SKBitmap.Decode(stream);
SKImage sKImage = SKImage.FromBitmap(bitmap);
FileStream fileStream = File.OpenWrite("PDFTest.jpg");
sKImage.Encode(SKEncodedImageFormat.Jpeg, 100).SaveTo(fileStream);


Spire.PDF 10.6.25: https://www.e-iceblue.com/Download/down ... t-now.html

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 409
Joined: Mon Nov 07, 2022 8:10 am

Thu Jul 11, 2024 11:43 am

Thanks for your reply, but even with your code, still doesn't work for me, i have another error relate to SkiaSharp missing dll.
You can find my code on github : johnatancarlin/pdfrepository/tree/feature/spire to see what is wrong.

Thanks again

Johnatan.Carlin
 
Posts: 9
Joined: Wed Jul 10, 2024 6:01 pm

Fri Jul 12, 2024 6:21 am

Hi,

Thank you for your information.
Please uninstall Spire.PDF from your project and install Spire.PDFfor.NETStandard from nuget instead. I've downloaded your project and tested it with this change, and it works fine. If you encounter any further issues, feel free to give feedback.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 409
Joined: Mon Nov 07, 2022 8:10 am

Fri Jul 12, 2024 1:25 pm

Thanks for your answer.

I have put the net standard library on my project (see the attachement spirepdfnetstandardlibrary.png) but i have a new error (see the attachement error pdfnetstandard.png)

the code is updated on git.

thanks in advance.

Johnatan.Carlin
 
Posts: 9
Joined: Wed Jul 10, 2024 6:01 pm

Mon Jul 15, 2024 6:35 am

Hi,

Thank you for your feedback and sorry to reply late for weekend.
I have modified your project and uploaded it. Please download the attached project and run it directly. It works fine on my side. If you still encounter any issues, please let us know.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 409
Joined: Mon Nov 07, 2022 8:10 am

Mon Jul 15, 2024 7:07 pm

Thanks, it's working now ! And from what i seen, it's related to a missing nuget reference (SkiaSharp).

Can you update the documentation in this part? because the existing one doesn't match with this solution.

Thanks again for your help

Johnatan.Carlin
 
Posts: 9
Joined: Wed Jul 10, 2024 6:01 pm

Tue Jul 16, 2024 9:15 am

Hi,

Thanks for your feedback and I'm glad to hear that it's working now!
Regarding the missing NuGet reference issue with SkiaSharp, the README file included in the package downloaded from our official website does mention the need to reference SkiaSharp. The installation dependencies on NuGet are as follows. Could you please provide the link to the documentation you were referring to? This will help us further optimize it. Your suggestion is greatly appreciated, and we will work on improving the documentation accordingly. Thank you for your help!

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 409
Joined: Mon Nov 07, 2022 8:10 am

Fri Jul 19, 2024 7:57 pm


Johnatan.Carlin
 
Posts: 9
Joined: Wed Jul 10, 2024 6:01 pm

Mon Jul 22, 2024 8:34 am

Hi,

Thank you very much for your feedback.
We do include the section "Install Spire.PDF for .NET" in each tutorial, but due to the fact that different frameworks require different dependencies, we have chosen not to list the specific dependencies for each framework in this section in order to keep the tutorial concise and enhance the reading experience for our customers. Instead, please refer to the Dependencies section under the Nuget page of the specific product to obtain the additional dependencies that need to be installed. Thank you again for your feedback, and I hope my response has been helpful to you.

https://www.nuget.org/packages/Spire.PD ... s-body-tab

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 409
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.PDF