I have to show a PDF file inside my application and the PDF file contains a link inside (this link sends the user to the website).
I am searching for a library that allows me to show the file inside my application and if the user clicks the link, open a browser.
Is it possible?
Thanks in advance! :)
I personally use this one : AndroidPdfViewer
you can use a webview also following this example : Example pdf on webview
Related
so i found a way to open pdf file using open_file but now i want to open with specific page.. for example there is 10 page and i want to navigate to page 5 as initial page when it is done opening from default app.. is there a way to achieve that?? i want to avoid open pdf in app using other plugin.. the thing is i have like 360 page pdf and i want user to be able to open to specific page when he pressed a button...
open_file plugin can't do that.
here for android source code and here for iOS source code.
You may change to another plugin such as syncfusion_flutter_pdfviewer or any one can do this.
This link,
intent://www.youtube.com/watch?v=uYqxf5eiLSU#Intent;package=com.google.android.youtube;scheme=https;end
opens the specified content inside the app.But typing this link in to the browser is not opening up the app. So how are these links supposed to be used?
I know using it in anchor tags like below will enable users to click the link, and user will be taken to desired place.
Click to open in android.
But how can we open these links directly without the help of a webpage? Or is there any other ways to open deeplinks?
Any help is appreciated.
Just copy the URL without changing anything.
Also you can add target="_blank" attribute to open in new page.
Open stackoverflow
In your case, you can pass this link to refer to your video.
Open my awesome yt video!!
I have a webview that points to a website:
webView.loadUrl("https://websmash.herokuapp.com/");
When the user clicks on a file upload button in the website it should open a file upload dialog on the phone.
Matt Gaunt has provided a fully-functional example using onShowFileChooser(), although the file upload button is in the local index.html file. I've been trying to get this working for a website inside the webview, but to no avail.
What adaptations must be made to get it working when the button is in the website which the webview points to?
Take a look at this SO Post. Per the author`s answer code works for all android versions.
I have an app where I've button on a webpage that is rendered inside a webview.
Now on click of button , a pdf file gets downloaded , and the same would then need to be opened inside the same webview.
attach a download listener to the web view and change the url as follows..
"https://docs.google.com/gview?embedded=true&url=https://www.example.com/xxxxxyyyyyxz.pdf"
example
https://docs.google.com/gview?embedded=true&url=https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf
it's a link used to open pdf without downloading it...
I hope it solves your problem..
I've found that the google viewer seems to work within the android browser for viewing online PDF files. You could build a link to your pdf so that it is displayed in the viewer. I've not tried doing that within a WebView though.
UPDATE
The link is dead, there is an explanation of how to get the functionality to still work at this link.
In case this link also dies, here is the relevant section:
While the page is no longer available as it redirects to Google Docs/Drive, you can still use the Google Docs Viewer. Paste this URL in a new tab:
https://docs.google.com/viewer?url=
and then paste the address of the document you want to view online. Here's an example:
https://docs.google.com/viewer?url=http://research.google.com/archive/bigtable-osdi06.pdf
I do not think that the present android chrome based browser can support pdf. There are discussion about the same in android forums ( ex: link1 link2)
Your best bet to show pdf is to have adobe pdf reader for android installed.(or concisely put, not possible in web view)
I don't think any browser other than Chrome supports rendering PDFs without a plugin or third party tool. It's probably easier to let the user use his own app to open PDFs.
I used the IText PDF library mentioned in this thread
Android : Is there any free PDF library for Android for a sample project. You could try getting using this API to get the PDF page as an image. I am not familiar with every aspect of Itext so it might have better way to do this.
Here is my question:- I have many pdf files in my application in files folder.I want to display them on web view when user clicks on its hyperlink from another web view.
That is I have one web view which dynamically generates a html page from html template stored in asset folder.In that there we have one hyperlink of pdf file corresponding to data displayed.When user clicks on hyperlink I want to display it in web view.Can it be possible?
Please reply.
Thanks in Advance.
I think the best way for you is using Google Docs.
You can implement in your application Pdf-viewer from Google Docs.
Just put in your html page following code:
<iframe src="http://docs.google.com/gview?url=http://YOUR-URL&embedded=true" width="500" height="250"></iframe>
You can catch user click and redirect user to special page with Google Docs Pdf-viewer