How can I implement zoom functionality in pdf in android? - android

I am creating a magazine app, in which iI wan't to add zoom functionality. How can I do this?

Convert .pdf file into .png and then either load that .png file into ImageView or in WebView and apply zoom functionality.

Related

Displaying a image captured using Camera inside an html image tag placed within a WebView - Xamarin.Android

I'm looking for a way on to display the image captured using Camera2 API in Xamarin.Android inside an HTML tag which is placed within a WebView.
Though it was possible to obtain the File URi where the image is located, setting it into the image tag which I have tried, isn't working. I also want to know whether this kind of thing can be done in Native Android.
You can encode the content of the image in base64, and than set it in the src of your img tag like this:
<img src="data:image/jpg;base64,VeryLongBase64EncodedImageData"/>

Can i center external content in a WebView?

I am loading an image from external url directly in a WebView. So now i want to center that image. I can't edit the file to add css or js. Is it possible and when it is, how?

How to drag an image in html file displayed using webview in android?

I have an Android WebView loaded with a html file(actually stored in some folder under sdcard) that is having one/two/three image(s). Is it possible to drag-drop any one of those images?
If its possible, below are my doubts
When i drag an image from (x1,y1) place and drop it in another (x2,y2)place, How can i change the original source file code as the image place is changed ?
When i open the same html file in next time (using default html viewer or my app), i should see the image in (x2, y2) place. Isn't it possible ?
I tried this drag ImageView inside a WebView. But it is just adding an imageview to webview. (So, when i run the same app next time, i don't see the image in the place where i dropped it in first run.) But i need to drag an image presented in source html file. So After every drag-drop, Do i need to render the webview content and create a new html file to see the image in dropped location?
Is it possible to read the android-webview content? (like we read the web page content in java).
Can anyone clear my doubts and suggest me a better way if iam going/thinking wrong?
I don't think it possible (without using some not trivial tricks) to implement the drag and drop as you wish. for the other point's you raised - if the file is on your sd - why not just parse the html file and get the pictures positions and source link and use it to implement the drag and drop on your own? after all- the html file is an xml file which contains attributes which defines positions/links/images/text

Android PDF page to image api

Is there any possible way to convert a pdf into image and show them on a image view?
PDF isn't made up of images, they're vectors.
Tcouple open-source java PDF to Image converters though like:
http://www.jpedal.org/
http://code.google.com/p/pdfonejava/

How display a loading image correctly on Android phone

I have been trying to use a .gif file from my resources, but I get no movement when it loads. I am using it as a loading image while I am doing an asynchronous task. I was previously using a progress dialog but now I would like to display the image myself and not use a dialog. How can I get this image to display correctly?
Try using AnimationDrawable:
http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html
Basically, you should split each of the frames in your gif into separate files - such as .png file (say if it had transparency) and specify these files in the <animation-list> instead. You can also control the duration of each frame.
See the link for code example
If you are deadset on using a gif image you can just use a WebView instead of an ImageView. Then make an html doc that displays your gif image. When you show it in the WebView it will be animated for you.

Categories

Resources