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 capture any print requests that come from the webview.


回答1:


I was able to get in touch with an Apple engineer who confirmed it is impossible to receive the window.print request from UIWebView. For my purposes, I just use javascript to change the window.print function to a command that will tell me the print request was made, and then I can print the part of the webview that I needed.



来源:https://stackoverflow.com/questions/13280972/capture-print-requests-from-a-uiwebview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!