Greetings.
We have problem using PdfPageEditor for scanned documents.
Here is some code sample.
using (var ms = new MemoryStream())
{
ms.Seek(0, SeekOrigin.Begin);
using (var fileStream = new FileStream(Environment.CurrentDirectory + "\\Dokument.pdf", FileMode.Open, FileAccess.Read))
using (var pdfDoc = new Document(fileStream))
using (var pageRotationPpe = new PdfPageEditor())
{
pageRotationPpe.BindPdf(pdfDoc);
pageRotationPpe.ApplyChanges();
pdfDoc.Save(ms);
pdfDoc.FreeMemory();
}
var fileInfo = new FileInfo(Environment.CurrentDirectory + "\\Result.pdf");
if (fileInfo.Exists)
{
fileInfo.Delete();
}
using (var fs = new FileStream(Environment.CurrentDirectory + "\\Result.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
ms.WriteTo(fs);
}
}
We do nothing, just bind and apply changes. After print file preview is crushed, and document can not be opened with Adobe Acrobat Reader. Waiting for response.
If you need Console Application or file we are processing, we will send you it.