Remaps pages for reordering, copying and deletion.




void RemapPages(string pages)
void RemapPages(int[] pages)
void RemapPages(int[] pages, int index, int count)

[Visual Basic]
Sub RemapPages(pages As String)
Sub RemapPages(pages() As Integer)
Sub RemapPages(pages() As Integer, index As Integer, count As Integer)



Name Description

The list of page numbers.


The index of the first page number into the array pages.


The number of page numbers in the array pages to use.




This method provides a simple method for remapping the pages in a document. It can be used for reordering, copying or deleting pages.

It accepts a list of page numbers and reorders the pages in the document so that they match these page numbers. If a number is repeated more than once, the page is duplicated. If a number is omitted, the page is deleted.

Page numbers can be delimited using spaces, commas or semicolons. The first page in a document is page one. So to reverse a four page document, you might use "4 3 2 1".

If a page is duplicated and it contains Form fields, you may want to call MakeFieldsUnique to avoid sharing fields across pages.




The following code snippet illustrates how one might reverse all the pages in a document.


using (Doc doc = new Doc()) {   doc.Read(Server.MapPath("../mypics/sample.pdf"));   doc.FontSize = 500;   doc.Color.String = "255 0 0";   doc.TextStyle.HPos = 0.5;   doc.TextStyle.VPos = 0.3;   int theCount = doc.PageCount;   List<int> pages = new List<int>();   for (int i = 1; i <= theCount; i++) {     doc.PageNumber = i;     doc.AddText(i.ToString());     pages.Add(theCount - i + 1);   }   doc.RemapPages(pages.ToArray());   doc.Save(Server.MapPath("docremappages.pdf")); }

docremappages.pdf [Page 1]

docremappages.pdf [Page 2]

docremappages.pdf [Page 3]

docremappages.pdf [Page 4]