Hello,
I have a word document i am converting it to PDF as below.
public MemoryStream ConvertWordToPDF(MemoryStream stream)
{
MemoryStream pdfStream = new MemoryStream();
// Create a new memory stream.
MemoryStream outStream = new MemoryStream();
try
{
Document doc = new Document(stream);
// Save the document to stream.
doc.Save(outStream, Aspose.Words.SaveFormat.Pdf);
// Convert the document to byte form.
byte[] docBytes = outStream.ToArray();
// The bytes are now ready to be stored/transmitted.
// Now reverse the steps to load the bytes back into a document object.
pdfStream = new MemoryStream(docBytes);
}
catch
{
// wordLicense.SetLicense("");
// pdfLicense.SetLicense("");
}
finally
{
stream.Close();
outStream.Close();
}
return pdfStream;
}
The PDF generated through aspose is having square boxes while the word file which i am converting looks fine. See the attached word and PDF file.
Please let me know the solution for this.