The guard for enough pages in _addFromToPage uses the wrong operator
uriroos opened this issue · 0 comments
uriroos commented
The function _addFromToPage has a guard for checking if there are enough pages available in the original file. However at this point the page index being using is still 1 based. The operator being used in the guard is for 0 based index >=
.
Steps to reproduce
- Create a pdf of 2 pages
- Call .add with the range
1-2
- Call .save
Expected behaviour
Two pages are being added to the merged pdf.
Seen behaviour
The pdf is not created but an error thrown: Invalid function parameter. The document has not enought pages. (from:1, to:2, pages:2)