- Home /
Open a pdf file from the Resources folder on iOS
After successfully asking for help, on Android I am able to open a pdf file. Note the pdf file must have a .bytes extension.
string fileName = "fileName";
TextAsset pdfTemp = Resources.Load (fileName, typeof(TextAsset)) as TextAsset;
System.IO.File.WriteAllBytes(Application.persistentDataPath + "/" + fileName+ ".pdf", pdfTemp.bytes);
Application.OpenURL(Application.persistentDataPath + "/" + fileName + ".pdf");
However, this does not work on iOS. Anyone know how this could be done?
Comment
Answer by Djungalio · Feb 05, 2016 at 04:43 PM
Hello,
try reading http://docs.unity3d.com/ScriptReference/Application-dataPath.html. It may fix your problem.