Depending on the country, you may be in the same legal status if you just buy a physical copy and then download a copy of the same edition. (Caveat - I am not a lawyer. This is not legal advice.)
Google won a case on appeal in 2015 concerning their book scanning and digitization project. The result of that case, in the US at least, is that you are protected in scanning a book you own for fair use and other legal purposes and can even give a copy to a friend (for purposes of education and other fair use) but if you mass distribute that copy then you may run afoul of copyright law.