I was trying to utilize the ReArrange method on the PdfPageCollection class in order to re-arrange the pages of my document, however it seems that no matter what I always receive a System.NullReferenceException from within that method. I am using Spire.Office v7.1.4 with an enterprise license.
I've tried uploading a small console application as a .zip file to this post that reproduces the error but unfortunately it does not appear to be working. Please use the code snippet below in a console application in order to reproduce the error:
- Code: Select all
static void Main(string[] args)
{
var pdfDoc = new PdfDocument();
for (int i = 0; i < 3; i++)
{
pdfDoc.Pages.Add();
}
pdfDoc.Pages.ReArrange(new int[] { 2, 1, 0 });
Console.WriteLine("Successfully rearranged pages");
Console.ReadLine();
}
Please let me know when I can expect this method to start working as intended.
Thank you,
Zac