Hi,
we’ve find an issue in the method that concatenates streams into pdf:
public Stream MergeDocAndPdf()
{
MemoryStream[] ss = new MemoryStream[2];
MemoryStream output = new MemoryStream();
//test aspose merge between 1 doc and 1 pdf document
using (SPSite siteCollection = new SPSite(“http://webapp/sites/site”))
{
using (SPWeb web = siteCollection.OpenWeb())
{
SPDocumentLibrary lib = (SPDocumentLibrary)web.Lists[“doclib”];
if (lib != null)
{
SPFile fileDoc = lib.GetItemById(1).File;
SPFile filePdf = lib.GetItemById(2).File;
ss[0] = new MemoryStream();
ss[1] = new MemoryStream();
//load doc
using (var stream = fileDoc.OpenBinaryStream())
{
stream.CopyTo(ss[0]);
ss[0].Position = 0;
}
Aspose.Words.Document asposeDoc = new Aspose.Words.Document();
ss[0].Close();
ss[0] = new MemoryStream();
asposeDoc.Save(ss[0], Aspose.Words.SaveFormat.Pdf);
ss[0].Position = 0;
//load pdf
using (var stream = filePdf.OpenBinaryStream())
{
stream.CopyTo(ss[1]);
ss[1].Position = 0;
}
Aspose.Pdf.Document asposePdf = new Aspose.Pdf.Document(ss[1]);
ss[1].Position = 0;
PdfFileEditor pdfEditor = new PdfFileEditor();
pdfEditor.Concatenate(ss, output); //THE ERROR OCCURS HERE
}
}
}
String headerInfo = “attachment; filename=” + “MergeDocAndPdf.pdf”;
WebOperationContext.Current.OutgoingResponse.Headers[“Content-Disposition”] = headerInfo;
WebOperationContext.Current.OutgoingResponse.ContentType = “application/octet-stream”;
return output;
}
the output stream is empty and i see that, in the pdfEditor.LastException, there is an exception in loading Aspose.Font.dll:
Message "Could not load file or assembly ‘Aspose.Font, Version=17.4.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The system cannot find the file specified."
how can we resolve this?
I’ve see that this errors is already reported in your forum but with no resolution.
Thanks