Skip to content

Commit f3225a4

Browse files
authored
📝 fix documentation of page options (#264)
1 parent 5641319 commit f3225a4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/java/com/mindee/input/PageOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class PageOptions {
1313
/**
1414
* Zero-based list of page indexes.
1515
* A negative index can be used, indicating an offset from the end of the document.
16-
* [1, -1] represents the first and last pages of the document.
16+
* [0, -1] represents the first and last pages of the document.
1717
*/
1818
List<Integer> pageIndexes;
1919
/**

src/test/java/com/mindee/pdf/PdfOperationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void givenADocumentAndPageToKeep_whenSplit_thenReturnsOnlyKeptPage()
2222
throws IOException {
2323

2424
PageOptions pageOptions = new PageOptions.Builder()
25-
.pageIndexes(new Integer[]{2})
25+
.pageIndexes(new Integer[]{ 2 })
2626
.operation(PageOptionsOperation.KEEP_ONLY)
2727
.build();
2828

@@ -42,8 +42,8 @@ public void givenADocumentAndListOfPagesToKeep_whenSplit_thenReturnsOnlyKeptPage
4242
throws IOException {
4343

4444
List<Integer> pageNumbersToKeep = new ArrayList<>();
45+
pageNumbersToKeep.add(0);
4546
pageNumbersToKeep.add(1);
46-
pageNumbersToKeep.add(2);
4747

4848
PageOptions pageOptions = new PageOptions.Builder()
4949
.pageIndexes(pageNumbersToKeep)
@@ -66,7 +66,7 @@ public void givenADocumentAndListOfPagesToRemove_whenSplit_thenReturnsOnlyNotRem
6666
throws IOException {
6767

6868
PageOptions pageOptions = new PageOptions.Builder()
69-
.pageIndexes(new Integer[]{1,2,3})
69+
.pageIndexes(new Integer[]{ 0,1,2 })
7070
.operation(PageOptionsOperation.REMOVE)
7171
.build();
7272

@@ -86,7 +86,7 @@ public void givenADocumentOtherThantAPdf_whenSplit_mustFail()
8686
throws IOException {
8787

8888
PageOptions pageOptions = new PageOptions.Builder()
89-
.pageIndexes(new Integer[]{1,2,3})
89+
.pageIndexes(new Integer[]{ 1,2,3 })
9090
.operation(PageOptionsOperation.REMOVE)
9191
.build();
9292

@@ -105,7 +105,7 @@ public void givenADocumentAndListPagesToRemoveAndMinPagesCondition_whenSplit_mus
105105
throws IOException {
106106

107107
PageOptions pageOptions = new PageOptions.Builder()
108-
.pageIndexes(new Integer[]{1})
108+
.pageIndexes(new Integer[]{ 0 })
109109
.operation(PageOptionsOperation.REMOVE)
110110
.onMinPages(5)
111111
.build();
@@ -126,7 +126,7 @@ public void givenADocumentAndNegativeListPagesToKeep_whenSplit_thenReturnsOnlyKe
126126
throws IOException {
127127

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

0 commit comments

Comments
 (0)