We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

InvalidCastException when trying to convert Docx to PDF or XPS

Hi,

When trying to convert the attached docx file to either a PDF or an XPS, I get an InvalidCastException:
Unable to cast object of type ‘Aspose.Words.Style’ to type ‘x28925c9b27b37a46.x6c19282943d32085’.

Stack Trace:

at x9db5f2e5af3d596e.x416e4f8cf09bfa33.VisitTableStart(Table table)
 at Aspose.Words.Tables.Table.x2449520719b1e37e(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
 at x9db5f2e5af3d596e.x416e4f8cf09bfa33.x8810335244b90b9d(Table x1ec770899c98a268)
 at x13cd31bb39e0b7ea.xcc0b5baa75272714.VisitTableStart(Table table)
 at Aspose.Words.Tables.Table.x2449520719b1e37e(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
 at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.Body.Accept(DocumentVisitor visitor)
 at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.Section.Accept(DocumentVisitor visitor)
 at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
 at Aspose.Words.Document.Accept(DocumentVisitor visitor)
 at x13cd31bb39e0b7ea.xcc0b5baa75272714.x18dfca7c5fd2402f(x8556eed81191af11 x5ac1382edb7bf2c2)
 at x59d6a4fc5007b7a4.xcde671c53995c411.xd9db07500873ae98(Document x3664041d21d73fdc, xdeb77ea37ad74c56 xdfde339da46db651)
 at Aspose.Words.Document.UpdatePageLayout()
 at Aspose.Words.Document.get_xcde671c53995c411()
 at Aspose.Words.Document.get_PageCount()
 at x6a671772ec29137f.xcd769e39c0788209.x8cac5adfe79bc025(x8556eed81191af11 x5ac1382edb7bf2c2)
 at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
 at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
 at Aspose.Words.Document.Save(String fileName, SaveFormat saveFormat)

Thanks!

Hi

Thank you for reporting this problem to us. I managed to reproduce it on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
Best regards,