By using webview, I am able to show pdf in iOS, but in android it always shows white screen.
I am using webview to show pdf in my mobile app. In iOS it works fine but in android, it keep on showing white screen. I know there are some packages like react-native-pdf which can do this, but I want to do it through webview. Is it possible if yes then how?
<WebView
source={require('./android/app/src/main/myPdf.pdf')}
/>
It should show pdf in android app, but it is showing white screen everytime.
Via Webview (Android) is not possible to embed a "./...pdf" URL directly.
You can load the PDF in an external PDF manager (ex. Google Docs) and use that URL.
Related
I have a small react app (for mobile only) with image capture tag to click image from camera only (block file picker dialog)
<input type="file" accept="image/*" capture="camera" onChange={this.handleUploadImage} />
I'm using it to capture image from android and ios browsers.
This tag works fine in chrome for android and safari for ios, but when it opens up in facebook messenger's webview then it doesnot open the camera, instead it opens up file picker dialog in android.
So is there any way to open up camera in facebook messenger's webview and block access to file picker dialog?
Any help would be appreciated
From what I can see, you are trying to access camera with input type "file". While it works good in a browser, any webview of an application treats it as a tag for file input/upload.
What you need is to create a module which allows access to camera even in webview, and use that where you want it to. A camera module can be created using getUserMedia() api, also you can checkout webrtc and webkit for this.
Please check the support for getUserMedia() api in different browsers for better understanding. As it dont work in chrome/firefox for ios as of now.
You can also use open source dependencies available, some of which are:
react html 5 camera
react-camera
I use UIWebView in my app. And only one site load without css styles (only mobile version, with desktop all alright). I try load this site in Safari on my iOS device, all good. There is problem only with webView.
Doesn't help load with UIWebView LoadRequest method or transition to this page from full version of site.
Source code of this site has tag <noscript> and text from this tag shown on this webview.
It's look like something don't let download all scripts and styles, because in Chrome I looked source code of full loaded mobile site and it has more scripts, then page in WebView.
Moreover, I tried change UIWebView to the WKWebView, the problem remained. Also I use Xamarin.Forms and tried Forms.WebView - nothing. Is it a problem with code of site?
I am using android webview to display some webpage assets to display it as a book. So if i tried to make it print then it takes the whole document view as a single page. I have to split the content page wise programmatically. So that i can select pages for not only print, it can be used for thumbnail or any other options. In this i am using java script interface to display webpages in android webview. So kindly help for any suggestions or references regarding this splitting concept to achieve splitting the webpages in android webview.
you can try jsoup ,http://jsoup.org/ It can get web content based on tags
I have an android app I developed using the cordova framework using HTML5 for the interface. I have a form with a file input tag used to grab photos or videos from the device. In the Ios version, clicking this button pops a dialogue where you can select to capture a pic or video, which is then used by the app.
However, in the android version, the file browser dialogue pops with no options to capture direct. This is my problem. I want to be able to have the pic and video capture options displayed.
I subsequently use uploadifive to send some text and the selected media(video or pic) to a server.
When I do this from the web version of this form, using the android browser, both video and picture capture options appear and work great.
In the app I have tried using the capture options in the file input tag as follows:
<input type="file" name="image" id="image" accept="image/*; capture=camera" />
But this is not working either.
You will have to use cordova's capture event for camera to work. Check cordova documentation.
I'm using Xcode v4.2, PhoneGap v1.4 and Mac v10.7.1. My application is working fine.
How can I export the current HTML page to PDF? I want to place a button exportToPdf on top bar.
I have tried jspdf but it successfully export page in browser Firefox without PhoneGap.
But I need this functionality with phonegap.
Maybe using XSL-FOP?
http://www.codeproject.com/Articles/37663/PDF-Generation-using-XSLFO-and-FOP