iOS vfr reader framework cannot use downloaded pdf

前端 未结 1 1819
小鲜肉
小鲜肉 2021-01-17 06:21

I found the vfr reader framework while looking into some better alternatives for displaying pdf in an app. In my context, I need to download a pdf; it\'s not included in the

相关标签:
1条回答
  • 2021-01-17 07:06

    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.

    0 讨论(0)
提交回复
热议问题