Hello,
I have a Sony PRS-505 which I would like to use to read RFC documents from IETF (
http://www.ietf.org/). The challenge I find is that the RFCs are already formatted with a certain line width. When I try to create an e-book file using calibre, the result is either that all the formatting is lost, or the line width exceeds the width of the PRS screen.
I've tried a few workarounds with various degrees of success, for example: changing the base font, editing the HTML before importing. I've tried to use Sigil before importing the files, and edit the CSS. I've also tried to print the RFCs to a PDF file.
All those workarounds have some problems, and it looks like calibre already has some of the tools necessary to get the file I would like. I am not sure though how to use those tools. If someone more experienced has any ideas, or has already done this, I would appreciate the help.
Basically, with the RFCs, the challenge becomes when for example there are ASCII diagrams in the document. Also, they already have page numbers that of course don't match up with the pages for the Sony Reader.
I have a crude process to get the RFCs in a nicer format on the Reader, but it is time consuming and not very efficient. I am sure that someone with programming experience could get this done in a much more efficient way.
My process is like this:
Step 1. Download the txt version of the RFC. For example:
http://www.rfc-editor.org/rfc/rfc4271.txt
Step 2. Clean up the document:
In notepad++, use "Find and replace" and search for the following regex and replace with blank.
.*\[Page .+\] - this will remove the existing page numbers
^RFC \d+.* - this will remove the recurring page title at each page break
\f - this is to remove the FFLF characters
TextFX Edit: Delete surplus blank lines
Step 4 - To preserve the formatting, I turn the file into HTML:
Add <body> <pre> at the beginning and </pre> </body> at the end of the file
Step 5 - Open the new HTML file in Firefox, and use the Developer toolbar to add CSS:
body { margin: 0; font-weight: 900; font-size: 13;}
This is because the fixed-width fonts appear too light on the Reader.
Step 6 - File > print preview, shrink to fit, portrait, and print to a PDF file with a customized page size.
As you can see, the process is very clumsy. The end result is not bad, it does allow me to read the RFCs and it only takes about 10 minutes to go through all the steps. However, I feel that someone with more experience might be able to improve it much quicker and automate a lot of the steps, for example the Regex search could be done in calibre.
Also, by using this method, there is no TOC generated. The RFC document already has it's own TOC, but that would have to be deleted and re-generated to reflect the new page numbers. If this were possible, with automated links to the appropriate section in the document, it would be fantastic.
On IETFs website, the RFCs can be downloaded also as HTML. Maybe that is a better option that the text file. In fact, the idea to customize the font weight to make it more legible on the Reader came from looking at the source code of their HTML.
Anyway, if someone has any ideas on how to bring RFCs to life on the Sony PRS-505, without the painful process I have described, it would be great. The news fetching feature of calibre caught my eye as a good way to download the RFCs and have them automatically converted, but I don't know how to take this further. Any assistance would be greatly appreciated.
I've also attached some sample files, please have a look.
Thanks,
Vladimir