Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

How to load pdf file with ios ?

$
0
0
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 !

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>