I need to convert a PDF data array type buffer into an ArrayBuffer. here's an example
this.templateService.get(data[0].templateId).subscribe({
next: async (data) => {
this.datatemplate = data.datatemplate
this.datatemplate {type: 'Buffer', data: Array(185251)} // type of data
when i try to read this data using PDF-LIB,
const pdfDoc = await PDFDocument.load(this.datatemplate)
const form = pdfDoc.getForm()
const fields = form.getFields()
fields.forEach(field => {
const type = field.constructor.name
const name = field.getName()
console.log(`${type}: ${name}`)
})
I've got this error
TypeError:
stringorUint8ArrayorArrayBuffer, but was actually of typeNaN
any help please?
arrayvariable? please show all relevant codearrayvariable is set toNaNwhich definitely is not an arraythisis referring too?