We can convert our word doc to pdf. Howerver it doens't include the watermark. What are we doing wrong. I have attacued the word doc we are using and listed the code below
private byte[] CreatePDFDoc(List<byte[]> byteList)
{
Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense("Aspose.Total.lic");
//Aspose.Pdf.Kit.License Kitlicense = new Aspose.Pdf.Kit.License();
Aspose.Pdf.License Kitlicense = new Aspose.Pdf.License();
license.SetLicense("Aspose.Total.lic");
Kitlicense.SetLicense("Aspose.Total.lic");
System.IO.MemoryStream[] streamArray = new System.IO.MemoryStream[byteList.Count];
for (int i = 0; i < byteList.Count; i++)
{
System.IO.MemoryStream mem = new System.IO.MemoryStream(byteList[i], false);
Aspose.Words.Document doc = new Aspose.Words.Document(mem, null);
Aspose.Words.Saving.SaveOptions option = Aspose.Words.Saving.SaveOptions.CreateSaveOptions(Aspose.Words.SaveFormat.Pdf);
System.IO.MemoryStream outmem = new System.IO.MemoryStream();
doc.Save(outmem, option);
streamArray[i] = outmem;
}
System.IO.MemoryStream combinedPDF = new System.IO.MemoryStream();
//Aspose.Pdf.Kit.PdfFileEditor editor = new Aspose.Pdf.Kit.PdfFileEditor();
Aspose.Pdf.Facades.PdfFileEditor editor = new Aspose.Pdf.Facades.PdfFileEditor();
editor.Concatenate(streamArray, combinedPDF);
combinedPDF.Flush();
combinedPDF.Close();
return combinedPDF.ToArray();
}