All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Borrowing a book from the public library or getting it from any source does not make it lawful for you to download it from the internet if the author of the book does not allow that.
This is based on the view we adopt here in Islamweb that it is not permissible to transgress copyrighted materials and so on, whether for the purpose of trade or personal use. However, some scholars are of the view that it is permissible to photocopy books and download them from the internet for personal use.
According to this view, it is permissible for you to download the book for reading, regardless of whether or not you have borrowed it from the library.
For more benefit, please refer to Fataawa 149447, 332836, 386317, and 338512.
Allah knows best.