Opening attached original.pdf, and saving it to a new file,
results in many System.Exceptions, that seam to be handled internally by Aspose.
(A first chance exception of type 'System.Exception' occurred in Aspose.Pdf.dll)
The output, is an invalid pdf, 1% the size of the original. (208kb vs. 2kb)
Please let me know what is wrong here; And if possible, please stop handling system exceptions internally or expose a GetLastError method, so we third party developers have a chance of alerting ourselves to these situations, before several of our documents have been corrupted.
Here is some example code, that reproduces the error.:
string filename = "original.pdf";
string workfile = "workfile.pdf";
using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read)) {
fileInfo = new PdfFileInfo(fs);
using (FileStream fs_out = new FileStream(workfile, FileMode.Create, FileAccess.Write)) {
fileInfo.Save(fs_out);
fs_out.Flush();
fs_out.Close();
}
fs.Close();
}
// Since no errors/exceptions are detected; the original file is overwritten with workfile here...