简体   繁体   中英

How can we set print size UIPrintInteractionController

I want to set A6 Page For Print. i'm using below code for print. but i can't find how i set pageSize and page formate that my print look better.

void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *pic, BOOL completed, NSError *error) {
    if (!completed && error) NSLog(@"Print error: %@", error);
};

UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.orientation = UIPrintInfoOrientationPortrait;

NSData *pdfData = [self generatePDFDataForPrinting];
printController.printingItem = pdfData;


if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    [printController presentFromRect:sender.frame inView:self.view
                            animated:YES completionHandler:completionHandler];
} else {
    [printController presentAnimated:YES completionHandler:completionHandler];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM