Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Feb 16, 2021 11:12 am

Hi,
I am tring to convert a .docx to .pdf, using the method SaveToStream, and I get System.OutOfMemoryException. I am using Spire.Doc 8.10.4 with license, but I have also tried latest version 9.2.0. I have also license for Spire.PDF loaded.
The document is attached to this post.

The conversion is not working on Windows 10 Home (16 GB RAM), neither on IIS, Windows Server 2016 Standard (32 GB).

This is my c# code:

var content = File.ReadAllBytes(fileName);
using (Document d = new Document())
{
MemoryStream m = new MemoryStream();
d.LoadFromStream(new MemoryStream(content), FileFormat.Docx);
d.SaveToStream(m, new ToPdfParameterList { UsePSCoversion = true });
}

This is the stack trace:
System.OutOfMemoryException: Generata eccezione di tipo 'System.OutOfMemoryException'. in Spire.Doc.Documents.Borders.GetDefComposite(Int32 key) in Spire.Doc.Formatting.FormatBase.EnsureComposites(Int32[] keys) in Spire.Doc.Documents.Borders.EnsureComposites() in Spire.Doc.Documents.Borders.InitCompositePrimaryKey() in Spire.Doc.Formatting.FormatBase..ctor(IDocument doc, DocumentObject owner) in Spire.Doc.Formatting.FormatBase..ctor(FormatBase parent, Int32 parentKey) in Spire.Doc.Formatting.ParagraphFormat.GetDefComposite(Int32 key) in Spire.Doc.Formatting.FormatBase.EnsureComposites(Int32[] keys) in Spire.Doc.Formatting.ParagraphFormat.EnsureComposites() in Spire.Doc.Formatting.FormatBase.ImportContainer(FormatBase format) in Spire.Doc.Documents.ParagraphStyle.CloneImpl() in Spire.Doc.Documents.ParagraphStyle.Clone() in Spire.Doc.Documents.Paragraph.ᜀ(Boolean A_0) in Spire.Doc.Documents.Paragraph.CloneImpl() in Spire.Doc.Collections.DocumentObjectCollection.ᜀ(DocumentObjectCollection A_0) in Spire.Doc.Body.CloneImpl() in Spire.Doc.TableCell.CloneImpl() in Spire.Doc.Collections.DocumentObjectCollection.ᜀ(DocumentObjectCollection A_0) in Spire.Doc.TableRow.CloneImpl() in Spire.Doc.Collections.DocumentObjectCollection.ᜀ(DocumentObjectCollection A_0) in Spire.Doc.Table.CloneImpl() in Spire.Doc.Collections.DocumentObjectCollection.ᜀ(DocumentObjectCollection A_0) in Spire.Doc.Body.CloneImpl() in Spire.Doc.HeadersFooters.CloneImpl() in Spire.Doc.Section.ᜀ(Boolean A_0) in spr᯴.ᜑ() in spr᯴.ᜀ(RectangleF& A_0, RectangleF& A_1, Int32& A_2, Boolean& A_3, Boolean A_4) in sprប.ᜀ(sprឋ A_0, sprច A_1, spr᯼ A_2) in spr᯴.ᜒ() in spr᯴.ᜓ() in spr᯴.ᜀ(IDocument A_0) in spr᱂.ᜀ(Document A_0, Stream A_1, ToPdfParameterList A_2) in Spire.Doc.Document.ᜀ(Stream A_0, ToPdfParameterList A_1) in Spire.Doc.Document.SaveToStream(Stream stream, ToPdfParameterList paramList)


Hope you can help me, thanks,
Elia

eliamuntoni
 
Posts: 6
Joined: Tue Feb 16, 2021 9:40 am

Tue Feb 16, 2021 2:43 pm

Hello,

Thanks for your message.
After testing your case, I did encounter the exception as yours. This issue has been logged into our tracking system with the ticket SPIREDOC-5538 for further investigation and fixing. Once there is any update, I will let you know immediately. Sorry for the inconvenience caused.

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Wed Apr 28, 2021 11:22 am

Hi,
I'm wondering if this bug has been taken over.

Thanks,
Elia

eliamuntoni
 
Posts: 6
Joined: Tue Feb 16, 2021 9:40 am

Thu Apr 29, 2021 1:46 am

Hi Elia,

Thank you for following up.
Sorry that it has not been solved so far, our Dev team needs to spare more time to fix it. However, we have requested them to speed up the fixing and have given a higher priority to your issue. Once it is fixed, we will provide a version for you asap. Sorry for the inconvenience caused.

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Return to Spire.Doc

cron