
I’m working on a plugin which allows you to download and read posts and pages offline in pdf, epub and mobi formats, and I need beta testers (please share this page with WordPress friends).
Please use the comments field below if you find bugs, typos etc.
Features
- Settings page (Settings->Read Offline)
- Read Offline widget (output shown in the image above)
- Read Offline shortcode
- You can download a pdf, epub or mobi file containing the current post or page (you have to add the Read Offline widget to see the download links)
- The download filename is based on the posts slug (
$post->post_name) - Adds meta data to the file
- Title (PDF, ePub and mobi)
1$post->post_title
- Author (PDF, ePub and mobi)
1get_the_author_meta('display_name',$post->post_author)
- Subject (mobi)
1implode(' ,',array_map("get_cat_name", wp_get_post_categories($post->ID)))
- Publisher (ePub)
1setPublisher(get_bloginfo( 'name' ), get_bloginfo( 'url' ))
- Identifier (uPub)
1$post->guid
- Source URL (ePub)
1$post->guid
- Language (ePub)
1$iso6391 = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
- Title (PDF, ePub and mobi)
- Option: Add download links to the top and bottom of a post or page.
- Permalink support (/read-offline/”postid”/”post-name”.”type”). I’ve written a how-to add permalink to plugins guide.
- Option: Add a custom style to the ePub and PDF file
- Option: Google Analytics read-offline event tracking. You can find these under Content » Events in your Google Analytics reports. Assumes you’re using the Asynchronous version of Google Analytics.
- languages/read-offline.po for easy translation.
To-do / Wish List
- Bookmark posts
- Export post / page as Word (.docx)
- Add unique headers/footers
- more ? Please post a comment if you have any suggestions
Use
There are 3 ways you can add the Read Offline link
- At the top or bottom of each post and/or page (See Settings->Read Offline)
- Using the Read Offline widget
- Using the
[readoffline]shortcode
The [readoffline] shortcode has the following parameters
- format=”epub”, default: format=”pdf,epub,mobi”
- text=”Read %title offline:”, default: text=”".
%title%will be replaced with the post or page title - icononly=”true”, default=”false”
Examples
[readoffline]is the same as[readoffline text="" format="pdf,epub,mobi" icononly="false"][readoffline text="Download %title%:" format="epub"]
Credits:
The plugin is using the following libraries
- Epub , License: GNU LGPL, Attribution required for commercial implementations, requested for everything else.
- Zip, License: GNU LGPL, Attribution required for commercial implementations, requested for everything else.
- phpMobi, License: Apache license (version 2.0)
- mpdf, License: GNU General Public License version 2
The plugin is using the following icons
- PDF icon from the Fugue Icons set by Yusuke Kamiyamane, released under a Creative Commons attribution license
- ePub and mobi icons by Doug Smith, also released under a Creative Commons attribution license
Changelog
0.1.9
- Fixed a bug in permalinks that gave 404 for blogs in a subdirectory. Also removed code that gave error when downloading an ePub.
0.1.8
- Added Google Analytics read-offline event tracking. You can find these under Content » Events in your Google Analytics reports. Assumes you’re using the Asynchronous version of Google Analytics
0.1.7
- Minor bug fix
0.1.6
- Added the option to add custom css to PDF
0.1.5
- In Settings->Read Offline, added the option to add custom css to EPub
- Added languages/read-offline.po for easy translation.
0.1.4
- Added permalink support (/read-offline/”postid”/”post-name”.”type”). I’ve written a how-to add permalink to plugins guide
- removed the obsolete download.php
0.1.3
- epub will now validate against http://www.epubconversion.com/ePub-validator-iBook.jsp
- Added language variable to the epub file, ISO 639-1 two letter tag based on the WordPress get_locale()
0.1.2
- Fix typo in download.php, was including ”Epub.inc.php”, correct is “EPub.inc.php”
0.1.1
- Bugfix, v0.1.0 will give you “gray screen of death”, so please upgrade to this version
0.1.0
- Added the Read Offline shortcode
- Added, in Settings->Read Offline, option to add Read Offline to top and/or bottom of post and page
0.0.2
- Filename based on the posts slug
- Added meta data
0.0.1
- Initial release
Hi there
Great plugin!
I think it’d be awesome if you could add an option that would enable people to:
(1) bookmark a collection of posts they’d like to read offline; and then
(2) enable them to export all those posts in a single file, in the order they were bookmarked.
Do you think that’d be possible?
Kind regards
Richard
Great idea Richard, hardest part is to create a user interface that’s easy to use/understand. Any suggestions?
You could just have a look at the Anthologize plugin for WordPress, because it does something very similar : create a “table of contents” of posts, and export them to a single PDF or ePub document (among other formats). See http://wordpress.org/extend/plugins/anthologize/
(actually, your plugin and the Anthologize plugin seem to go in the same direction; any chance of a merger ? ;-)
The main difference between Anthologize and Read Offline, is that Read Offline is user/visitor centric. Anthologize is for the blog owner. Agree, we could merge but again that’s a large tast.
How about this:
(1) the user can bookmark each post of interest via a link at the bottom of the post or in the post meta
(2) bookmarked items are then all listed on a “my bookmarks” page or widget
(3) on that page or widget, there’s an export option
(4) the user can select a checkbox for each post the user wants to export
(5) when the user clicks an “export” button (for the preferred file format), the export function then collects the checked posts and exports them all into a single file
Would be awesome if the admin could select how much info is included in the export, e.g., title, body, meta, comments – all off or on
Would also be awesome if the export feature could support a document format like Word or Google Docs.
Thanks for considering this. Great plugin.
Richard
Thank you Richard, I’ll look into it next week. Rest of this week will be spent at Gleneagles
Hi PerS. Thanks for developing the plugin. There is a typo in download.php on line 24. “Epub.inc.php” is installed as “EPub.inc.php”.
A few quick notes after testing version 0.1.1:
1. In download.php, requiring ‘library/epub/Epub.inc.php’ (line 24) fails in case-sensitive hosts because the actual file is named EPub.inc.php
2. The produced epub does not pass validation, basically due to the Body.html being raw html without proper wrapping with something like that:
…
3. Tested with non-latin content, the produced epub is not readable (I guess it is related to 2 above but had not the time to test it)
Keep up and regards,
Greg
Greg, fixed #2 above, please test #3
Αργύρης and GPap, thank you for your feedback. I’ve fixed the problem with EPub.inc.php, please see the latest release.
GPap, I will look into the other findings as soon as possible (early next week). Again, thank you.
Hi! How can the plugin to do URL FRIENDLY?
It’s on my to-do list, thanks for reminding me
Support for permalinks is added to v0.1.4
Hey there. Do you have any plans to add some customization features like the ability to add unique headers/footers?
There’s a few particular things I’d like to do
Since my articles are all CC licensed, I’d also like add a footnote to end of each pdf to include the article source, publish date and author name.
I’d also love to be able to style PDFs!
I know this is all probably a lot of work, but I thought I’d mention it anyway.
Great work on the plugin so far. It’s nice and clean!
Added to the “Wish List”. Some should be easy, others a bit more complex.
Thank you for your feedback.
Styling PDF is in the latest version.
Nice plugin, is there an example of it being used anywhere? I would like to check out a page using it without installing it if possible?
Sure, added the plugin to this site :)
Note, I haven’t styled the output (yet)
Congratulations.
If W3 Total Cache enabled this plugin gives problems. When updating any plugin always shows “Download failed.: Could not resolve host ‘downloads.wordpress.org’”. Thanks.
Hmm, strange. I’m also running W3 Total Cache, and I’m not having any problems. In W3 Total Cache I’ve enabled: Page Cache, Minyfy (except javascript), Database Cache, Object Cache and Browser Cache.
My config: Page Cache on, Minify (JS minifier = JSMin), Database cache off, Object Cache off y Brower Cache on.
If I disable read-offline, then there is no problem to update plugins.
Please test this.
Replace:
With:
I just made the change. When I need to update a plugin I confirm to you if it works.
excellent, thank you :)
Your plugin does exactly what we’re currently looking for : a user-friendly editorial process to create documents online and export them in ePub and PDF format. So thanks a lot, and I hope your plugin comes out of beta soon ;-)
I have a suggestion for ePub export : for a large post/page, a table of contents would be very useful. It could for instance be created from tags in the post (or some other tag specified by the user in the plugin settings). Would that be possible ?
Bug : if the blog is not at the root of the web server, and doesn’t use permalinks, then the links to download posts are not correct, because they start at the root. Removing the leading slash before index.php in function ps_read_offline_url works on our installation, (I don’t know if that solution would work in all configurations).
Me again : the fix above only works in function ps_read_offline_url from class ps_read_offline, but not in same function from class ps_read_offline_widget (different check for url rewriting).
And a new bug in ePub export in version 0.1.8.1, also related to blog location : image wp-content/themes/twentyten/images/headers/path.jpg is not found if blog is not at root of web server.
Good morning Jacques. Thank you for your feedback. I’ll fix the url related bugs after work today.
I like your idea on splitting large posts + toc (most likely splitting on h2-h5 (selectable in the settings page), I’ll add it to the “wish” list. At the moment I’m working on a new settings page for the plugin, need it for other features.
In version 0.1.9 I still can not update plugins, W3 Total Cache gives problems with cache and dns to Akismet. If I disable read-offline, then there is no problem.
Maybe the problem is in the htaccess rewrite rules?
To check if it’s the permalink that’s the problem, please disable (if you haven’t already) Read Offline, and install http://wordpress.org/extend/plugins/my-permalink-demo/ to see if it gives the same problems
Thanks
Hello Pers!
Was looking for something like this. A feature request for Buddypress extension. I use an LMS plugin(Scholarpress Courseware). Wish there was a way to save lectures and export them into mobiles to read offline.
Extension for custom post types.
I want different background of ech pdf .that is when pdf of a post is created then its background should be a thumbnail image of that post.
How can i do this ????
Your site is down so I’m posting here. Your plugin causes rewrite rules flush every time you navigate through admin, I think that the problem is here:
Thank you Paul, I’ll add it to the next release.
eh, what do you mean by my site is down? This is my site.
Sorry I’ve copied my comment from http://wordpress.org/support/topic/plugin-read-offline-support-feedback :) and haven’t read before pasteing, sorry.
Strange problem. After upgrading to WordPress 3.5 and Theme Twenty Eleven 1.5. “Read Offline” doesn’t show anylonger on the default Hompage. Neither on the top, nor on the bottom of the post, nor as a widget.
If I select a post or a page it works well.
Sorry forgot: You can have a look here: http://www.motorradtouren.de
Must have been something odd in the old theme you had. By design, it should only appear on a single post / page. That is, it is working as it should now.
I have problems when generating mobi and epub files accent. How to fix this problem of language / language?
Not sure if you mean filename or content. Please explain.
Awesome plugin, thanks for this! It makes super clear PDF & ePub. I have a suggestion : can you make a PDF clickable table of content please ? (I don’t know if it’s even possible…)
Tanks for reminding me, I’ll add it if the library I’m using supports it. I working on the next release, hopefully available next week.
Hi, and thank you for the plugin.
Next version I should like to see a custom formatted function for download link output. Also you may clean the library folder to unused fonts, scripts and so on.
By the way, here is my job to you – a Russian i18n file to your plugin:
http://levati.name/i18n/read-offline/languages/read-offline-ru_RU.mo
In that URI I should update the translation for latest version of read-offline.
Hi Per,
I tried entering this message on your website, but upon clicking the Add Comment button, there was a database connection error showing.
I love your plug-in. I have one question though, and it might be my permission settings that aren’t right. The icons appear when they feel like it :-). Usually, I have to load a page a couple of times before they become visible.
I first tried different browsers, but that doesn’t help, so it’s server-based. Then I tried changing permissions (777 on the plug-in dir, 777 on the dirs inside…) on the directories, but that doesn’t do much good either.
It’s not a big deal of course, but it would be nice of they did appear. I’m running CentOS 6.3 x86_64, PHP 5.4.8, MySQL 5.1.66-cll and Apache 2.2.23. No caches on my Wp installation.
http://wordpress.org/extend/plugins/read-offline/
Hi Per, Great Plugin, works perfectly for me only one thing I cannot get right.
I use a plugin called formidable to create list questionaires. In a custom display I can filter these questionaires in a certain way. On my site they appear right, The one I filtered. But when I try to make a offline PDF, read-offline picks the first questionaire not the filtered one. Any idea’s what the problem can be?
Furthermore I am really pleased with it because it’s the first plugin that lets me create good looking pdf’s of tables etc.
Thanks
Kind regards Steff
Per, this is a really terrific plugin for creating ePubs: they pass with flying colours in Sigil. But I do have two questions.
1. Do you plan to add the facility to generate a Table of Contents in the ePubs and mobis? Otherwise I’ll have to use RO on my XAMPP site to generate the ePubs and then add the TOC manually in Sigil before uploading to the live website for downloading. Obviously, I’d much prefer to automate the process!
2. I cannot generate valid mobi files at all. I keep getting an “end tag” error. This surprises me because the ePubs are flawless. As things stand, I will have to take the ePub from the above process and run it through Kindle Previewer to generate the mobi for uploading.
Thanks very much!
Tim
Per,
I have been delving a little deeper into this. I have now found that Read Offline does automatically generate a Table of Contents in ePubs, so long as I use an appropriate plug-in to put the ToC in the post. I have achieved excellent results using Table of Contents Plus. This allows me to put the ToC where I want it in the post, and then Read Offline reproduces it flawlessly in the ePub. Both ToCs even hyperlink to the appropriate points in the main body of text. Even better, I can style the ToC on both the web page and the ePub using CSS. It works perfectly, so there’s absolutely nothing to fix here — thanks!
Unfortunately, PDFs produced by Read Offline don’t seem to respond to CSS styling. The result is that (a) although PDFs also reproduce the ToC from that inserted by Table of Contents Plus, they include text that I don’t want included here, and (b) as Hugues pointed out above, the ToC in the PDF is not hyperlinked to the text.
Finally, none of this helps produce workable mobis. At present, I get the following error when I try to generate them:
I don’t know what this means, but I am sure you do. If I take the ePub generated by Read Offline and convert it manually in Calibre (version 0.9.16), it works perfectly, so I’m sure this can be resolved.
Many thanks and best wishes,
Tim
Tim, thank you for your feedback. I really appreciate it.
Here’s a teaser. I’m working with PDF at the moment, ePub and mobi next.
Hi there Per
Thanks again for this great plugin.
I was wondering whether you’re still planning on implementing an export to Word option please? If so, I’d be happy to pitch in with some support to speed up development.
On a separate note, is it possible to add CSS for posts that will change the font and styles and add padding/spacing below paragraphs? I’ve not been able to get that to work but perhaps I’m doing something wrong.
Thanks again
Richard
Export to .docx is on my to-do list. You will also be able to add styles to control the look ‘n feel (not sure yet if you can modify the docx using styles).
I’ve been rather busy lately, but plan to work on this plugin in the weeks to come.
That’s great news. Thanks Per. Do let me know if I can do anything to help, like beta test for you or contribute in some other way.
Cheers
Richard
P.S. Your Paypal donate link isn’t working? :)
Sorry for yet another comment. Last one for the night… . I’ve just noticed that, if you’re using a password-protected version of a WordPress install, the download links are still accessible to a person not logged in. Do you know whether it’s possible to prevent the download links from being publicly accessible to people who are not logged in and don’t have access to the relevant post?
Thanks
Richard
hmm .. noted, I’ll look into it.
I use s2member to password-protect my WordPress installation. I have found that adding the following code to the end of my functions.php file deals perfectly with this issue:
Best wishes,
Tim
Thank you Tim, I’ll also add hooks to the code to make it easier add code like your or the post_password_required() function.
This plugin is worth its line in gold. Thank you so much for it!
My feature request: let the featured image (formerly known as post thumbnail) of a post become the cover image of the export.
Thank you so much again!
Not sure if this has been added to the wish list. I would like the ability to turn it on and off for different pages/posts. I’ve had to turn it off because there are a few pages that I don’t want it on.
Thanks
Hi there, your plugin is a wonderful idea, but the Pdf download produces a Internal Server Error. The other links work like a charme….
Any thoughts on what the problem might be, or any ideas where to check?
Cheers Georg