I am getting the exception below when converting a docx document to pdf using version 9.4.0.0. My code looks like this:
Stream fileOut = new MemoryStream();
Aspose.Words.Saving.PdfSaveOptions pdfOptions = new Aspose.Words.Saving.PdfSaveOptions();
pdfOptions.HeadingsOutlineLevels = 1;
pdfOptions.ExpandedOutlineLevels = 1;
pdfOptions.BookmarksOutlineLevel = 1; //max allowed value is 9
pdfOptions.JpegQuality = JpegQuality;
pdfOptions.TextCompression = Aspose.Words.Saving.PdfTextCompression.Flate;
doc.Save(fileOut, pdfOptions);
return fileOut;
Here is the execption:
System.InvalidOperationException: Viewport height is invalid.
at xa7850104c8d8c135.x620a827d91bf9cfe.x9b3f290a765150b6()
at xa7850104c8d8c135.x620a827d91bf9cfe.xdfb72004658a4a71()
at xa7850104c8d8c135.x620a827d91bf9cfe.get_xe769b78104041bb6()
at xa7850104c8d8c135.xdaec868fc92da412.xf1c59e95a2a1c03b(RectangleF x4522b57e50ea54a2, RectangleF x334178e22916b6db, Byte[] x43e181e083db6cdf)
at xa7850104c8d8c135.x36e85e2927175782.x1db6366f4f7b6428()
at xa7850104c8d8c135.x36e85e2927175782.xb820878a71fbe650(xec95ecd2fe18d5f2 xc1674de501b364d0)
at xa7850104c8d8c135.x36e85e2927175782.DoPlay()
at xa7850104c8d8c135.x4cb7537b071ca71a.x0613827d1b6c81c9(x3fa09e8d7b952fbc x7314c991efe1c392, x9bef3b1e893f7f2e xb5001325846e2ee9, xeaf0b03643b7ac93 x0f7b23d1c393aed9)
at xa7850104c8d8c135.xdaec868fc92da412.x5b81632e5b71b64c(x3fa09e8d7b952fbc x7314c991efe1c392, SizeF x0ceec69a97f73617, xeaf0b03643b7ac93 x0f7b23d1c393aed9)
at xa7850104c8d8c135.xc53fbeb71f313ea9.x5b81632e5b71b64c(x72c34b8dbaec3734 xaf3288ddace2264d, xeaf0b03643b7ac93 x0f7b23d1c393aed9)
at x1c8faa688b1f0b0c.x72c34b8dbaec3734.x9214b18190604b0d(xf51865b83a7a0b3b x672ff13faf031f3d, xc53fbeb71f313ea9 x5a7a657dd8463d3b)
at x4f4df92b75ba3b67.x92faf2a956f0f5a7.VisitImage(x72c34b8dbaec3734 image)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xb8e7e788f6d59708.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xbaec545ec01f92ca.Accept(xf51865b83a7a0b3b visitor)
at x1c8faa688b1f0b0c.xc67adcdbca121a26.Accept(xf51865b83a7a0b3b visitor)
at x6a671772ec29137f.xcd769e39c0788209.x8cac5adfe79bc025(x8556eed81191af11 x5ac1382edb7bf2c2)
at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
at
Does the stack trace give any clues about what aspect of the word document could be causing this error? The word document was generated by MS Word. I need help figuring out what to look for in the word doc so I can modify it to avoid this error.
thanks,
Ken