uiprintinteractioncntrler

How to take PRINT of content from UIWebView?

坚强是说给别人听的谎言 提交于 2019-12-24 02:31:46
问题 I am using swift, i need to take print of a sheet which is opened in UIWebView. let url = webView.request?.url let stringurl = url?.absoluteString let pic = UIPrintInteractionController.shared let printInfo : UIPrintInfo = UIPrintInfo(dictionary: nil) printInfo.outputType = UIPrintInfoOutputType.general printInfo.jobName = stringurl! pic.printInfo = printInfo pic.printFormatter = webView.viewPrintFormatter() pic.showsPageRange = false pic.present(animated: true, completionHandler: nil) 回答1:

Printing Pdf using AirPrint causes small output

点点圈 提交于 2019-12-21 02:38:22
问题 I trying to print a pdf with UIPrintInteractionController that it load in the UIWevView . The good news is that i can print the bad is that the output of the print is to small. any help would be appreciated :) - (IBACTION) printPDF { if ((!_webView)) return; UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController]; void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed,

Printing Pdf using AirPrint causes cut-off content

你说的曾经没有我的故事 提交于 2019-12-12 09:17:37
问题 Here i am printing pdf with size 'pageSize = CGSizeMake(640, 832);'. this size is larget then A4 size page aspected. so i will cut-off some text(means it will not print whole page). while printing same pdf using MAC, it will print whole page with help of option (scale to fit). so can any one help me to come out from this problem.. is there any option in IOS sdk for scale to fit. here is my code.. -(void)printItem { NSArray *aArrPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,

How to create a UIPrintPaper to test UIPrintInteractionControllerDelegate

无人久伴 提交于 2019-12-12 03:28:37
问题 Having written a UIPrintInteractionControllerDelegate , I wish to unit test its paper selection functionality in printInteractionController:choosePaper: Its declaration is: optional func printInteractionController(_ printInteractionController: UIPrintInteractionController, choosePaper paperList: [UIPrintPaper]) -> UIPrintPaper It is a simple matter of calling it with predefined UIPrintPaper values and checking the output. However I am unable to create UIPrintPaper instances. Here is how

Printing Pdf using AirPrint causes cut-off content

时光总嘲笑我的痴心妄想 提交于 2019-12-04 19:26:51
Here i am printing pdf with size 'pageSize = CGSizeMake(640, 832);'. this size is larget then A4 size page aspected. so i will cut-off some text(means it will not print whole page). while printing same pdf using MAC, it will print whole page with help of option (scale to fit). so can any one help me to come out from this problem.. is there any option in IOS sdk for scale to fit. here is my code.. -(void)printItem { NSArray *aArrPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) ; NSString *aStr = [[aArrPaths objectAtIndex:0] stringByAppendingPathComponent:

Printing Pdf using AirPrint causes small output

时间秒杀一切 提交于 2019-12-03 08:41:43
I trying to print a pdf with UIPrintInteractionController that it load in the UIWevView . The good news is that i can print the bad is that the output of the print is to small. any help would be appreciated :) - (IBACTION) printPDF { if ((!_webView)) return; UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController]; void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) { if(!completed && error){ NSLog(@"FAILED! due to error in domain %@ with error code

Skipping the Printing UI in IOS 8?

懵懂的女人 提交于 2019-11-27 20:49:54
问题 I could find some code for skipping the Printing UI and direct print through the Air Printer.But the code was incomplete. The code is below, UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:self.savedPrinter]; [printPicker presentAnimated:YES completionHandler: ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error) { if (userDidSelect) { self.savedPrinter = printerPicker.selectedPrinter; } }]; In

Print paper size and content inset

我们两清 提交于 2019-11-27 15:22:35
问题 I'm using following code to print HTML content containing text and images. if (![UIPrintInteractionController isPrintingAvailable]) { UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Printer Availability Error Title", @"") message:NSLocalizedString(@"Printer Availability Error Message", @"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"OK") otherButtonTitles:nil] autorelease]; [alertView show]; return; } UIPrintInteractionController *pic =