sgr-ksmt / PDFGenerator

A simple generator of PDF written in Swift.
MIT License
755 stars 110 forks source link

Split UIScrollView into multiple Pages #96

Closed messi closed 5 years ago

messi commented 6 years ago

I created a new case of the PDFPage enum and extended the render function of UIView to render just an area (CGRect) of a view.

There is also a factory method to create multiple pages from one UIScrollView. To do so you have to specify a configuration which defines the ratio (A4, Letter, custom, ..) and a percentage which defines which part of the last page should be repeated on the next page.

spydercapriani commented 6 years ago

Interestingly enough, I see that it generates multiple pages but after the first page, the page content is empty... Perhaps I'm not understanding correct usage.

let pages = PDFPage.pages(collectionView)
let pdf = try PDFGenerator.generated(by: pages)
sgr-ksmt commented 5 years ago

Thank you for submitting PR. I will further improve upon receiving this PR so please wait for a while. 🙏

markst commented 5 years ago

https://github.com/sgr-ksmt/PDFGenerator/issues/41