mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 14:35:45 +00:00
Open pdf
This commit is contained in:
parent
9e3a07efe4
commit
cf9f5357a0
1 changed files with 10 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ using AideDeJeu.Tools;
|
|||
using AideDeJeu.ViewModels.Library;
|
||||
using AideDeJeu.Views;
|
||||
using AideDeJeu.Views.Library;
|
||||
using AideDeJeu.Views.PlayerCharacter;
|
||||
using AideDeJeuLib;
|
||||
using Rg.Plugins.Popup.Services;
|
||||
using System;
|
||||
|
|
@ -362,11 +363,19 @@ namespace AideDeJeu.ViewModels
|
|||
|
||||
public async Task ExecuteGeneratePDFCommandAsync(string markdown)
|
||||
{
|
||||
using (var stream = new FileStream(Path.Combine(Xamarin.Essentials.FileSystem.CacheDirectory, "test.pdf"), FileMode.Create))
|
||||
using (var stream = new FileStream(Path.Combine(Xamarin.Essentials.FileSystem.CacheDirectory, Path.Combine("pdf", "test.pdf")), FileMode.Create))
|
||||
{
|
||||
|
||||
PdfService.Instance.MarkdownToPdf(new List<string>() { markdown }, stream);
|
||||
}
|
||||
|
||||
var page = new PdfViewPage();
|
||||
page.PdfFile = new Tools.NotifyTaskCompletion<string>(Task.Run(() =>
|
||||
{ return "test.pdf"; }
|
||||
));
|
||||
page.BindingContext = page;
|
||||
await Navigation.PushAsync(page, true);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue