I'm trying to create an activity to show information about the monuments. What I thought is to create HTML files and then display them with a WebView. The problem is that I also need to export these contents on sdcard in some type of readable format (preferably pdf but I read some things and it seems very difficult and then I tried several solutions without success). How can I do this? Should I start from another type of format different from HTML?
Advise me a path to follow ... I do not know what else to try.
Thanks in advance. :)
Michele
There are multiple options. I would suggest go the PDF way.
If you have control over the contents, then the best way would be to create PDFs and you can then send a intent to open the PDF. If there are multiple PDF viewers available, then the intent will give an option for the user to select the viewer. If there is only one viewer available, the PDF will be opened in the viewer. If there are no available options, you can then send them to Google Play (Android Market) to download a PDF viewer and then view the PDF.
Related
I'm developing an application to read PDF Files.
So, that my application itself has to read pdf Files. so which library is the best to show pdf files.
I have read a dozen of related articles but I couldn't get the idea.
There is a button on the front page, by clicking that button user gets access to sdcard. all the folders are under his fingers. on opening folders if user open .pdf file , it will open other wise a toast is shown, "this is not a pdf file".
It is hard to find a free and stable library. If you are opting for free try APV PDF Viewer
Make sure you read the license if you are planning of use it.
In one of my applications where I had to display pdf files inside the app, I used radaee pdf viewer. Easy to use, deals with fonts, and maybe stable.Problem is, it is not free. You can try it for free, but you will have a water mark in every page.
Hope this helps. Pdf in android app is not a walk in the park. I think that is the main reason that there are not tons of pdf viewers in google play. Good luck.
I have an PDF file and there are certain inputs that ought to be filled in the same. There are two approaches to this. Either, I create an entirely new screen that looks like the PDF file and get the user inputs and parse it to the iText library to create a PDF file or open the template PDF and fill in the contents through the android screen and save it in different file.
I am trying to concentrate on the second option. Here, I will have to open the existing template PDF and enable the user to enter the input items. I will also have to allow the users to scribble in certain areas. Is this feasible? I have done some research and am not sure, if all these are possible using iText.
Please can someone help me?
I want to show a pdf (preferably) or a word document in my app; like a privacy notice screen. Many applications have it, so it should be possible. i tried loading a simple text file as a start but doesn't provide formatting, fonts or trade mark symbols. I've gone through a few posts but I couldn't apply it to my app. Could anyone tell me how is it done? Could I store the file somewhere in res folder and provide a path to open it through my code? I looked into the following link but I'm not sure if that's the right approach in my case android: open a pdf from my app using the built in pdf viewer.
Android does not support opening PDF and DOC files natively. You'd have to make your own implementation.
Like t0mm13b said, you should consider using HTML (+ CSS) instead and use a WebView.
I need a pointer to a (preferably free) PDF viewer app that I can invoke on a file or URL link via a startActivity on an Intent. I know that there is no real standard - I have one phone that came with OpenOffice that can read local PDF files, and one phone that has no built-in PDF reader.
What I want is the name of an application that I can suggest to my users to download from the market that is a PDF viewer that I can invoke by configuring an Intent and calling startActivity. I would make this suggestion when I intercept a URL to a pdf file, and discover that the application is not yet installed. Although ugly, this is better than the blank screen they get now because the built in browser doesn't do PDF.
I already installed Adobe's PDF viewer but it is not showing up in the package manager as being a candidate to handle PDF files.
I have used the technique suggested in SO:how-to-render-pdf-in-android to examine the candidate activities for a URL based PDF link and a local file PDF link and see that the com.android.browser.Browser is always invoked for http:// URL links; a URL of "file.pdf" causes OpenOffice to be selected on one phone and nothing on the other phone. Adobe's PDF viewer is not a candidate for either approach.
I tried the Google Docs viewer approach (as suggested in SO:android-load-pdf-pdf-viewer but that leaves a lot to be desired, especially as the PDF image I tried to load kept moving further and further down the device's screen until a user would need to scroll several screen fulls of blank screen to get to the document.
I see libraries such as android-pdf-viewer as a potential solution. But I'd prefer to link to another application rather than build in PDF support (including the fonts, etc) into my application. This then allows my application to support multiple PDF viewer applications - choosing one that the user has already installed or suggesting my favorite one if no compatible reader is present when I need it. Potentially I could see using these types of libraries to create such an application and load it to the market place, but before doing that I want to make sure that I'm not re-inventing the wheel.
I found the droid-reader application which looks promising, but this doesn't appear to be available from the market place. While I'm personally comfortable with the gymnastics of downloading files to my sdcard and installing from there, its not a viable option for the general public user that I'm targeting.
I hope the following code snippit would be helpful to you for reading pdfs. It will use the default pdf viewer that has been set on your device.
Intent intent= new Intent(Intent.ACTION_VIEW);
File f = new File("/mnt/sdcard/file.pdf");
intent.setDataAndType(Uri.fromFile(f),"application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplicationContext().startActivity(intent);
I am using the following link inside a WebView to show a pdf file in my android application:
http://docs.google.com/gview?embedded=true&url=http://174.136.1.35/dev/android/1_android-Survey-Report-for-pdf-1200-x-768.pdf
This works, and displays the PDF, as you can see in the attached images. The problem I have is that
I want to disable the zoom controls, and the desktop and download
links.
Is this possible, and if so, how?
You are basically opening a web view and loading it with a webpage from the internet, specifically Google Docs. Without some special functionality built into the website, there isn't going to be way to get rid of the extra buttons, links, and labels you're seeing. Instead of this, you could download the PDF that your link is pointing to as a PDF and try to display that directly. There is a stack overflow question on this topic