how can I convert the ‘string’ from arrayBuffer to arrayBuffer again?
const filePath = path.join(pdfFolderPath, file); // Read the PDF file const fileData = await fs.readFile(filePath); // Load the PDF document const pdfDoc = await PDFDocument.load(fileData); const arrayBuffer = await pdfDoc.save(); // Save as ArrayBuffer // Get the file name without extension const nameWithoutExtension = path.basename(file, path.extname(file)); // Convert to Base64 string for JSON pdfArray.push({ name: […]