1

Currently implementing the PDF-Lib Library for my project to modify PDFs Source: https://pdf-lib.js.org/#examples

And it is working very well, but the modified PDFs are saved on the server. I am searching for the opportunity that the pdfs which modified will directly downloaded for the user.

Thanks!

stm
  • 662
  • 1
  • 6
  • 23
JrWebDev
  • 128
  • 9

1 Answers1

1

If you follow the examples where the ones that download to client like https://jsfiddle.net/Hopding/64zajhge/1/ have

 <script src="https://unpkg.com/[email protected]"></script>
</head><body>
... 
Instructions
<button onclick="modifyPdf()">Modify PDF</button>
...

<script>
async function modifyPdf()
...
// Trigger the browser to download the PDF document
      download(pdfBytes, "pdf-lib-output.pdf", "application/pdf");

however that may need some secured configuration, way beyond this single question.

K J
  • 8,045
  • 3
  • 14
  • 36