I'm using Xamarin.IOS to create an app that generates a pdf file. There are a couple pages that I want to add in to every file that gets generated. To achieve this, I've added the a folder called MyDocs to my project, and put File.pdf inside. I also added a class into MyDocs called FileGet, which has one static method called GetFile that returns a stream to File.pdf.
GetFile is implemented like so:
using System.IO;
...
return new FileStream(Path.Combine("MyDocs", "File.pdf"), FileMode.Open, FileAccess.Read);
and I call the method like so:
using MyApp.MyDocs;
using System.IO;
/*
code to generate the user's pdf document
*/
FileStream stream = FileGet.GetFile();
/*
code to append documents
*/
but get a
System.IO.DirectoryNotFound: Could not find a part of the path "/private/var/containers/Bundle/Application/1B01EF3D-CA49-47F9-9CBB-30EE10AEE6A1/MyApp.app/MyDocs/File.pdf".
What's the proper way to access File.pdf within my MyDocs folder? or is this not the proper way to store a pdf file within the app?