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 Nov 02, 2022 6:29 pm

Hi, I have a library that is intended to be multi-platform, so to avoid the issues with Images on non-Windows environments I'm using the .netstandard 2.0 version of Spire.Pdf.dll (version 7.10.0).

The process of extracting the image to a stream is far slower and memory intensive than anticipated. It is for example taking between 17 and 23 seconds per page to extract the image and Visual Studio reports 2Gb of memory used for the first image (that when saved is 171Kb) and this grows by around 1Gb per page.

Screenshot 2022-11-02 at 18.24.28.png


Given that some of the test files I'm looking to process are over 450 pages long, the current implementation wouldn't seem be usable. It I refactor the code to use the .net6 version of the code the memory usage is far more reasonable and I can process the 30 page test file in much less time than processing a single page in the .netstandard 2.0 version.

All help appreciated,

Darren.

wraydc
 
Posts: 130
Joined: Wed Apr 11, 2018 5:14 am

Thu Nov 03, 2022 10:28 am

Hello,

Thanks for your inquiry.
Yes, when converting pdf file to image, the time and memory when using .net6 version is smaller than that consumed by the.netstandard 2.0 version, due to for graphics processing, the net6.0 version relies on the underlying graphics library provided by platform (such as using System.Drawing), while the .netStandard version relies on the SkiaSharp library.
To help us check whether time and memory consumption can be optimized for your document. Please offer the following message. Thanks for your assistance in advance.
1) Your Pdf document, you can attach here or send it to us via email ([email protected]). In addition, if your pdf is large file, you could upload your large file via Dropbox or OneDrive server, then share us with the download link.
2) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.PDF