[identity profile] kannnichtfranz.livejournal.com posting in [community profile] fanfic_ebooks
Hi! I've written a PDF Service to go from the Print menu on the Mac to an ePub file. I'm not sure if this will be helpful to anyone, but I thought I'd share in case it is, or in case anyone can help me make it better.

I think it will only be useful to people who use Calibre and want to read fanfic from webpages in Stanza on an iPhone or iPod Touch. Note that this isn't going to be a professional-looking eBook, but I think it is much easier to read this way than on mobile Safari.

Download 'Save as ePub.dmg'


"Save as ePub" is a PDF Service script for the Mac. It converts a Readability-enhanced webpage to an ePub file on the desktop. It works via the "Print" menu's PDF dropdown menu. The ePub file can be input to Calibre and Stanza.

To install:
1. Drag the "Save as ePub" file onto the "PDF Services alias" folder.
2. Install calibre. You probably already have this. If not, you can use the link included in this package. Be sure to install in the default location, in the /Applications directory. A relatively recent version is advised – versions from before 1/2010 are unlikely to work.
3. Install pdftotext. It is a shell program for converting PDF documents into plain text. It is Open Source Software. There is an installer package towards the bottom of the pdftotext link included in this package. If you have already installed pdftotext from another source, you may need to modify the PDF Service slightly.
4. Install the Readability bookmarklet into your browser of choice. You can use the link included in this package.

To use:
1. Find a web page you want to read as an eBook.
2. Click the Readability bookmarklet.
3. Choose "File" -> "Print".
4. Under the "PDF" dropdown menu, choose "Save as ePub".
5. It will write ~/Desktop/TitleOfStory.ePub. This may take several seconds; you should see the calibre icon bounce in the dock. Locate the ePub file on your desktop.
6. Add that to Calibre and touch up the metadata, add tags as desired.
7. Sync to Stanza on the iPhone or iPod Touch.

Known Issues
1. The use of PDF simplifies the procedure, but transformations from PDF can be unreliable. The main thing that is often messed up is paragraph breaks. Some paragraphs may be mushed together, and some paragraph breaks may be inserted erroneously.

Someone handier with regular expressions might be able to change "Save as ePub" to mend the ePub file, but it would be tricky. The ideal solution would be to save the HTML that is the result of the Readability bookmarklet to a file in a particular folder, and then use a Folder Action to convert it to ePub. However, saving the Readability-formatted webpage doesn't result in clean and simple HTML.

2. Fanfic pages that don't have nice headers including "Title: xxx", "Author: xxx", and "Summary: xxx" won't capture that information.

3. It's possible that some special characters in those lines on the webpage could break the script. Hopefully the worst that should happen is that you won't get the ePub file.

4. I wish I could get it to put a live link back to the webpage at the end, so people could easily find their way back to leave comments.

Date: 2010-05-08 11:19 pm (UTC)
amalthia: (Default)
From: [personal profile] amalthia
Thank you so much for sharing this! I added a tutorial tag so others can find it in the future. :)

Date: 2010-05-10 02:16 am (UTC)
amalthia: (Default)
From: [personal profile] amalthia
Until the Kindle accepts epub formatted fiction I think I'm going to be stuck using Calibre myself because for the archive I have to generate 3 different file types. But yes, this looked very useful for those who don't have that limitation! :)

Date: 2010-10-17 11:14 pm (UTC)
jeshyr: Standrd glyphs representing disability, blindness, interpreters and information. (Disability)
From: [personal profile] jeshyr
This is unbelievably brilliant! Thank you so very VERY much!

Are you OK with me adapting this to be used as a general "save as epub" service, which would be only a little different to the fanfic variety but wouldn't try to capture the title/author/summary information in that format for example? I'd definitely put a link back to here in the source code and the documentation saying it was heavily based on your code.

Why? I have a blog http://atmac.org/ for Apple users (Mac, iPad, iPhone - anything Apple) with disabilities. One big annoyance many blind Apple users have at the moment is getting books from Bookshare (in an XML format that displays fine in Safari) onto their iPads - this would reduce the process from a billion fiddly steps to "open in safari, print to epub" which would be a great improvement!

Please let me know :)

Cheers,
Ricky

Date: 2010-11-19 12:36 am (UTC)
jeshyr: Blessed are the broken. Harry Potter. (Default)
From: [personal profile] jeshyr
One thing I discovered while fiddling: Instead of installing MacPorts to get pdftotext there's a native installer available for OS X at http://www.bluem.net/en/mac/others/. That should make it easier to install, at least!

r

Date: 2010-11-11 03:06 am (UTC)
From: [identity profile] taxiforhire.livejournal.com
This is pretty much the greatest thing I've ever seen. Thank you so much for sharing!

HELP!

Date: 2011-01-24 10:05 pm (UTC)
From: [identity profile] hamrensel.livejournal.com
I'm trying to use your system here. But I'm having problems.

First the PDF Services alias file didn't work. I found the folder on my computer Mactonish HD>Library>PDF Servies and drop the 'Save as ePub' file in the folder.

Next I went to the website you provided and downloaded the pdftotext 3.01pl2. I installed the package called pdftotext.pkg.

I put the Readability link on my bookmark bar next.

Now when I try to use it I run into problems. I find the page, click the readability and hit print. I select 'Save as ePub' in the drop down but the file never shows up on my desktop.

Can you help me?

Спасибо за информацию

Date: 2011-06-08 12:54 am (UTC)
From: [identity profile] loraleexyp.livejournal.com
Супер! Все бы так писали :)Image (http://site-sex-znakomstva.ru/)

Хороший блог!

Date: 2011-07-09 08:25 am (UTC)
From: [identity profile] jezeqi.livejournal.com
Большое спасибо! Взяла себе тоже-пригодится.Image (http://7wp.ru/)

Profile

fanfic_ebooks: (Default)
Fanfiction Ebooks

July 2017

S M T W T F S
      1
2345678
9 101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 8th, 2025 07:52 am
Powered by Dreamwidth Studios