Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/mindee/input/PageOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class PageOptions {
/**
* Zero-based list of page indexes.
* A negative index can be used, indicating an offset from the end of the document.
* [1, -1] represents the first and last pages of the document.
* [0, -1] represents the first and last pages of the document.
*/
List<Integer> pageIndexes;
/**
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/mindee/pdf/PdfOperationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void givenADocumentAndPageToKeep_whenSplit_thenReturnsOnlyKeptPage()
throws IOException {

PageOptions pageOptions = new PageOptions.Builder()
.pageIndexes(new Integer[]{2})
.pageIndexes(new Integer[]{ 2 })
.operation(PageOptionsOperation.KEEP_ONLY)
.build();

Expand All @@ -42,8 +42,8 @@ public void givenADocumentAndListOfPagesToKeep_whenSplit_thenReturnsOnlyKeptPage
throws IOException {

List<Integer> pageNumbersToKeep = new ArrayList<>();
pageNumbersToKeep.add(0);
pageNumbersToKeep.add(1);
pageNumbersToKeep.add(2);

PageOptions pageOptions = new PageOptions.Builder()
.pageIndexes(pageNumbersToKeep)
Expand All @@ -66,7 +66,7 @@ public void givenADocumentAndListOfPagesToRemove_whenSplit_thenReturnsOnlyNotRem
throws IOException {

PageOptions pageOptions = new PageOptions.Builder()
.pageIndexes(new Integer[]{1,2,3})
.pageIndexes(new Integer[]{ 0,1,2 })
.operation(PageOptionsOperation.REMOVE)
.build();

Expand All @@ -86,7 +86,7 @@ public void givenADocumentOtherThantAPdf_whenSplit_mustFail()
throws IOException {

PageOptions pageOptions = new PageOptions.Builder()
.pageIndexes(new Integer[]{1,2,3})
.pageIndexes(new Integer[]{ 1,2,3 })
.operation(PageOptionsOperation.REMOVE)
.build();

Expand All @@ -105,7 +105,7 @@ public void givenADocumentAndListPagesToRemoveAndMinPagesCondition_whenSplit_mus
throws IOException {

PageOptions pageOptions = new PageOptions.Builder()
.pageIndexes(new Integer[]{1})
.pageIndexes(new Integer[]{ 0 })
.operation(PageOptionsOperation.REMOVE)
.onMinPages(5)
.build();
Expand All @@ -126,7 +126,7 @@ public void givenADocumentAndNegativeListPagesToKeep_whenSplit_thenReturnsOnlyKe
throws IOException {

PageOptions pageOptions = new PageOptions.Builder()
.pageIndexes(new Integer[]{1,-2,-1})
.pageIndexes(new Integer[]{ 0,-2,-1 })
.operation(PageOptionsOperation.KEEP_ONLY)
.build();

Expand Down
Loading