SimplePDF icon indicating copy to clipboard operation
SimplePDF copied to clipboard

How to begin new page automatically

Open hitesh-shukla opened this issue 5 years ago • 2 comments

Hi there,

how can we determine page height according to content, basically i have define pagesize but unable to begin new page as data is overlapping in single page

can you help me out how can start new page automatically

hitesh-shukla avatar May 22 '19 06:05 hitesh-shukla

Hey, I tried it. pdf = SimplePDF.init(pageSize: CGSize.init(width: 595, height: 841), pageMarginLeft: 100, pageMarginTop: 180, pageMarginBottom: 20, pageMarginRight: 100)

For every loop in your data just add pdf.beginNewPage() at the beginning. It'll create a new page for new content and if any content is long, it'll extend content to the new page automatically.

shashi-iitr avatar Aug 01 '19 04:08 shashi-iitr

what do

Hey, I tried it. pdf = SimplePDF.init(pageSize: CGSize.init(width: 595, height: 841), pageMarginLeft: 100, pageMarginTop: 180, pageMarginBottom: 20, pageMarginRight: 100)

For every loop in your data just add pdf.beginNewPage() at the beginning. It'll create a new page for new content and if any content is long, it'll extend content to the new page automatically.

What do you mean "for every loop in your data"? Can you be more precise?

ghost avatar May 31 '20 12:05 ghost