Hello,
I am using the pdfPageEditor to change the page size of an existing PDF and it is corrupting the output. Here is an example of code that’s failing and attached is an the source pdf.
public static void ResizeBad()
{
var inputFile = @"d:\input\single_bad.pdf";
var outputFile = @"d:\output\single_bad_output.pdf";
var doc = new Document(inputFile);
var pageEditor = new PdfPageEditor();
pageEditor.BindPdf(doc);
pageEditor.ProcessPages = new[] { 1 };
pageEditor.PageSize = PageSize.PageLetter;
//doc.Pages[1].SetPageSize(PageSize.PageLetter.Width, PageSize.PageLetter.Height); // this works, but I need to perform other operations with the PdfPageEditor
pageEditor.ApplyChanges();
pageEditor.Save(outputFile);
}
single_bad.pdf (417.8 KB)