Как открыть PDF-файл с согласия в xamarin Android форм - PullRequest
0 голосов
/ 12 июня 2018

Я хочу открыть файл PDF из папки assents в активность в Xamarin Android

1 Ответ

0 голосов
/ 12 июня 2018

in MainActivity.cs

с использованием Com.Joanzapata.Pdfview;используя Com.Joanzapata.Pdfview.Listener;

пространство имен openpdf {[Activity (Label = "openpdf", MainLauncher = true)] открытый класс 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" />
...