iOS vfr reader framework cannot use downloaded pdf

允我心安 提交于 2019-12-01 14:20:22

Sorry to answer this so late. I just came across this problem myself so thought I'd pass along my wisdom.

My guess is you are downloading the PDF to the temporary directory. This framework is looking for the file in the NSDocumentDirectory. So when you go to save the downloaded file just save to a path like this:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *baseDocumentPath = [paths objectAtIndex:0];
NSString *filePath = [baseDocumentPath stringByAppendingPathComponent:@"/temp.pdf"];

Once you do that it will load correctly.

p.s If I end up modifying ReaderDocument to allow for a temporary directory I'll post the edits here.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!