Using Aspose.Pdf - 9.5.0.0, I have received a lot of complaints regarding corrupt/blank PDF's, and have determined it happens after PdfPageEditor Zoom() and MovePosition() have run.
Below is a piece of sample code:
PdfPageEditor editor = new PdfPageEditor();
using (FileStream fs_in = new FileStream("infile.pdf", FileMode.Open, FileAccess.Read)) {
editor.BindPdf(fs_in);
editor.Zoom = 0.97f;
if (editor.GetPageRotation(1) == 90) {
editor.MovePosition(15, 15);
}
using (FileStream fs_out = new FileStream("outfile.pdf", FileMode.Create, FileAccess.Write)) {
editor.Save(fs_out);
fs_out.Flush();
fs_out.Close();
}
}
The very disturbing thing is, that no Exception is throw, the error occurs silently,
so we have no idea how many documents have been destroyed as a result of this,
or at which version it started happening :(
Attached is the input and resulting output files.
Thank you,
Jens.
UPDATE:
Google Chrome appears to open the output file without error.
And the contents of the file is scaled as expected.
The message of corruption occurs in Adobe PDF reader,
versions 10 and 11 both refuse to read the output file.
UPDATE2:
I have just received word, that there is an issue with rotated PDF's as well.
Please examine input_rot.pdf and output_rot.pdf.
UPDATE3:
Just checked the uploaded files, and all but the first doesn't seam to upload correctly to your server. I have therefore removed them, and am now uploading them all as 1 zip file.