Currently, I have an HTML document featuring three buttons, each designed to download a distinct PDF file generated on the server. Upon clicking a button, the browser initiates a request to the server, which then generates and serves the corresponding PDF.
In an effort to minimize server calls, I intend to streamline the process by embedding the PDF files directly into the HTML page, alongside the buttons. This way, I can handle the PDF openings using JavaScript.
My dilemma lies in determining the optimal method for incorporating the PDF data into the HTML page. Here are some thoughts yet:
Option 1: Would it be OK to include the PDFs into an HTML attribute like data-pdf1="..." data-pdf2="..." data-pdf3="..."
?
Option 2: Maybe just in a hidden <div>
?
Option 2: Maybe adding the data to the SESSION, but if I have lots of visitors maybe the server will slow down with so much information there.
If you have some ideas it’d be great. Thanks!