When using attached pdf in conjunction with any other pdf file(s), Flatten() throws object reference exception. Why can't Aspose.Pdf handle flattening of that particular pdf?
Please let us know if you can provide a fix for this issue.
var finalDoc = new Aspose.Pdf.Document();
foreach (var fileInfo in fileInfos)
{
var file = fileInfo.FullName;
if (isEmailSign)
{
if (File.Exists(file + ".unsecure"))
{
File.Delete(file);
File.Move(file + ".unsecure", file);
}
}
var tmpDoc = new Aspose.Pdf.Document(file);
finalDoc.Pages.Add(tmpDoc.Pages);
}
finalDoc.Flatten();
finalDoc.Save(outputFilename);