How to sync content between Wordpress and PDF
February 5, 2015 1:47 PM   Subscribe

I have an online textbook that's currently in Wordpress, and I want to make a PDF version of it so that users can download it all at once. What's the best way to do this in terms of time, efficiency, and minimizing the hassle of syncing changes/corrections/additional content in the future?


It's about 25k words spread across 8 sections and about 50 short sub-sections, currently set up on a very common wordpress template (as all pages, no posts). It's all text, no images, but with lots of block quotes and tables.

Everything is free, both the site and the PDF, so no need for copy protection or payment implementation or anything.

I've started by copying everything directly from a browser into MS Word, it runs about 90 pages and the html formatting is somewhat preserved but it'll take a lot of work to make it look right. That's where I stopped and said "hmm maybe Metafilter can suggest a better way to do this."

Something like QuarkXPress would be overkill here, I'm not trying to produce a professional looking book at all, just an 8x11 PDF with a hyperlinked table of contents that looks ok when printed.

I've tried WP "print button" type plugins that auto-generate PDFs but those are underkill (if that's a word) and the results look like crap. So I guess what I'm looking for are other tools in between.

Thanks in advance for your suggestions!
posted by neat graffitist to Technology (6 answers total) 3 users marked this as a favorite
 
Maybe try pandoc?
posted by Going To Maine at 1:49 PM on February 5, 2015 [1 favorite]


Yeah, I'd try making a single webpage (I assume you know basic HTML) with all your content in it. Once you have that I'm pretty sure Pandoc will be able to make a PDF out of the whole thing. Or at that point you can just print the webpage to a PDF, although Pandoc will probably have nicer output by default.
posted by neckro23 at 2:31 PM on February 5, 2015


It's command-line and a little fiddly, but wkhtmltopdf can build TOCs and documents from multiple pages. Its output is a little crude, but it does put content on PDF pages.
posted by scruss at 3:09 PM on February 5, 2015


For a start, I'd get all the content onto one page in WP. Rather than doing the copy/paste routine, what I would do is install a plugin that lets you include one page in another. So I'd create an all-in-one page that is just references to the existing pages.

I'd also use a table-of-contents plugin to generate the TOC you would need. The load order would need to be controlled to occur after the page-including plugin, so that's a third plugin.

Then there's this tutorial on making your WP content print-friendly (which mentions yet another plugin).

Once I had all that working, I would go to the all-in-one page and just print to PDF. The nice thing about this is that any time you update any of the individual pages, you can regenerate the print version just by printing to PDF again, no extra work.
posted by adamrice at 3:19 PM on February 5, 2015


Per your experience, there are plugins available that attempt this function. Mostly, they execute with poor production outcomes. A while back, I used the open source wordpress plugin Anthologize to achieve the same thing. It satisfied requirements. At a glance, it doesn't look like it it's been developed much further but might be worth your consideration if you haven't tried it.
posted by banterboy at 12:50 AM on February 6, 2015


Some discussion of this at this old question: How do I export my WordPress blog as a book?
posted by artlung at 2:20 PM on February 6, 2015


« Older Alternate Careers for a Licensed Massage Therapist...   |   How would you handle this car repair problem? Newer »
This thread is closed to new comments.