pofider / phantom-html-to-pdf

Highly scalable html to pdf conversion using phantom workers
MIT License
159 stars 33 forks source link

Blurred, overlapping text when generating a PDF #100

Closed EwanValentine closed 6 years ago

EwanValentine commented 6 years ago

Hi folks,

Any ideas what might be causing the issues in this screenshot?

screenshot from 2018-10-09 22-28-54

I'm running this in an AWS Lambda. I've also tried running it locally, I get the same results. I'm using the basic config:

const fs = require('fs');
const conversion = require('phantom-html-to-pdf')();

const report = (content) => {
  return new Promise((resolve, reject) => {
    conversion({
      html: content,
      waitForJS: true,
    }, (err, pdf) => {
      if (err) {
        reject(err);
      }
      const output = fs.createWriteStream('report.pdf');
      pdf.stream.pipe(output);
      resolve(true);
    });
  });
};

module.exports = {
  report,
};
EwanValentine commented 6 years ago

This was totally my mistake. Please ignore (dodgy html tables).