4

I have been working since yesterday to generate the report in Pdf format. I have gone through pdfkit module. And It seems pretty cool to use. My requirement is list the text with bullet point. I have tried like this

     var doc = new PDFDocument();
     doc.pipe(fs.createWriteStream('userReport.pdf'));
     doc.fillColor("#B22222")
     .fontSize(25)
     .text('Users Count', 250,60)
     .moveDown(0.5); 

It is creating the text but I want the text with bullet. How to do this?

2 Answers 2

5
// list params: array, x, y, other params
doc.list([1, 2, 3], 50, 50, {
  // this is how automatic line wrapping will work if the width is specified
  width: 100,
  align: 'left',
  listType: 'bullet',
  bulletRadius: 0.01, // use this value to almost hide the dots/bullets
});

This is how it works for me, I hope it helps someone

Sign up to request clarification or add additional context in comments.

Comments

4

Simply, for listing

 .list()

You may check some samples at

https://github.com/devongovett/pdfkit/tree/master/docs

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.