My goal is to generate an editable PDF using JavaScript and AngularJS, allowing users to input data into text fields on the document. However, when I download the PDF, the text fields are not editable. Here is a snippet of the code:
var opt = {
margin: 0,
filename: name+'doc.pdf',
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' },
pagesplit: true
};
html2pdf().set(opt).from(element).save();
I found a similar snippet online in PHP that seems like it could achieve what I'm looking for, but I'm unsure how to convert it to JavaScript/Angular and test the code:
$html2pdf = new HTML2PDF('P','A4', 'en', false, 'ISO-8859-15');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$html2pdf->Output('pdf_demo.pdf');
Here is the library I am currently using:
<script src="/static/pdf/html2pdf.bundle.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>
Can anyone guide me on how to create a PDF with editable text fields?