Reputation: 183
// I am using something like this to create a cell but i have no idea how to create flexible table with dynamically data
var doc = new pdfDocument();
doc.lineCap('square')
.moveTo(250, 20)
.circle(275, 30, 15)
.stroke()
Upvotes: 2
Views: 6303
Reputation:
You Have used this code to create table using PDFKit
x1=doc.x;
x6=310;
doc.rect(doc.x, doc.y, 450, 65)
.moveTo(300, doc.y).lineTo(300, doc.y+65)
.moveDown(0.2)
.text('Member Name',{indent:5, align:'left',width:140, height:doc.currentLineHeight()})
.rect(x1,doc.y,450,0.5)
.moveUp()
.text(member_name,x6,doc.y)
.moveDown(0.2)
.text('Member ID',x1,doc.y,{indent:5, align:'left',width:140, height:doc.currentLineHeight()})
.rect(x1,doc.y,450,0.5)
.moveUp()
.text(member_id,x6,doc.y)
.moveDown(0.2)
.text('Member DOB',x1,doc.y,{indent:5, align:'left'})
.rect(x1,doc.y,450,0.5)
.moveUp()
.text(member_dob,x6,doc.y)
.moveDown(0.2)
.text('Baby Due Date',x1,doc.y,{indent:5, align:'left'})
.moveUp()
.text(baby_due_date,x6,doc.y)
.stroke()
.moveDown(1.5);
Upvotes: 1