I am converting a word document to PDF using the following code
- Code: Select all
using (Spire.Doc.Document doc = new Spire.Doc.Document())
{
doc.LoadFromFile(wordDocPath, SpireDoc.FileFormat.Doc);
doc.SaveToFile(pdfFilePath, Spire.Doc.FileFormat.PDF);
}
I am getting a System.OutOfMemoryException when doc.LoadFromFile is called.
- Code: Select all
at Spire.Doc.Body..ctor(Document A_0, DocumentObject A_1)
at Spire.Doc.TableCell..ctor(IDocument document)
at sprᴈ.ᜎ()
at sprᴍ.ᜁ()
at sprᴍ.ᜂ(sprᲦ A_0)
at sprᴌ.ᜀ(spr A_0, Int32 A_1, sprᴋ A_2)
at sprᴌ.ᜀ(spr A_0)
at sprᴌ.ᜀ(Int32 A_0, Int32 A_1)
at sprᴌ.ᜁ()
at sprᴂ.ᜄ()
at Spire.Doc.Document.ᜀ(Stream A_0, String A_1, FileFormat A_2)
at Spire.Doc.Document.ᜀ(String A_0, String A_1, FileFormat A_2)
at Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat, String password)
at Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat)
I am using the latest version of Spire.Doc that is available on nuget - 6.11.5. I have a pro licence for Spire.Doc.
I am however trying to convert a very large word document. It is 31.6MB and is a "Microsoft Word 97 - 2003 Document (.doc)" word file. The document has 469 pages. The document has lots of tables (about 3 in every 4 or 5 pages has a table), it has lots of full page images (at least 1 in every 5 pages).
Any help would be appreciated.
Thank you