I want to print a webview with the Tsp 100 lan printer functionalities which are available on both Android and iOS. I have a DependencyService with a Print method, which calls the platform specific code to access the printing functionalities. The problem is that I am not able to convert WebView to UIWebView or UIImage. Any one know how to convert webview to UIWebView or webview to direct UIImage?
Write a custom webview and invoke your print event
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-renderer/hybridwebview/
Related
I have a URL that needs to display a camera preview, whereas I display the said URL using WKWebView.
However, upon checking the camera preview is not working usingWKWebView, but it quite works when I open the URL using Safari, it's just that the preview only captures a single frame, from there, the image in the preview doesn't change.
Anyone here who tried doing this WKWebView? One workaround that I am thinking of is to use JS bridge.
I am building cordova print plugin using EPSON epos iOS SDK, to use it with hybrid mobile apps( ionic framework based). The sdk provides methods for printing text and image. But I have to print HTML template using it. is there any way to do so?
like if I can prepare UIWebView object from the template and convert it into UIImage. I am new to iOS development so dont know any proper way of doing that.
You can render the UIWebView offscreen, and then capture its as a UIImage. the answers below might help you solve the problem. One problem you may face is that UIWebView doesn't loads unless you add it on a UIWindow, this window can be any UIWindow object, not necessarily the window you are displaying to user.
How to get ENTIRE image from UIWebView including offscreen content
Does iPhone/iPad UIWebView need to be active view to render?
How do I save the contents of a UIWebView as an image
Does video.js support Android WebView?
We use an Android app to put a tablet in Kiosk Mode in which our web app runs. However, webview video tag does not give us a image of the first frame, only the ugly widgets background.
A better question might be whether your WebView supports video.js. You need to configure the WebView to behave equivalently to a proper browser – HTML5 video definitely won't work without some tweaking. I've found this custom web view to work well (including with video.js):
https://code.google.com/p/html5webview/
How can I open or display PDF file without using UIWebView. I need to use UIView for horizontal scroll for PDF View.
If don't want to use UIWebView then your alternative is to use QLPreviewController for showing PDF file.
Can also use UIDocumentInteractionController
Check sample from apple ie docInteraction for more reference.
Check out the OpenSource Reader project on GitHub.
Look up CGPDFDocument and the related APIs. That should get you going.
1) I load a URL in UIWebview ,which has some images .I want to enable the option,"save photo" which appears when you long-press the images in webview.Currently this option is available in Safari Browser.But I couldn't find any option in UIwebView class, And UIdataDetectorType struct dont have option for images (as of my knowledge.)
So how do I have this in my APP?
2) when I open some PDFs in webview ,I want to provide an option to open the pdf in iBooks.
How to do?
Thanks in advance.
GopiKrishnAn
I think this should be 2 separate questions.
1/ Read this blog post by iCab's author: Customize the contextual menu of UIWebView. It shows you exactly how to implement long press detection in a UIWebView.
As a bonus, his blog is a wealth of useful information about UIWebView.
2/ You need to work with UIDocumentInteractionController. As its initialization method (+ (UIDocumentInteractionController *)interactionControllerWithURL:(NSURL *)url) only works with a local URL, I guess you need to download the PDF and save it somewhere before you are able to provide such options.