Untitled
unknown
plain_text
a year ago
533 B
21
Indexable
const fs = require('fs');
// Replace this with your byte array
const byteArray = [
// Example byte array (you should replace this with actual data)
0x25, 0x50, 0x44, 0x46, // %PDF
// Add more bytes of your PDF data here
];
// Convert byte array to Buffer
const buffer = Buffer.from(byteArray);
// Write the Buffer to a PDF file
fs.writeFile('output.pdf', buffer, (err) => {
if (err) {
console.error('Error writing file:', err);
} else {
console.log('PDF file created successfully.');
}
});
Editor is loading...
Leave a Comment