We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Changing page size of PDF corrupts output

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)

@ejt66

We have tested the scenario in our environment using Aspose.PDF for .NET 20.9 and were able to notice the issue in output PDF. Hence, have logged it as PDFNET-48851 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.