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

Free Support Forum - aspose.com

Reordering PDF pages

  • When we tried to reorder some pages several times, we encountered a problem, the following is our code and pdf file MyPDFToShare.pdf (1.5 MB) , which has 64 pages.
            var pdf = new Document("D:\\MyPDFToShare.pdf");
            int count = 100000;
            try
            {
                while (count > 0)
                {
                    count--;

                    pdf.Pages.Insert(2, pdf.Pages[43]);
                    pdf.Pages.Delete(44);

                    pdf.Pages.Insert(20, pdf.Pages[25]);
                    pdf.Pages.Delete(26);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception: " + ex.Message);
            }

@Glority_Developer

We were able to notice an exception while executing the code snippet that you shared with Aspose.PDF for .NET 21.10. Therefore, an issue as PDFNET-50787 has been logged in our issue tracking system. We will further look into its details and keep you posted with the status of its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.