2

// 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()

1 Answer 1

1

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);

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.