I want to open a PDF file from assents folder to activity in Xamarin Android
Asked
Active
Viewed 98 times
-3
-
i try all this solusion : – youssef hribach Jun 11 '18 at 21:41
-
https://stackoverflow.com/questions/41176549/open-pdf-file-in-xamarin-forms – youssef hribach Jun 11 '18 at 21:41
-
i want to open file finished.pdf from assents – youssef hribach Jun 11 '18 at 21:45
-
okey , I will send to you the project link at my github and please help me . – youssef hribach Jun 11 '18 at 21:52
1 Answers
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" />

youssef hribach
- 23
- 7