We are using the current 11.1 (and tried previous versions) and Aspose is having issues just saving a PDF that was opened if the PDF was an image.
This simple load/save fails with the attached document:
using (var memoryStream = new MemoryStream(fileBytes))
{
var document = new Document(memoryStream);
using (var outputStream = new MemoryStream())
{
document.Save(outputStream);
return outputStream.ToArray();
}
}
This produces a blank PDF.
We cannot use a product that can’t process 1/2 our PDFs (scans converted to PDF).
P.S.
Grabbing the pages and adding to a new Document will save a PDF with the image, but causes other issues elsewhere.
using (var input = new MemoryStream(fileBytes))
{
using (var oldCopy = new Document(input))
{
using (var newCopy = new Document())
{
newCopy.Pages.Add(oldCopy.Pages);
using (var output = new MemoryStream())
{
newCopy.Save(output);
return output.ToArray();
}
}
}
}