Try with 1.8.x version first.
The documentation referenced in the article contains a section that describes the differences and breaking changes between 1.x and 2.x versions. If you get code for 1.8 working, than you may go through the changes list and consider what is relevant for you and how it can be adjusted.
P.S. The code for v.1.8 worked for me, but only for a small files. For big PDFs the buffer size error was reported by Java. This seems to be corrected in v.2.x (actually, 2.x uses another approach to read files), but requires correction of the code from the article. I did not follow with this as it was not urgent for me at that moment, so I don't have code for v.2.x.