Skip to content

Instantly share code, notes, and snippets.

@nekszer
Created May 17, 2020 03:16
Show Gist options
  • Save nekszer/7c662b6de33e93e5a75c0b7a516a30ed to your computer and use it in GitHub Desktop.
Save nekszer/7c662b6de33e93e5a75c0b7a516a30ed to your computer and use it in GitHub Desktop.
Método para guardar el pdf
private async void Save_Command(object obj)
{
var pdf = PDFManager.GeneratePDFFromView(Page.Content); // aqui le paso la vista que quiero que vuelva pdf
var basepath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
var pdfpath = Path.Combine(basepath, $"/mypdf.pdf");
pdf.Save(pdfpath);
try
{
await Share.RequestAsync(new ShareFileRequest(new ShareFile(pdfpath)));
}
catch
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment