airprint

iOS 4.2 - Printing DOC, PPT, XLS, etc. with Apple AirPrint?

爱⌒轻易说出口 提交于 2019-12-02 19:51:51
I've been playing with iOS 4.2 UIWebView + AirPrint. The problem, however, is that getting the viewPrintFormatter from the UIWebView I'm able to print PDF and images, but not DOC, DOCX, PPT, PPTX, etc. Those files are displayed properly in the UIWebView, but Airprint will print blank pages. Here is my code: [internalWebView loadData:[[printContent objectAtIndex:0] data] MIMEType:mimeType textEncodingName:nil baseURL:nil]; UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; //pic.delegate = self; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo

AirPrint Connection Refused Error

与世无争的帅哥 提交于 2019-11-30 14:33:59
In my iOS app, I have the following code that is being used for AirPrinting a simple NSString. #pragma mark - Print -(IBAction)print:(id)sender { UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; pic.delegate = self; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputGeneral; printInfo.jobName = @"Message"; pic.printInfo = printInfo; UISimpleTextPrintFormatter *textFormatter = [[UISimpleTextPrintFormatter alloc]initWithText:self.Message.text]; textFormatter.startPage = 0; textFormatter.contentInsets =

AirPrint Connection Refused Error

久未见 提交于 2019-11-29 21:00:11
问题 In my iOS app, I have the following code that is being used for AirPrinting a simple NSString. #pragma mark - Print -(IBAction)print:(id)sender { UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; pic.delegate = self; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputGeneral; printInfo.jobName = @"Message"; pic.printInfo = printInfo; UISimpleTextPrintFormatter *textFormatter = [[UISimpleTextPrintFormatter alloc

Generating a PDF using the new printing stuff in iOS 4.2

删除回忆录丶 提交于 2019-11-28 17:40:32
Historically, my app has generated confirmations as plain HTML and passed that HTML to the normal MFMailComposeViewController for emailing to the customer. I wanted to try to leverage the new printing classes in iOS 4.2 to render the HTML to a PDF instead and send that as an attachment. I tried the following: NSString *html = /* generate my HTML here */ NSMutableData *pdfData = [NSMutableData data]; UIMarkupTextPrintFormatter *fmt = [[UIMarkupTextPrintFormatter alloc] initWithMarkupText:html]; // Render the html into a PDF UIGraphicsBeginPDFContextToData( pdfData, CGRectZero, nil ); for

Printing UIImage using AirPrint causes cut-off content

半城伤御伤魂 提交于 2019-11-28 07:45:07
问题 I am printing out a UIImage using AirPrint but the margins aren't correct. This is what it looks like when it prints: Is there a way I can make it fit perfectly on the paper? Here's the code as requested: UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; //pic.delegate = del; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputGeneral; printInfo.jobName = [NSString stringWithFormat:@"New Ticket"]; pic.printInfo =

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 =

iOS print without allowing UIPrintInteractionController to appear

只谈情不闲聊 提交于 2019-11-27 14:11:32
I am researching a potential app for a client, and I had a question I wasn't able to find the answer on. What I would like to do is print automatically, without having the UIPrintInteractionController get displayed. An important point I should make is this will not be a production app. I know that otherwise this could violate the user's privacy to just print without the user's consent, but again this will not be a public app on the App Store. One app I found that seems to be able to this is Printer Pro . The user is prompted to print a test page, and the page prints without the

Generating a PDF using the new printing stuff in iOS 4.2

丶灬走出姿态 提交于 2019-11-27 10:39:08
问题 Historically, my app has generated confirmations as plain HTML and passed that HTML to the normal MFMailComposeViewController for emailing to the customer. I wanted to try to leverage the new printing classes in iOS 4.2 to render the HTML to a PDF instead and send that as an attachment. I tried the following: NSString *html = /* generate my HTML here */ NSMutableData *pdfData = [NSMutableData data]; UIMarkupTextPrintFormatter *fmt = [[UIMarkupTextPrintFormatter alloc] initWithMarkupText:html]

Printing the view in iOS with Swift

断了今生、忘了曾经 提交于 2019-11-27 04:26:48
问题 I am developing an app which requires visitor passes to be generated and printed directly from an iPad over AirPrint. I have looked everywhere to find out how to print a view but I can only find how to print text, webKit and mapKit. Is there a way of printing an entire view? If not, what would be a good solution to print a visitor pass which will be plain text, boxes and a photograph. Thanks. 回答1: I have found the answer to my question by modifying the code found here: AirPrint contents of a