Creating pdf with pdfkit?

I have so far developed a app that take user inputs and store them in a realm database. The user then can retrieve this info in a table view which they can then click on a row to get more information about the data stored in that row. They can also edit the information in this tableview and it will get edited in the database. But now I want to be able to export this into a pdf. I have been lokking into PDFKit, but I don´t understand that much. One thing that makes it difficult is that the data stored in the database could in teori be end less. So how do I make the PDF able to write it self “end less” until it have put all the data in rows. Hope someone understands what I am doing here, kind of hard to explain.

But in short I want to make a pdf with some data that is stored in the database. What is the best soulution to this? PDFKit? Any toturials I could use?