![[identity profile]](https://www.dreamwidth.org/img/silk/identity/openid.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
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.
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.
no subject
Date: 2010-05-08 11:19 pm (UTC)no subject
Date: 2010-05-10 01:55 am (UTC)no subject
Date: 2010-05-10 02:16 am (UTC)no subject
Date: 2010-10-17 11:14 pm (UTC)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
no subject
Date: 2010-10-18 01:29 am (UTC)If you remember, please point me to your post! I'd like to see what you do with this. :)
no subject
Date: 2010-11-19 12:36 am (UTC)r
no subject
Date: 2010-11-11 03:06 am (UTC)HELP!
Date: 2011-01-24 10:05 pm (UTC)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)Хороший блог!
Date: 2011-07-09 08:25 am (UTC)