Multiple page PDF
suggest changeUIGraphicsBeginPDFContextToFile(fileName, CGRectZero, nil);
UIGraphicsBeginPDFPageWithInfo(CGRectMake(0, 0, 600, 792), nil);
UIGraphicsBeginPDFPageWithInfo(CGRectMake(0, 0, 600, 792), nil);
UIGraphicsBeginPDFPageWithInfo(CGRectMake(0, 0, 600, 792), nil);
UIGraphicsEndPDFContext();
This is Swift 2 (CGRectZero and CGRectMake). fileName must be a writable path. Nothing is drawn, so the file is three blank pages. UIGraphicsBeginPDFContextToFile returns false when the file cannot be created; this sample ignores that result.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents