There is few APIs that do exactly that what you need. The one I am using is https://qrbar-code.intami.pl
It can decode QRCodes form images and PDFs.