Hi,
I need to open pdf files with ios for an industrial application. Currently I build pdf file from **StreamingAssets** folder which is then reading as **bytes** and writen in the documents folder of the app with **FileStream** library.
Pdf file looks ok on the Documents folder (I can see it in the Xcode app details panel) but i can't open it with the **Application.OpenURL** function, nothing happen whereas it works fine on my mac !
Here is the code :
private void WriteAndLoadFile()
{
string filePath = Path.Combine(Application.streamingAssetsPath, "file.pdf");
fileBytes = File.ReadAllBytes(filePath);
cachedFile = Path.Combine(Application.persistentDataPath, "file.pdf");
Debug.Log(cachedFile);
FileStream cache = new System.IO.FileStream(cachedFile, System.IO.FileMode.Create);
cache.Write(fileBytes, 0, fileBytes.Length);
cache.Close();
Application.OpenURL(cachedFile);
}
What i am doing wrong ??
Thanks !
↧