Read Offline

Read Offline example
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)
    • Author (PDF, ePub and mobi)
    • Subject (mobi)
    • Publisher (ePub)
    • Identifier (uPub)
    • Source URL (ePub)
    • Language (ePub)
  • 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

Use

There are 3 ways you can add the Read Offline link

  1. At the top or bottom of each post and/or page (See Settings->Read Offline)
  2. Using the Read Offline widget
  3. 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

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

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

0.1.3

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

98 thoughts on “Read Offline

  1. 4tegs

    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.

    Reply
      1. PerS Post author

        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.

        Reply
  2. Hugues

    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…)

    Reply
    1. PerS Post author

      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.

      Reply
  3. erikvlie

    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/

    Reply
  4. Steff

    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

    Reply
  5. Tim Kaye

    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

    Reply
    1. Tim Kaye

      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

      Reply
  6. Richard

    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

    Reply
    1. PerS Post author

      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.

      Reply
      1. Peter for a Couples Odyssey

        hey there!!!

        for a while now we’ve been using this plugin, and boy is it great or what :) since our website is for travelers with limited internet access this plugin really helps us out.

        fiddling around with the settings we noticed you are planning on the docx option. and than we noticed you posted that about a year ago… Hoping you still are aiming at this, because this would help us even more.

        Cheers and keep up this good stuff!

        Peter for ACouplesOdyssey

        Reply
  7. Richard

    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

    Reply
  8. Richard

    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

    Reply
      1. Tim Kaye

        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

        Reply
  9. Elf Zig

    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!

    Reply
  10. Kathy

    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

    Reply
  11. Georg

    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

    Reply
  12. Sue

    Congratulations on an excellent plugin!

    My only request/suggestion would be to either insert the name of the site as “author” or use the name of the poster.

    I’ll definitely be supporting this wonderful WP addition. Bravo!

    Reply
  13. Helene

    Hi Per,

    Nice plugin, thanks. Would it be possible to have it on forums also? When as widget in the sidebar, it only captures the last post, not the whole page.

    Thanks
    Helene

    Reply
  14. Vince

    Using Advance Custom Fields for a lot of information on my page, when I use this plugin it only pulls information from the Description field. How do I change it so is uses custom fields too?

    Reply
  15. Vince

    it appears that there’s no support for page-break-inside as it seems to be ignoring the division and breaking.

    Reply
  16. Richard

    Hi Per – Hope all is well. Just wondering whether you’re still planning on updating the plugin?
    Cheers
    Richard

    Reply
  17. Kim

    We have created a WordPress site that embeds interactive charts into the posts using the Visualizer plug (http://wordpress.org/plugins/visualizer/). The plugin uses Google Visualization API to render charts, however, when you save to PDF using your tool, these charts do not show up in the PDF. Is there any way to include these charts in the PDF? We publish research reports and we wanted to automate the PDF output function rather than having to create PDFs of the reports manually. Can you advise?

    Reply
  18. Wrought

    Read Offline conflicts with AcademicPress plugin:

    Error: Unable to send file testing-this.epub.epub. Output buffer contains the following text (typically warnings or errors):
    Notice: Trying to get property of non-object in wp-content/plugins/academicpress/Acp/Bib/Shortcode.php on line 22 Notice: Trying to get property of non-object in /wp-content/plugins/academicpress/Acp/Bib/Shortcode.php on line 35

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">