appcoda / Print2PDF

An invoice demo showing you how to create PDF documents using HTML templates in iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Page orientation and no of pages rendered

yhelfronda opened this issue · comments

Hi,

Is is possible to change the orientation? 'cause I want to be the orientation in landscape of A4 paper size. And also does not limit the page rendering into 1 page only. Could it be possible to render more pages?

Thank you.

to change the orientation you have to fix this line

UIGraphicsBeginPDFContextToData(data, CGRect.zero, nil)

to

UIGraphicsBeginPDFContextToData(data, printPageRenderer.paperRect, nil)

and then you can change the paper size here:

let pageFrame = CGRect(x: 0.0, y: 0.0, width: A4PageWidth, height: A4PageHeight)