1

I have a task where I need to export the html to pdf.Where the pdf should have same design as it has in browser.Basically I need the css should also work in pdf file. Am using angularjs for front end.

0

1 Answer 1

1

Here is Plunker First run pdfSample.js on cmd as -- node pdfsample.js Then include html and js file in your workspace where you want to get pdf . Then try running as you do .It will work.

   pdf.create(renderedHtml, options).toStream(function (err, stream) {

    res.setHeader('Content-type', 'application/pdf');
    console.log("*****inside pdf create ******");

    stream.pipe(res);
   stream.pipe(fs.createWriteStream('invoice.pdf'));
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.