The attached document makes the Aspose.Words.Viewer renderer go in stack overflow (in mscorlib). I use Aspose.Words 5.1 for .net 2.0 in 32 bits.
Exception trace:
mscorlib.dll!System.Security.CodeAccessSecurityEngine.Assert(System.Security.CodeAccessPermission cap = {System.Security.Permissions.SecurityPermission}, ref System.Threading.StackCrawlMark stackMark) + 0x3d bytes
mscorlib.dll!System.Security.CodeAccessPermission.Assert() + 0x15 bytes
System.Drawing.dll!System.Drawing.Font.SetFontFamily(System.Drawing.FontFamily family) + 0x43 bytes
System.Drawing.dll!System.Drawing.Font.Font(string familyName, float emSize = 10.0, System.Drawing.FontStyle style = Regular) + 0x57 bytes
Aspose.Words.dll!ӓ.ఉ.⸆() + 0xc7 bytes
Aspose.Words.dll!ӓ.ఉ.ఉ(ӓ.Ӿ pgfx = {ӓ.Ӿ}, Aspose.Words.Font asposeFont = {Aspose.Words.Font}, string text = "1) Fire Fighting ring made by ") + 0x3b bytes
My code:
Dim AspLic As New Aspose.Words.License
AspLic.SetLicense(Costanti.ASPOSE_LICENCE_PATH)
Dim MemStream As New IO.MemoryStream(DocToRender, False) ' DocToRender is a buffer with attached file contents
Me.Renderer = New Aspose.Words.Viewer.DocumentRenderer(MemStream)
Me.Renderer.PageBounds = Aspose.Words.Viewer.PageBounds.Border
Me.Renderer.Document.Sections(0).PageSetup.RightMargin = 8
Me.Renderer.Document.Sections(0).PageSetup.LeftMargin = 8
Me.Renderer.Document.Sections(0).PageSetup.TopMargin = 8
Me.PageNav = New Aspose.Words.Viewer.PageNavigator(Me.mRenderer)
Me.PageNav.GoToPage(1)
Please let me know if there is any workaround/fix for this issue.
Thanks,
Pascal.