e) {
        var form_data = new FormData();
        form_data.append('updated_pdf', file);
        form_data.append('pdf_id', '{{ pdf_id }}')

        fetch("{% url 'update_pdf'%}", {
          method: "POST",
          body: form_data,
          headers: {
            'X-CSRFToken': '{{ csrf_token }}',
          },
        });
      }

      // function for updating the pdf file in the backend
      async function update_pdf() {
        if (PDFViewerApplication._saveInProgress) {
          return;
       