2

I am adding pdf files created by wkhtmptopdf to archiver.My purpose is to create a zip file of all the pdf's.I am posting the zip to s3 bucket. BUt in the bucket some files are missing in the zip file. Randomly out of all files some files are empty in the zip.

for (var i = 1; i <= dataCount; i++) {

    var output_filename = 'testing' +'_'+i+'.pdf';

        const html = "sdfsdfsdf";

    var obg= wkhtmltopdf(html, wkhtmltopdfOptions); 


     var results = [];


     archive.append(obg, { name: output_filename });
 } // closing the for loop
    archive.finalize();
Ashish
  • 21
  • 1
  • Have you considered adding code to verify the zip files & content before uploading? Log an error when your verification code catches a bad archive (before it is uploaded) remake it, and then upload it? It would both solve your problem immediately, as well as aid in debugging the issue. – nxSolari Jul 09 '18 at 19:19
  • Does `archive.append()` have a return value that you should be checking? – Michael - sqlbot Jul 09 '18 at 22:33
  • Thanks for your answers. I am facing an additional issue in that when i am converting one pdf file its working fine but for many pdf aws lambda is giving memory error. My aim is to convert 200 html to pdf's. Is wkhtmlto pdf the only way ? – Ashish Jul 10 '18 at 17:21

0 Answers0