Generate QR code using a URL link
Generating a QR code for a PDF file is not a matter of embedding the entire file's data into the QR code. QR codes have a strict data limit (typically up to about 4,000 characters), which is far too small for most PDF documents 1.
The correct, industry-standard approach is to host the PDF online and encode the resulting direct URL into the QR code. When a user scans the code, their device opens the URL, which automatically downloads or displays the PDF.
Here is the guide for generating the QR code using a URL link.