Hello,
I am resizing pdf’s to normalize their content to all the same paper size, for example, resize a page size from A4 to Letter. For some documents the output is corrupted and returns the following error when you open with acrobat: “there was an error processing an annotation or link. there was a problem reading this document (16)”
Attached is sample input and the output used in the code example below.
string inputFile = @"d:\input\input.pdf";
string outFile = @"d:\output\output.pdf";
Document doc = new Document(inputFile);
PdfFileEditor fileEditor = new PdfFileEditor();
for (int i = 0; i < doc.Pages.Count; i++)
{
fileEditor.ResizeContents(doc, new int[] {i + 1},
PdfFileEditor.ContentsResizeParameters.PageResize(PageSize.PageLetter.Width,
PageSize.PageLetter.Height));
}
doc.Save(outFile);
Examples.zip (321.1 KB)