Monotouch open pdf on device?

xamarin.ios

Solution

First make sure your file is marked as `Content` in the `Build Action` from MonoDevelop. That will ensure it gets copied inside your application bundle.

Then, from your application, you can get your application bundle path using the following property:

NSBundle.MainBundle.BundlePath

From this you can try to probe for your file, e.g.

if (File.Exists (Path.Combine (NSBundle.MainBundle.BundlePath, "myfile.pdf")) {
    Console.WriteLine ("got it");
} else {
    Console.WriteLine ("can't find it");
}

Once you find the right path to your file you should be able to provide it to your PDF library.

Problem

I need to open a pdf from my bundle in monotouch app. I don't know if it is from the path or not but i can't open that pdf. Can somebody give me an example of how to open a pdf file? I am using pdftron library.

Original source