0
A
回答
2
用於儲蓄,下面的代碼文件目錄使用PDF。
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *localFilePath = [documentsDirectory stringByAppendingPathComponent:@"data.pdf"];
NSData *thedata = [NSData dataWithContentsOfURL:[NSURL URLWithString:`ADD URL OF PDF DATA`]];
[thedata writeToFile:localFilePath atomically:YES];
檢索pdf使用下面的代碼。
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *localFilePath = [documentsDirectory stringByAppendingPathComponent:@"data.pdf"];
if ([[NSFileManager defaultManager] fileExistsAtPath:localFilePath]) {
NSData *data = [NSData dataWithContentsOfFile:localFilePath];
}
相關問題
- 1. 如何將圖表從Excel保存爲圖像/ PDF?
- 2. 從座標保存地圖圖像
- 3. 如何將圖像保存爲圖像/ pdf?
- 4. 如何保存附加到圖像視圖的圖像?
- 5. 保存視圖及其內容爲圖像或pdf
- 6. 如何將圖像從Amazon S3下載並保存到圖像視圖
- 7. 保存圖像在本地計算機
- 8. 如何從視頻/快速視頻中保存圖像?
- 9. 如何將Extjs4圖表圖像保存爲PDF報告?
- 10. 將當前bing地圖視圖保存爲圖像
- 11. 如何在本地保存highchart圖形?
- 12. 如何將圖像保存爲圖像
- 13. 地圖地圖 - 如何將內部地圖保存爲地圖?
- 14. 如何從matplotlib保存pcolormesh圖像
- 15. 如何從Three.js畫布保存圖像?
- 16. 從MATLAB中保存圖像的圖像
- 17. 從UIImagePickerController保存圖像抓取圖像?
- 18. 從圖像路徑保存圖像
- 19. 將圖像保存爲PDF共享點
- 20. 在db4o中保存圖像或pdf
- 21. Xcode將PDF保存爲圖像?
- 22. 如何保存視圖
- 23. 如何保存圖像添加文本後爲圖像
- 24. MATLAB如何保存圖像?
- 25. 如何保存PHP圖像?
- 26. 如何保存圖像
- 27. 如何在瀏覽器中本地保存拖動的圖像
- 28. 如何在本地文件夾中使用angular2保存圖像
- 29. 如何將本地圖像保存到在線數據庫中
- 30. 如何從視頻中間保存圖像?