Hola lo que pasa es que sigo la documentacion de syncfusion y no tenia probleas hasta ahora al tratar de hacer un archivo pdf con su documentacion me sale el erros de stream que el read y write estan null y no puedo avanzar no se por que no se puede si copi los archivos correctamente de la documentacion de pdf xamarin
//Load the file as stream
Stream docStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("Sample.Assets.Sample.pdf");
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);
//Create booklet with two sides
PdfDocument document = PdfBookletCreator.CreateBooklet(loadedDocument, new SizeF(1000, 700), true);
MemoryStream memoryStream = new MemoryStream();
//Save the document into memory stream
document.Save(memoryStream);
//close the documents
document.Close(true);
loadedDocument.Close(true);
//Save the stream into pdf file
Xamarin.Forms.DependencyService.Get().Save("sample.pdf", "application/pdf", memoryStream);
public interface ISave
{
Task Save(string filename, string contentType, MemoryStream stream);
}
class SaveWindowsPhone: ISave
{
public async Task Save(string filename, string contentType, MemoryStream stream)
{
StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile outFile = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
using (Stream outStream = await outFile.OpenStreamForWriteAsync())
{
outStream.Write(stream.ToArray(), 0, (int)stream.Length);
}
await Windows.System.Launcher.LaunchFileAsync(outFile);
}
}