-3

I want to open a PDF file from assents folder to activity in Xamarin Android

1 Answers1

0

in MainActivity.cs

using Com.Joanzapata.Pdfview; using Com.Joanzapata.Pdfview.Listener;

namespace openpdf { [Activity(Label = "openpdf", MainLauncher = true)] public class MainActivity : Activity {

    PDFView pdf;
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        SetContentView(Resource.Layout.Main);

        **pdf = FindViewById<PDFView>(Resource.Id.pDFView1);
        pdf.FromAsset("finished.pdf").Load();**
    }
}

}

Main.Axml

<com.joanzapata.pdfview.PDFView
    android:layout_width="match_parent"
    android:layout_height="548.5dp"
    android:id="@+id/pDFView1" />