airprint

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

iOS enabling AirPrint for uiwebview contents

你。 提交于 2019-12-10 17:46:59
问题 I am super new to XCode and App development. I currently am loading up a web based application in uiwebviews on the iPad. When one particular page is loaded, it displays a pdf file. I would like to be able to print this pdf file using AirPrint. I am looking for a simple solution. Currently the app I am working on has 6 files which it uses. -ViewController.m -ViewController.h -MainStoryboard_iPad.storyboard -MainStoryboard_iPhone.storyboard -AppDelegate.h -AppDelegate.m In the MainStoryboard

Capture print requests from a UIWebView

假装没事ソ 提交于 2019-12-08 09:37:29
问题 I have an app that is a wrapper for a website. It allows us to use a third party web app for some services in our business. One of the things it will do is print labels. In mobile safari if I do the setup and press print, the request is processed in safari and I can print without any issue using air print. Inside of my custom app the uiwebview makes the same request however nothing is sent to the printer. I have added a popover that I can manually submit a print job, but I can't manage to

AirPrint the contents of a Text View using Swift

那年仲夏 提交于 2019-12-07 18:20:13
问题 I have a UITextView and I need to AirPrint the contents using Swift. I've tried to adapt Object-C code as much as possible, but I don't know Object-C (or how to convert it to Swift) so it has been quite a challenge. Here is what I have so far: var pic:UIPrintInteractionController = .sharedPrintController() var viewpf:UIViewPrintFormatter = myTextView.viewPrintFormatter() var myData:NSData = (myTextView.text as NSString).dataUsingEncoding(NSUTF8StringEncoding) pic.delegate = self pic

Unable to display printer options with AirPrint

偶尔善良 提交于 2019-12-06 04:22:01
I want to add AirPrint functionality to my iPad application I have been trying to display printer ontions described in Apple's Drawing and Printing Guide I have toolbar and UIBarButtonItem *printButton . In controller I receive onPrintClick and try to display printer options by such code: UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController]; [controller setDelegate:self]; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { [controller presentFromBarButtonItem:self.printButton animated:YES completionHandler:completionHandler]; } else {

AirPrint the contents of a Text View using Swift

血红的双手。 提交于 2019-12-05 21:29:01
I have a UITextView and I need to AirPrint the contents using Swift. I've tried to adapt Object-C code as much as possible, but I don't know Object-C (or how to convert it to Swift) so it has been quite a challenge. Here is what I have so far: var pic:UIPrintInteractionController = .sharedPrintController() var viewpf:UIViewPrintFormatter = myTextView.viewPrintFormatter() var myData:NSData = (myTextView.text as NSString).dataUsingEncoding(NSUTF8StringEncoding) pic.delegate = self pic.showsPageRange = true pic.printFormatter = viewpf pic.printingItem = myData; //if (UIPrintInteractionController

printing to an AirPrint printer from Android [closed]

流过昼夜 提交于 2019-12-04 08:32:11
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Has anyone heard of anyone having any success implementing Apple's new AirPrint protocol on Android? From various descriptions, it appears to be a fairly simple protocol employing Internet Printing Protocol,

How to Add Images in UIMarkupTextPrintFormatter?

穿精又带淫゛_ 提交于 2019-12-04 00:34:19
I'm trying to print a file using straight HTML, however, I am having difficulties adding images to the print file. How can I reference images in my project in the HTML that I want to print? Does the UIMarkupTextPrintFormatter support tags? It's actually much simpler than I thought: NSString *yourImagePath = [[[NSBundle mainBundle] URLForResource:@"resource" withExtension:@"extension"] absoluteString]; Then you can put the image path in an <img> and it will render the image! Voila! I have been at this all day, and no matter how I incorporate images into my print jobs, it always seems to not

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

走远了吗. 提交于 2019-12-03 06:25:45
问题 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

printing to an AirPrint printer from Android [closed]

梦想与她 提交于 2019-12-02 22:28:00
Has anyone heard of anyone having any success implementing Apple's new AirPrint protocol on Android? From various descriptions, it appears to be a fairly simple protocol employing Internet Printing Protocol , bonjour and PDF: http://www.finnie.org/2010/11/13/airprint-and-linux/ These technologies all appear to be possible to implement on Android, but I'm wondering if there are any likely stumbling blocks? (I realise AirPrint only works with a handful of printers just now, and only 11 HPs as listed on Apple's airprint page , but it is presumably only a matter of time before it becomes much more