[mono-android] View PDF file in App
Daniele Salvatore Albano
d.albano at gmail.com
Fri Jan 13 11:08:30 UTC 2012
--- Short answer
you can't use foxit pdf sdk because they supply a compiled binary only
for windows
--- Long answer
While you can use any library that you want:
- they must be posix compliant (or, however, need to run on linux)
- they must support arm architecture
- if the libraries have dependencies, them must respect the point 1 and 2
- if you want to use from java world, they must have a "jni interface"
(not needed in this case, you could use them through m4a)
- you need the source code to compile using the android ndk or you
need the compiled binary for arm/android
In this case, we're talking about viewing a pdf, a rendering, and not
only it, is involved so foxit pdf sdk must support rendering to a
buffer, and in this way you can draw it on the screen, or it must
support the android architecture for native rendering.
Foxit PDF SDK doesn't support directly android and, to support it,
probably a mass refactoring is needed (parsing and processing need to
be splitted out from view and the view itself need to be splitted in
two parts, an engine interface and the engine itself ... and every
part need to be OS indipendent, so another layer is needed ... at
least)
However, if you don't really need to use a pdf, you could try using an
html page and a webview. In this way you would have everything in the
same app, the activity that shows the pdf will be in your application.
However you need to do some load tests, because a 100 page document is
quite big.
Just convert it to an html page and try to load it using a webview
Take a look to this tutorial to use the webview
http://docs.xamarin.com/android/tutorials/User_Interface/web_view
In LoadUrl use something like file:///path/to/your/file.html to load
files with an absolute path or file:///android_asset/file.html to load
files from the assets folder of your project
2012/1/13 Marc Reiter <reiter at reitec.de>:
> @Jonathan: I 'didn't get it? Should I use an Intent, or do you think this is
> a poor solution?
>
> Anyone tryed the foxit PDF SDK? We use this in Windows environment with good
> results. But I've no idea if it is possible to bind with Mono for Android,
> and also I've to ask what we need to pay?
>
> Is it possible to link other Andriod Libraries to Mono for Android?
>
> Regards marc
--
Daniele Salvatore Albano
---
IT Consultant
Website Design and Development
Software Engineer and Developer
Linux Servers SetUp And Administration
Embedded Network Solutions
http://www.daccii.it
http://www.itechcon.it
More information about the Monodroid
mailing list