开发者

Is there a way to programmatically download a web page, for offline viewing, using WebKit?

开发者 https://www.devze.com 2022-12-14 02:42 出处:网络
What I\'d like to be able to do is download any web page, and be able to view it offline. It seems like html WebKit views cannot be converted to PDFs (on the Mac, you could \'print\' a PDF, but that

What I'd like to be able to do is download any web page, and be able to view it offline.

It seems like html WebKit views cannot be converted to PDFs (on the Mac, you could 'print' a PDF, but that isn't possible on iPhone?).

So, the only way is to save the actual resources - save the html, the step thru each image, css, js file and save it locally. Then maybe alter the urls within the code so they point to the right place...etc ...etc...

Is there a standa开发者_开发百科rd way to do this?

Or, is there an open source project (in any programming lang) which does this kind of thing?


There's an excellent webkit html to pdf converter appropriately called wkhtmltopdf. Given the reources available on the iphone and its toolkits, I think it'd be easy to compile a version for the i-Phone ('think' being the operative word). We've managed to use the tool in a Windows, Linux and Solaris environment with absolutely no bugs. Here's the link:

http://code.google.com/p/wkhtmltopdf/

0

精彩评论

暂无评论...
验证码 换一张
取 消