In the fragment's OnResume method I open the file from internal storage with PDFFileStream.
the variables for is_open, size, result_open, all indicate that the file was successfully loaded.
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
pdfLayoutView = new PDFLayoutView(Context);
return pdfLayoutView;
}
public override void OnResume()
{
base.OnResume();
var path = "/data/user/0/com.myproject.android/files/1/Documents/TestDoc.pdf"
showDocument(path);
}
public void showDocument(string path)
{
Global.Init(Context);
PDFFileStream fileStream = new PDFFileStream();
bool is_open = fileStream.Open(path);
int size = fileStream.Get_size();
Document pdfDoc = new Document();
int result_open = pdfDoc.OpenStream(fileStream, "");
bool result_cache = pdfDoc.SetCache(Global.TmpPath + "/temp.dat");
pdfLayoutView.PDFOpen(pdfDoc, this);
}