VS 2017 Xamarin, open PDF file and configurating copies number
I'm developing app with xamarin an c# and I'd like to open a pdf file and to can configurate de copies number for example copies = 2.
Thanks
my code---------------------------------------------------------
public void OpenFile(string filePath, string filename)
{
var bytes = File.ReadAllBytes(filePath);
//Copy the private file's data to the EXTERNAL PUBLIC location
string externalStorageState = global::Android.OS.Environment.ExternalStorageState;
string application = "application/pdf";
string extension = System.IO.Path.GetExtension(filePath);
var externalPath = global::Android.OS.Environment.ExternalStorageDirectory.Path + "/" + filename + extension;
File.WriteAllBytes(externalPath, bytes);
Java.IO.File file = new Java.IO.File(externalPath);
file.SetReadable(true);
Android.Net.Uri uri = Android.Net.Uri.FromFile(file);
Intent intent = new Intent(Intent.ActionView);
intent.SetDataAndType(uri, application);
intent.SetFlags(ActivityFlags.ClearWhenTaskReset | ActivityFlags.NewTask);
intent.SetFlags(ActivityFlags.NoHistory);
intent.AddFlags(ActivityFlags.ClearTask);
try
{
this.StartActivity(intent);
Finish();
}
catch (Exception)
{
Toast.MakeText(this, "No hay aplicaciones instaladas para abrir PDF's", ToastLength.Short).Show();
}
}