  <script>
      document.getElementById('pdfForm').addEventListener('submit', async (e) => {
        e.preventDefault();

        const { PDFDocument } = PDFLib;

        const processFile = async (file) => {
          const origFileUrl = URL.createObjectURL(file);
          const formPdfBytes = await window.fetchWithCsrf(origFileUrl).then(res => res.arrayBuffer());
          const pdfDoc = await PDFDocument.load(formPdfBytes, { ignoreEncryption: true });

          const pages = pdfDoc.getPages();

      