Hi,
When trying to convert the attached file to PDF I get an exception (see below).
I’m now using Aspose.Words 7.0.0. Testing with Aspose.Words 5.3.0 it works fine.
My code is the following:
Aspose.Words.Document doc = new Aspose.Words.Document(fileStream);
using(MemoryStream stream = new MemoryStream())
{
document.SaveToPdf(0, document.PageCount, stream, new PdfOptions());
array = stream.GetBuffer();
}
The exception I’m getting is the following:
Exception occurred. Parameters: DocID=581. Details: Buffer cannot be null. Parameter name: buffer Stack:
at System.IO.MemoryStream…ctor(Byte[] buffer, Boolean writable)
at System.IO.MemoryStream…ctor(Byte[] buffer)
at ?.?.?(Fill ?)
at ?.?.get_?()
at ?.?.get_?()
at ?.?.get_?()
at ?.?.?(? ?, Int32 ?)
at ?.?.?(? ?, Int32& ?)
at ?.?.?(Shape ?, Matrix ?, Single ?, Single ?, Single ?)
at ?.?.?(ShapeBase ?)
at ?.?.?(ShapeBase ?, PointF ?, Color ?, ? ?)
at ?.?.?(Boolean ?, ? ?)
at ?.?.?()
at ?.?.?(ShapeBase ?, Shape ?, ? ?, SizeF ?, Color ?)
at ?.?.?(String ?, Shape ?, ? ?, SizeF ?)
at ?.?.?(Shape ?)
at ?.?.?(Shape ?)
at ?.?.?(Shape ?)
at ?.?.?(Shape ?)
at ?.?.VisitShapeStart(Shape shape)
at Aspose.Words.Drawing.Shape.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.?(DocumentVisitor ?)
at Aspose.Words.Paragraph.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.?(DocumentVisitor ?)
at Aspose.Words.Body.Accept(DocumentVisitor visitor)
at ?.?.?(Section ?)
at ?.?.<(?>)
at Aspose.Words.Document.?(Stream ?, String ?, SaveFormat ?)
at Aspose.Words.Document.Save(Stream stream, SaveFormat saveFormat)