foliojs/pdfkit

How can I control the margins or other options of the new pages that are created automatically when content overflows?

Opened this issue · 0 comments

I am creating a pdf in which odd and even pages have different margins. I can do that by manually creating pages but when content overflows a new page is created automatically and I cannot control the margins of it.

Any suggestions? Is there a feature that allows to manipulate this?

I am thinking of a workaround in which I measure the height of the string prior to adding it to the document and then calculate the amount of pages it will stretch so that I can create those pages in advance with the required margins. However, when a lot of different strings start overflowing things start to get messy.

Any ideas about how can I achieve this? Bear in mind that I have like 200 separate strings to add to the document and some of them might span for several pages while others just a line. Furthermore, strings vary in length depending on the user data.

Thanks