We are experiencing a performance issue when using the SaveToStream method with Spire.OfficeforNETStandard.
The SaveToStream operation is extremely slow, even for moderately sized documents. The execution time is significantly longer than expected and is affecting our production environment.
Environment details:
- Spire version: Spire.OfficeforNETStandard 10.11.0
Framework: .NET Core 2.2
- Code: Select all
string[] inputFiles =
{
@"C:\Temp\LargePdf1.pdf",
@"C:\Temp\LargePdf2.pdf"
};
MemoryStream[] streams = new MemoryStream[inputFiles.Length];
for (int i = 0; i < inputFiles.Length; i++)
{
streams[i] = new MemoryStream();
using (FileStream fs = new FileStream(inputFiles[i], FileMode.Open, FileAccess.Read))
{
PdfDocument pdf = new PdfDocument(fs);
pdf.SaveToStream(streams[i]);
}
}
Thank you for your support.