Szpadel / chrome-headless-render-pdf

223 stars 67 forks source link

Multi pdf example not working #75

Closed KevinDenys closed 3 years ago

KevinDenys commented 3 years ago

const RenderPDF = require('chrome-headless-render-pdf'); RenderPDF.generateMultiplePdf([ {'http://google.com', 'outputPdf.pdf'}, {'http://example.com', 'outputPdf2.pdf'} ]);

Running this example gives the following output

{'http://google.com', 'outputPdf.pdf'}, ^ SyntaxError: Unexpected token ',' at wrapSafe (internal/modules/cjs/loader.js:979:16) at Module._compile (internal/modules/cjs/loader.js:1027:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47

Single pdf example is working fine

Szpadel commented 3 years ago

This is typo in README, obviously this isn't valid js syntax, Fixed in https://github.com/Szpadel/chrome-headless-render-pdf/commit/b3cf72aa8a81f98cda87297fc32b65468b42e5b1