简体   繁体   English

通过代码将PDF添加到iBooks

[英]Adding PDF to iBooks by code

I was recently asked if I could code a simple IPhone/IPad app that: 我最近被问到是否可以编写一个简单的IPhone / IPad应用程序:

  1. Checks an FTP server for changes to a PDF file (easy) 检查FTP服务器是否有对PDF文件的更改(简单)
  2. Downloads the lastest PDF (easy) 下载最新的PDF(简单)
  3. Adds or replace the file on iBooks (hmm...) 在iBooks上添加或替换文件(嗯......)

I have tried to find any code that deals with inserting/adding/updating files inside iBooks, but sadly there is very little on the subject. 我试图找到任何涉及在iBooks中插入/添加/更新文件的代码,但遗憾的是这个主题很少。 Is this even possible except manually through iTunes? 这是否可以通过iTunes手动除外? My gut feeling says that it's just a matter of writing the file to a folder.. 我的直觉是,这只是将文件写入文件夹的问题。

It makes sense if it were such an API. 如果它是这样的API就有意义了。 There are many companies that would like to keep their product portfolios up to date, or research manuals that (in theory at least) could benefit greatly from being updated automatically through an app. 有许多公司希望保持其产品组合的最新状态,或者(理论上至少)通过应用程序自动更新的研究手册可以从中受益匪浅。

Any help or comments are welcome. 欢迎任何帮助或评论。

My gut feeling says that it's just a matter of writing the file to a folder.. 我的直觉是,这只是将文件写入文件夹的问题。

Unfortunately, this probably isn't the case. 不幸的是,情况可能并非如此。 I'd imagine iBooks using some sort of database to keep track of books, rather than simple files. 我想iBooks使用某种数据库来跟踪书籍,而不是简单的文件。

There is a URL schema for iBooks, but it's undocumented, and nobody has found any methods that would update/replace a book (I don't know if any even exist): How do I launch iBooks e-reader programmatically on iPad? iBooks有一个URL模式,但它没有文档,没有人发现任何更新/替换书籍的方法(我不知道是否存在): 如何在iPad上以编程方式启动iBooks电子阅读器?

If you feel this is something that would be beneficial to iBooks, you should consider filing a feature request on the Apple dev site. 如果您认为这对iBooks有益,您应该考虑在Apple开发站点上提交功能请求。

在这种情况下, UIDocumentInteractionController是你的朋友

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM