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.

Mon Nov 09, 2020 6:08 pm

Spire.Doc stuck when try get PageCount


Spire.Doc.Document spd = new Spire.Doc.Document("D:\\5440319_539390_539390_MT_1_NEW.docx");
int i = spd.PageCount;


after 5 minutes got error

Message: Exception of type 'System.OutOfMemoryException' was thrown.
Exception: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Drawing.FontFamily.GetName(Int32 language)
at System.Drawing.FontFamily.get_Name()
at System.Drawing.Font.get_Name()
at Spire.Doc.Formatting.CharacterFormat.get_Font()
at spr᯼.ᜀ(TextRange A_0, CharacterFormat A_1, RectangleF& A_2, Boolean A_3, sprគ A_4)
at spr᯼.ᜀ(TextRange A_0, TextRange A_1, Paragraph A_2, String A_3, Boolean A_4)
at sprឡ.ᜅ(sprហ A_0)
at sprឡ.ᜁ(RectangleF A_0)
at sprអ.ᜂ(sprហ A_0)
at sprឡ.ᜁ(RectangleF A_0)
at sprឡ.ᜋ(sprហ A_0)
at sprឡ.ᜁ(RectangleF A_0)
at sprប.ᜀ(sprឋ A_0, sprច A_1, spr᯼ A_2)
at spr᯴.ᜋ()
at spr᯴.ᜀ(RectangleF& A_0, RectangleF& A_1, Int32& A_2, Boolean& A_3, Boolean A_4)
at sprប.ᜀ(sprឋ A_0, sprច A_1, spr᯼ A_2)
at spr᯴.ᜒ()
at spr᯴.ᜓ()
at spr᯴.ᜂ(Document A_0)
at Spire.Doc.Document.᝷()
at Spire.Doc.Document.get_PageCount()

sserra
 
Posts: 76
Joined: Tue Jun 13, 2017 4:03 pm

Tue Nov 10, 2020 7:25 am

Hello

Thanks for your inquiry.

Based on your code and description, I have reproduced your issue and logged it in our bug tracking system with the ticket SPIREDOC-5158. We will inform you if there is any update. Sorry for the inconvenience caused. You can refer to the following code for the correct number of pages as a temporary solution. If you have any other questions, please feel free to contact us.

Code: Select all
Spire.Doc.Document spd = new Spire.Doc.Document("F:\\5440319_539390_539390_MT_1_NEW.docx");
int i = spd.BuiltinDocumentProperties.PageCount;


Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Tue Nov 10, 2020 4:49 pm

thank you

sserra
 
Posts: 76
Joined: Tue Jun 13, 2017 4:03 pm

Wed Nov 11, 2020 1:14 am

Hello

You are welcome.
Once there is any progress regarding the issue SPIREDOC-5158, we will notify you immediately.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.Doc