const fs = require('fs'); function convert( filename, pages ){ console.log(pages) if (filename.endsWith('.pdf')) { let data = pages.map( p => "").join('
') // could have a richer datastructure with e.g. p.number for the page number and p.x and p.y for CSS absolute positioning const outputFile = './public/saved/html/'+filename+'.html' fs.writeFileSync(outputFile, data); } } module.exports.convert = convert