sgr-ksmt / PDFGenerator

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

Export to a specific size #45

Closed chaitanya-ramji closed 8 years ago

chaitanya-ramji commented 8 years ago

Is it possible to export the view to a specific size such as Imperial or A4?

sgr-ksmt commented 8 years ago

@chaitanya-ramji

Sorry for replying late..

you can use PDFPageSize.A4.

let view = ...
view.frame = CGRect(origin: origin, size: PDFPageSize.A4)
do {
    try PDFGenerator.generate(view, outputPath: path)
} catch {
    // ....
}
haemi commented 7 years ago

but this doesn't scale the pdf, right?