|
@@ -219,12 +219,15 @@ namespace PDFPageTest
|
|
|
/// <param name="document">Regular five page document</param>
|
|
|
static private bool RemovePages(CPDFDocument document)
|
|
|
{
|
|
|
- ArrayList arr = new ArrayList();
|
|
|
+ List<int> pageNumbersToRemove = new List<int>();
|
|
|
+
|
|
|
for (int i = 1; i < document.PageCount; i += 2)
|
|
|
{
|
|
|
- arr.Add(i);
|
|
|
+ pageNumbersToRemove.Add(i);
|
|
|
}
|
|
|
- document.RemovePages((int[])arr.ToArray(typeof(int)));
|
|
|
+
|
|
|
+ document.RemovePages(pageNumbersToRemove.ToArray());
|
|
|
+
|
|
|
|
|
|
string path = outputPath + "\\RemoveEvenPagesTest.pdf";
|
|
|
if (!document.WriteToFilePath(path))
|
|
@@ -259,9 +262,8 @@ namespace PDFPageTest
|
|
|
/// <param name="document">Regular five page document</param>
|
|
|
static private bool RepalcePages(CPDFDocument document)
|
|
|
{
|
|
|
- int[] pageArr = new int[1];
|
|
|
- pageArr[0] = 0;
|
|
|
- document.RemovePages(pageArr);
|
|
|
+ List<int> pageList = new List<int>() { 0 };
|
|
|
+ document.RemovePages(pageList.ToArray());
|
|
|
CPDFDocument documentForInsert = CPDFDocument.InitWithFilePath("Text.pdf");
|
|
|
document.ImportPagesAtIndex(documentForInsert, "1", 0);
|
|
|
string path = outputPath + "\\RepalcePagesTest.pdf";
|