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 Oct 18, 2023 2:00 pm

If a document has 12,000 pages, the SaveAsStream function takes over 6 minutes.
Is there a way to shorten this time?

sterlingfordev
 
Posts: 13
Joined: Wed Jan 25, 2023 5:31 am

Thu Oct 19, 2023 6:58 am

Hi,

Thank you for your inquiry.
In order to help us reproduce and investigate your issue, please share the following information.Thanks in advance.
1)Your input test file, you can attach here or send it to us via email (support@e-iceblue.com).
2) Your full test code that can reproduce your issue.
3)Application type, such as Console App, .NET Framework 4.8.
4)Your test environment, such as OS info (E.g. Windows 7, 64-bit).

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Fri Oct 20, 2023 10:15 am

Loading the file stream and converting it to SaveToStream takes longer than 6 minutes. There is no logic behind it.

1 . Sample Code :

var pdfFilePath = @"D:\Users\5_50_MB_12040_Pages.pdf";

Stream stream = File.OpenRead(pdfFilePath);

using (PdfDocument doc = new PdfDocument())
{
doc.LoadFromStream(fileStream);

doc.SaveToStream(outputStream, FileFormat.PDF);

}

2. sample document download link : https://we.tl/t-9SXyIoozSt?utm_campaign ... TRN_TDL_05

3. netstandard2.0

4. Windows 2019, 64 – bit.

sureshkumar.arumugam
 
Posts: 11
Joined: Fri Apr 28, 2023 6:13 am

Mon Oct 23, 2023 7:11 am

Hi,

Thank you for your inquiry.
I used our latest Spire.Office for .NETStandard dll to test the document, it did take a long time. I noticed that the repeated PDF pages contain a lot of images, which should be the main reason for affecting the performance. Anyway I have recorded this issue with the number "SPIREPDF-6360". Our development team will do more investigations to check if there is any approach can optimize it. If there is any update, we will notify you as soon as possible. We deeply apologize for the inconvenience caused.

Sincerely
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Wed Oct 25, 2023 10:49 am

Hi

The saveasstream method takes 7.5 minutes to process a 13966-page plain PDF document without any images.

sterlingfordev
 
Posts: 13
Joined: Wed Jan 25, 2023 5:31 am

Thu Oct 26, 2023 6:14 am

Hi,

Thank you for your inquiry.
In order to help us reproduce and investigate your issue, please share your input test file, you can attach here or send it to us via email (support@e-iceblue.com).Thanks in advance.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Return to Spire.PDF