Calibre ebook viewer - Apply User Stylesheet to Full Screen Mode

Paste the following in the 'User stylesheet', click ok. Then go to 'Theming' and save the style with whatever name you like. The e-book will display nicely in any screen mode and there are a couple of neat little extras you won't see with other user themes. As with all CSS it can be further altered and tweaked to suit.

html {
    background: #e6e9e9;
    background-image: linear-gradient(270deg, rgb(230, 233, 233) 0%, rgb(216, 221, 221) 100%);
    -webkit-font-smoothing: antialiased;
}

body {
    background: #1f2326;
    box-shadow: 0 0 2px rgb(225, 225, 225);
    color: #d4d4d4;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 800px;
    padding: 2em 2em 4em;
}

h1, h2, h3, h4, h5, h6 {
    color: #e4e7e7;
    font-weight: 600;
    line-height: 1.3;
}

h2 {
    margin-top: 1.3em;
}

a {
    color: #2196f3;
}

b, strong {
    font-weight: 600;
}

samp {
    display: none;
}

img {
    animation: colorize 2s cubic-bezier(0, 0, .78, .36) 1;
    background: transparent;
    border: 10px solid rgb(145, 143, 140);
    border-radius: 4px;
    display: block;
    margin: 1.3em auto;
    max-width: 95%;
}

@keyframes colorize {
    0% {
        -webkit-filter: grayscale(100%);
        filter: grayscale(100%);
    }
    100% {
        -webkit-filter: grayscale(0%);
        filter: grayscale(0%);
    }
}


Where can I find Apple's iBooks formatting guide?

Yes, you can get a PDF of the iBooks Asset Guide from their site: https://itunesconnect.apple.com/docs/iBooksAssetGuide5.1Revision2.pdf


Send to kindle - store in specific folder

The equivalent in Kindle to folders is collections. Usually you can create this on the ebook reader yourself.

This Kindle help document https://www.amazon.com/gp/help/customer/display.html?nodeId=201733490 indicates that there is a cloud component to collections on later devices, but I don't know what this means for kindle apps.

For the Android Kindle app's main screen, when you keep holding down on the ebook title,a  + option will appear  which allows you to add to collections.

UPDATE: https://www.amazon.com/gp/help/customer/display.html?nodeId=201715640 "Note: Collections created on devices or apps that support Cloud Collections cannot be imported to devices and apps that do not support Cloud Collections. Any existing collections you’ve created on non-supported devices will not change and will not be available in the Cloud."


Annotation of non-Amazon books on Kindle Paperwhite

Update 2018:
Got an epub book? Best way at the moment for most qualiity and support is renaming to .txt (or png?) and sending to kindle email adress with convert subject (doesn t even need convert subject here? ;  anyway better than calibre mobi conversion way). This way (direct) epub conversion is supported although it s officially not.

TL;DR (today's environment)

Yes, you can annotate (pdf and azw...)
Yes, on formats like azw.. (you can convert via amazon upload "convert" as email subject; or calibre) you can extract your annotations via clippings.txt on kindle paperwhite, or by sharing it around your devices (amazon upload) and export with android kindle app.
No, using pdf, getting the annotations outside seems to be difficult, you can annotate though, but for me without being able to extract them, this is a bit sensless (there are also no normal pdf annotations, like you know from adobe reader). As PDFs are the onle way for some documents (magzines, math formulars?) this is annoying. Any solution is appreciated!
For Amazon bought books just use: read.amazon.com/kp/notebook (or the azw... possibility explained above)

As I'm highly interested in reading PDFs on my kindle paperwhite 3 (the recent one), as I want a perfect reading experience (eInk/no bright display and high resolution) and the kindle paperwhite gives me that. I experimented with my kindle fire and my paperwhite, so far my insights for the kindle paperwhite are (they correspond to todays possibilities, when something changes, feel free to comment):

You can annotate converted ebooks and pdfs
The problem is how to get the annotations outsite of the kindle paperwhite

There seem to be 3 factors:

Which software version (kindle) do you have?
How did you transfer the data to your ebook (by usb or by amazon uploading)?
Which format do you use (pdf or epub or azw...)?

The software version decides how the notes are stored on the kindle. It seems to be that in earlier version notes where stored in an "mbp" file format, which could be read with the right software. But amazon changed that to "mpb1" (I don't know, if it is possible to read that). (I tested everything with today's recent kindle version 5.8.10.)

The transfer type decides if your uploaded document (only the document, didn't say anything about annotations yet) is distributed to your devices. It is distributed if you upload it via amazaon (e.g. with send to kindle via email), with USB it is not.

The format decides if your annotations are synced around your devices. This obviously only works, if the document itself is synced (uploaded via amazon). So you need to upload it via amazon and use an kindle compatible book format to share your annotations (pdf won't work).

temp TL;DR:

If you want to just share your document around your devices (not annoations), use amazon uploading.
If you want additionaly to share the annotations also use amazon uploading but use a compatible file format (not pdf), easiest way is, writing "Convert" as the subject when sending the file via email uploading.

Sadly: https://read.amazon.com and also https://read.amazon.com/kp/notebook? (shows your annotations in the browser) won't work with that methods (also the windows kindle application!). They just work with amazon bought books, as I see it.

For me, this is very unsatisfactory as I don't just want to have the notes on the kindle reader app or on my kindle paper white, I want it to be on my pc! Reading app for pc would only be second best option, but as I said, it doesn't work like i said in the paragraph before.

So I experimented further.

paperwhite usb to pc: There are many formats, somebody may try to open these: .apnx, azw3f, azw3r, mbp1, mbs, pds, pdt. I didn't really, would be great if somebody finds out something.
open the clippings.txt under documents. There you can find the annotations of kindle books formats (azw... and so on, but not pdf) (can also be synced files),

Sharing the notations via kindle itself:

The sharing options on paperwhite are shit, you can only share a single annotation at a time, and you can share it with facebook and twitter - facepalm.
The sharing options with the android fire kindle app are good and much better. But this only works with formats like azw..., it does not work for pdfs.

The pdf annotation extraction/export seems to be difficult. This is very unsatisfactory for me, as some documents (math formulars?) and magazines can only be read properly as an pdf. I appreciate any solution in this area!


Converting Kobo EPUB format to Kindle format

You can download the program Calibre. This is an eBook management program (Windows, Mac and Linux) which can sync ebooks from your PC to Kindle. Also, it will convert most files so they are compatible with your Kindle.


Is there any way to address encoding errors in purchased ebooks

There is not a way you can correct an ebook without removing the DRM and adjusting the code.  Depending on where you purchased your ebook you should contact their customer service and they will require that the publisher/author correct the issue and issue you a refund.


Quality resolution for PDFs is awfully dependent on screen size. The bigger the display, the easier it is to read.

I don't have much experience working with Kindle's PDF converter/reader, but it's possible that this pdf uses formatting which the converter cannot process.

You might find interesting my answer on this topic. is PDF not considered as an ebook format


The built-in Kindle pdf reading app is very limited and not suitable for academic papers or text books, because it doesn't have an smart reflow option.

If you're on a budget and like the Amazon ecosystem, you could buy an older model, jail-break it and install the free KOReader app, which offers better PDF display options. (Note that this will work only with the first generation Kindle Paperwhite model and other older Kindle models.)

There are some large screen eInk readers suitable for reading .pdf files, however, they tend to be more expensive than more powerful tablets with same screen size.

IMHO, the best e-readers for .pdf files are tablets with a screen size of at least 10".


In principle a CDF could be embedded in an EPUB3 file, but it would not bring you much. You would need a reader that knows how to extract it and play it and those are currently not available.

For viewing (playing?) a CDF you need to download and install software. This a problem for acceptance, a problem that Wolfram would have avoided if they could, e.g. by writing the viewer in JavaScript. Not reaching acceptable performance of a JavaScript based implementation of a CDF viewer is probably the most likely reason why this is not done, assuming there are no other technical difficulties.

In this table you see how CDF compares to HTML5 and JavaScript, so it seems only a subset of the CDF functionality could be achieved by conversion to HTML5.


How to extract epub file up to chapter one and create new epub with extracted content

An EPUB file consists of multiple entries in a ZIP file. To extract the first chapter, you have to first determine how you know where the second chapter starts, as this doesn't have to coincide with an entry in the ZIP file.

Essentially what you need to do is:

Extract and analyse "META-INF/container.xml" to determine where is the root content file of the document which can be in the root of the EPUB, but also in a subdirectory)
Walk over the items in the content file to start building up the first chapter and accumulate data until you hit the second chapter.
On the way there you might have to take care of included images, cross references and the like.

Once you have gathered this data, write out the first chapter into a new file. Care should be taken this is a valid EPUB file, that adheres to the restrictions on EPUB entry sizes that some older readers impose (i.e. split the HTML for the first chapter in small enough chunks). Any language with a good XML library (including namespaces), HTML parsing and a handling zip files should do the job. I tend to use Python for that.


EPUB 2 specifies content as supported property in the list of CSS properties.

However, it is based on CSS 2.1, where the content property is allowed only for :before and :after pseudoelements. As the linked EPUB 3 spec shows (by linking to CSS 2.1), the same restriction applies in EPUB 3.

Thus, the code in the question won’t work, to the extent that it relies on the content property. Moving the declaration to apply to a pseudo-element, if applicable, should work in conforming software:

.TXBDINGBATS:before {
  content: "\2217 \a0 \a0 \a0 \a0 \a0 \2217 \a0 \a0 \a0 \a0 \a0 \2217";
}


When it is better to use plain HTML instead of CSS?

In general, formatting with HTML (though regarded as outdated by many, including W3C) tends to work more reliably than formatting with CSS. Support to CSS varies and can be disabled (though this is rare and mainly applies to web browsers). However, HTML formatting is very limited. You can use  for italic,  for superscript, and a little else, but you cannot e.g. specify the size or vertical position of superscripts (which depend on user agent and vary considerably).

In e-books, however, we can expect CSS work well for the simple formatting that would be possible in CSS, too. I tested your example, with an ebook created with Sigil and then converted to .mobi format with Calibre, and viewed with Kindle for PC, the exponents worked OK, the same way with HTML only, when I used the obvious CSS rules

.corsivo { font-style: italic }
.apicecorsivo { font-style: italic; vertical-align: super; font-size: 80% }

So if the exponents didn’t work, probably either the e-book is missing a CSS rule that makes .apicecorsivo appear as a superscript, or that rule was somehow lost when generating the .mobi version.

For stylistic reasons, it is best to avoid mixing HTML and CSS formatting so that e.g. some exponents are marked with , some just styled with CSS (set on  elements for example). The reason is that generally you cannot guarantee that the style applied is really the same. Your example has n-1, which is meant to produce “n−1” as superscript, but it may happen that they will be differently subscripted, i.e. in different font size or in different vertical position.

There are considerable styling problems with  in web browsers; they tend to produce uneven line spacing as well as qualitatively questionable superscripts. Such issues might not be that relevant in e-book readers, but it might still be safest to use a combined strategy, using  for italic (it’s rather safe) but CSS for superscripting. This would mean, in the example case, HTML markup like

axn +
bxn &minus; 1 + … +
hx + k = 0

with CSS like

.sup { position: relative; bottom: 1.8ex; font-size: 80% }


Amazon and Apple have their own DRM schemes and you won't be able to create an ereader that opens books from their stores. But most others use Adobe DRM, and you can license Adobe's Reader Mobile SDK to do this. ARMSDK is very expensive (when I was involved with a related project many years ago, it was many thousands of dollars a year for a license), and it is difficult to work with.

You may find these links helpful:

An overview of related tech on the Bluefire blog
A decent sales page for ARMSDK


This title is not currently available for purchase?

It looks like this is an Amazon based issue.

This book is currently unavailable because there is an issue with its description, content, or formatting.
We are working with the publisher to fix the issue. As always, we value customer feedback.

Note that is book is avaiable at Wikisource & PG


Why/Where is calibre writing author/title in metadata when saving to device?

I had trouble with metadata from Calibre until I realised that I had to either reconvert or polish the ebook after making any changes to the title, author, description etc.

For the metadata to "stick" you have to polish (in the case of an epub) or convert (in the case of a new book in other than epub format).

Although the metadata will look fine in Calibre, if you've made changes you need to polish or convert for the changes to be applied to the ebook.

Hope this helps you.


Are there good book recommendation services?

What Should I Read Next is a decent service. It doesn't require an account, which is an added bonus. You simply type in a title or author and the service will recommend books by the author or similar to the title you entered. The links provided will point you to Amazon for further information, so it is not ebook specific (and may take a few manual steps to find it on ibooks).

There is also this post that lists the top 10 book recommendation platforms (though it is a year old and includes the Sony Reader Store which no longer exists).


Centering images and text in ePUB and Kindle ebooks

You will probably run into problems doing it that way, particularly on iBooks. The most reliable method I've found for centering is:

With css like this:

div.centered_image {
  width: 60%;
  margin: 1em 20%;
}
div.centered_image img {
  width: 100%;
}

On a very few reading systems (notably the nook), this can cause problems on some images due (I'm guessing) to rounding errors, so you may have to set the margins just a hair smaller (like 19% in the above example).


The mimetype file has an extra field of length n. The use of the extra field feature of the ZIP format is not permitted for the mimetype file

I'm responsible for an attempt to improve this error message, see https://github.com/IDPF/epubcheck/pull/497 for details. Essentially your Zip packer puts some application or operating system specific stuff into the file, which breaks EPUB mimetype magic number support.


Best PDF app reader for iPad that emulates the paper book experience

take a look at ibouquiniste it seems to fit to the edges by default has a nice flip page animation

iBouquiniste Features Include:

Supports notes
Send books by email
Unique Author Library (each author on their own bookshelf)
View most recently opened books in the order you opened them
Real page numbers
Adjustable fonts, spacing, margins, book paper and more
Download books via iTunes or any app supporting file transfer (i.e. Mail or Safari)
OPDS catalogs support
iBouquiniste Cloud Storage for synchronisation (books, reading positions, citations and bookmarks)


How to put downloaded Kindle e-books on to a Kindle device that cannot access the internet

Calibre can transfer the book from your PC to Kindle.


Dual reading (for translation comparison)

There's a special PC/Android app that for that: Aglona Reader.
It uses its own XML format, though.
I.e. you'd have write your own converter.


I'm in the process of writing a bi-lingual multi-column translation of an Adobe.pdf German book on some of the regional dialects in Germany.  I have successfully tested .pdf pages that have test links to German and English YouTube websites for video illustrations of my subject matter.

One English language YouTube website video I have successfully tested in a .pdf test file is a video demonstration of examples of German regional dialects.  Another video on the German YouTube is a longish (30 minutes) video about the post-WWII German "Kabineroller" small cars -- actually it is also a video 'travelogue' of sorts.

From my tests I can see that YouTube video links from within my text will work and will be highly useful -- when and if I can finish my Adobe .pdf eBook!

My tests were with external video sources, and for this reason my videos won't take up any space at all within my eBook.  Obviously though, with my method if you want to use explanatory videos in your eBook those videos will have to be posted and available separately on some sort of a support website, i.e., a public or private website.


How to build ebooks from O'Reilly Atlas Projects?

First, kudos to learning about a new tool. (I never heard of it).

The content creation environment is in closed beta, so I wouldn't expect there to be any way to access the source code.

But the reading portal lets you view the full HTML which is generated by the HTMLBook source. I'm guessing that they have a tool to import asciidoc into HTMLbook, but I'm not sure if it only imports a subset of ASCIIDOC elements.

I think the whole point of Atlas is to make it unnecessary to have access to the source code, and to provide readymade templates and styles. Building for epub, pdf and mobi is complex, and it would be hard to recreate their toolchain on your own production environment.

Based on the video I've seen, it looks very impressive and hopefully will be a single source competitor to Adobe Indesign. It's unclear whether storing the source on the cloud will allow you to download an offline copy of the source.

I'm struck by the similarities between Docbook XML and the elements created through the editor. (Indeed, I suspect HTMLBook is based upon it). Even if you downloaded an offline copy on source, I'm unsure how you would build it yourself; (for example, it seems that Atlas uses a commercial  PDF processor from AntennaHouse, which most people wouldn't have a license for).

One thing is clear though. If you have access to the HTML output, you could probably import it into some desktop ebook creation tool and change the styles as necessary. The generated HTML is very clean, so I would expect it not to be that painful.

One example of a down-and-dirty export is to paste the HTML output into a MS Word doc, make sure the images are all there and then convert it into a PDF.


Did any other publisher follow Baen's approach of freely releasing older e-books (especially for series)?

It has become very common for publishers to provide free copies of the first book in a series. So common that the ebook deal site BookBub has pages of links to free ebooks - some deals are ongoing and some just for a limited time.


How to update Chinese fonts on a Kindle Paperwhite registered at US Amazon?

Well OK I somehow found the answer myself. The problem of Chinese fonts not updating is not because of my registration at US Amazon, but because of my system font not being Chinese. As soon as I changed my font to Chinese it almost immediately started the font update.


Calibre (free, open source) can convert between various formats, including mobi to epub.

https://calibre-ebook.com/

The command-line ebook-convert is also a part of Calibre:

https://manual.calibre-ebook.com/generated/en/ebook-convert.html

Also, there are third party tools to enable Calibre to remove DRM, if that is needed.

https://apprenticealf.wordpress.com/


How to work with the Calibre command line can be found in this manual.

Use this command to show what you can do with plugins:

calibre-customize -h

I'm afraid Hyphenate This! is just a GUI plugin without a command line interface.

(For more advanced work with plugins, look at API documentation.)


Is there any software that facilitates scanning of a paper book into an ebook?

Tesseract is an open source OCR engine that gives fairly good results. It's my understanding that Google use it for Google Books. OCRFeeder is a project for document layout analysis that works as a nice GUI for Tesseract.

Ocropus is another known open source OCR system.


Kindle (classic) power consumption when reading PDF vs. MOBI

If the PDF file is not formatted to the size of your Classic Kindle screen (roughly A6 format or 6"x4") you will consume a lot more power because you will need to zoom in and out and navigate on the page in order to read it. A MOBI file does not have this kind of problem because it dynamically resize the text so you can read without interaction.

Your e-ink device (any Kindle generation) will be off while you read and will power on when you click on any button or on the screen. So as well as it is on sleep mode it will consume less power. The device only needs power to refresh the screen and redraw anything or change pages, thus any interaction that redraws anything consumes more power.


JPG loses quality during ePUB to PDF conversion with calibre

You should look for a Calibre option for JPG files that does not cause them to lose quality. Look through the manual.

I know Adobe Distiller has options to keep high-quality JPG files. Does Calibre call Distiller or does it have it's own PDF maker?


Personal screensaver random from a set on Bookeen Cybook Odyssey

It is not possible. Right now, you can either select only one image from your own documents, or the random set of Bookeen images, which reside on the partition not accessible by the user.


You essentially already answer your own question: indexes are more than just a reference to the words in a text. Apart from creating relationships an index
can hide non-essential use of a word, and have definitions be different from normal use of a word. This requires interpretation by the author, something a search does not do.

I used LaTeX and its index generating capabilities when writing my thesis and the references to defining occurrences showed differently (italics) from the normal entries. Of course the software also helped by showing ranges of pages where a word was marked for indexing, which is also something a search engine seldom indicates (it might highlight all occurrences on a page, but that is not the same as knowing that a term is used in 10 consecutive pages).


IPDF epub validator error says "File 'OEBPS/toc.ncx' could not be found"

This sounds buggy or perhaps you are viewing your directory incorrectly.  First, are you using the latest validator? Are you validating the file as an epub2 file instead of an epub3? (You should make the files epub3 even if you are not using epub 3's advanced features).  FYI,  use of toc.ncx is  deprecated starting in epub3. Epub 3 validation shouldn't even care if the toc.ncx file is there or not.  (all it really cares about is that the assets in package.opf match what is in the directory).

See this FAQ:

  Why does EPUB 3 allow NCX files, and do I need to include one? The NCX
  file is allowed for forwards compatibility purposes only. An EPUB 2
  reading systems may open an EPUB 3 publication, but it will not be
  able to use the new navigation document format.

  You can ignore the NCX file if your book won't render properly as EPUB
  2 content, or if you aren't targeting cross-compatibility.

  Your publication may still open on EPUB 2 reading systems even without
  an NCX. Some reading systems, like Adobe Digital Editions, will not
  provide navigation by table of contents but will open the publication.

UPDATE: Here's how to know whether your file is epub2 or epub3.  Inside the unzipped epub file is a file called package.opf . Near the top you will see a declaration that looks like

<package xmlns="http://www.idpf.org/2007/opf"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:dcterms="http://purl.org/dc/terms/"
   version="3.0" xml:lang="en" unique-identifier="pub-identifier">

Here you will see that it says version="3.0". Here's what a 2.0 version looks like:

<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="bookid">

(It doesn't have to look exactly like my package element for 3.0, but it should look similar).


Kindle Voyage does not show book transferred under Calibre

One of the reasons this can happen is if the Calibre "convert to MOBI" preferences form has the Personal Dog tag set to [PDOC]. Then it will not show up in some versions of Kindle in the list of "Books", but it will still appear under "Documents".

Is not possible to change this tag using Calibre. A workaround is to convert it back to EPUB and then again to MOBI, this time making sure that the Personal Dog tag is set to [EBOK] or not set at all.

This thread has a nice discussion of the issue.


How to convert tagged articles into a single ebook without losing tags for reading on kindle?

Probably the best approach for this would be to treat each category as a chapter. The whole point of chapters in a book is to control the order in which a reader proceeds through the book. It sounds like you want to ensure that each category is read in a specific order, so your next step would be to decide just what that order should be.

If you still want to make use of any tags, then you will want to convert those to html anchor tags, which will also be used for each category (chapter). When all is finished, you could have a full Table of Contents (your list of categories), as well as a directory of tags. This will probably require some additional work in converting the content and getting it formatted properly, but it is definitely doable.

If you decide you would like to tackle this on your own, I strongly recommend using Guido Henkel's guide to formatting. It's a nine-step process that takes you through very detailed instructions on how to create a properly formatted e-book, including how to create a Table of Contents. He will also explain the free tools you will need, such as Notepad++ and Calibre. I used this to create my first e-book four years ago, and it is still the same process I use now, with nearly forty titles published.

This guide can be used by anyone, but it would be a lot easier if you already have a basic understanding of html. It isn't required though, because he does an excellent job of explaining everything and taking you through the process step-by step. If you find this to be too daunting, then your best approach would be to find someone to format it for you.


Taken from here:

Open Adobe Reader. Go to Edit - Preferences - Accessibility.
Make sure the "Replace Document Colors" is checked and click on Custom Color.
Click "Page Background" color and then select "other color."

I don't know if the version of Adobe Reader matters or not (or if it matches what you have).

You could also consider using a different PDF view. I personally perfer SumatraPDF. It has a settings.txt file that you can edit to customize the text, background etc., which can be accessed via Settings > Advanced Options (options your default text editor for txt files).

NOTE: I am using SumatraPDF v2.4


Which FREE ebook readers for Windows allow two-column view and left justification?

BlueFire Reader displays the text in multiple columns, and you can set the alignment to left or justified. The alignment setting shows up when you check the advanced settings box in the settings dialog (the gear icon in the toolbar).


I changed the viewer preferences and it worked. Thanks


In the UK you can (I suspect it depends on the county/borough) borrow ebooks from your public library.

They use Overdrive as I suspect many others do, so I think only do ePub readers(and only those that understand Adobe DRM), so no Kindles. Overdrive does do Kindles but only in the US.

See the entry page and you can browse without registering for the London Borough of Croydon


How do I download DRM-free books from Amazon?

Simultaneous Device Usage: Unlimited is not a reliable indicator of DRM-free books. AFAIK, all free Public Domain books sold by Amazon Digital Services are DRM-protected.

For example, this free Amazon book is listed as Simultaneous Device Usage: Unlimited, however it's not DRM-free.

  I am running Linux, if that can be any help. But I do not own a
  Kindle, and my only devices are my PC (running Calibre on Linux) and
  an Android pad used by another person.

In that case you can easily test for yourself whether a book is DRM-protected:

Install the Kindle for PC app via Wine or Winetricks and register the app with Amazon by entering your logon credentials.
Send the book to your Kindle for PC app via Manage Your Content and Devices and open it.
Open a terminal window and enter the following command to locate the Kindle books folder:

cd ~/Documents/My\ Kindle\ Content
Right-click the .azw file and select Open with Calibre.
If Calibre doesn't display a DRM warning the book is not DRM-protected.


Can I share premium ebooks online for free?

Warning: I highly recommend consulting a lawyer for dealing with legal issues such as this one. The advice I provide should not take the place of proper legal counsel.

Unless you have permission from the copyright holder for the work that you are hosting on your website, yes - it most likely is illegal. There are a few possible ways one might deal with this problem and I'll briefly mention them:

Allow only verified users to upload content (this doesn't prevent verified users from abusing the system but it will add an extra roadblock for someone looking to dump a bunch of protected content)
Approve each item before publishing it (tedious and difficult to scale, but very effective)
Publish everything and wait for DMCA takedown requests (I mention this for completeness; I certainly don't recommend going this route)

If your userbase is small, approving each item (or even just the first submission by each user) is probably the way to go.


The Sony Reader software that came with the reader has an option to export notes as an RTF file. I'm not sure whether or not you can import the notes into another device though.

I'm not able to find a user manual and I don't have the software on this laptop (I do on my other one, so perhaps I can find the information later). However, I did find a blog that gives a basic step-by-step of how to export the notes:

  Export Notes and Highlights:

  Plug the Reader into your computer with
  the USB cable, open the Reader software if it doesn’t open
  automatically, navigate to the book with the notes/highlights using
  Sony’s Reader software, open it, and then click the green icon on the
  lower left to export the notes as an RTF file.


Are there ways to automatically detect what book an e-text is?

I am not aware if it is such a tool/service/API, and generally publishers don't offer APIs IMHO mainly because copyright infringement sites or concurrent businesses might use them.

So you need to take a custom approach, using URL because most of the sites use GET method to do their queries and do some data-mining using scripts (wget/selenium etc).

You could do like this:

Search for exact text in google

ex search:

"Numerical boundaries take many forms but are always applied in finite games. Persons are selected for finite play."
Look for ISBN in resulted pages or for title and author using regular expressions or CSS selectors, XPATH etc.
Search using advanced query on amazon or other site:
http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooks&unfiltered=1&field-isbn=1476731713

notice &field-isbn=1476731713 same could be used for &field-author= or &field-title=

Use regular expressions to extract all the book data.

This would be my approach.


What does FlightCrew's "Unable to find zip structure: End-of-central-directory" mean?

That would mean your EPUB does not have a proper ZIP file structure.

You can try listing the content of your file with a normal zip unpacker, or test it with a real epubreader. If those do not complain, it could mean that FlightCrew has a bug.


How can I make my highlights span multiple pages in Google Play?

2 possible solutions or workarounds.

First, if viewing GPB in a web browser, it is easier to highlight text on more than one page. (I was able to do it).

Second, one workaround on a device might be to reduce text size to the smallest possible size, so that the maximum amount of text is on one book page.


I don't know a lot about SVG, but I  have played around very superficially with svg in ebooks (about a year or two ago). What I found was that although my  simple svg worked in one or two epub readers, support on Kindle was very iffy.

If you look at the Amazon Kindle Publishing Guidelines, you will see about half a page on SVG support. It seemed very limiting. That probably accounts for the lack of interest in the topic -- especially because it's just as easy to make a jpg or png.

If there is SVG in an ebook, I'm guessing it is an ebook targeted to one specific reading system. (I suspect that academic publishers would be the one pushing for it most).

As ebooks become more graphics-intensive, ebook size will become a more important consideration, and scalable graphics will finally be important.  One crazy thing about KF8 format is that the max-width css attribute isn't supported -- making it hard or at least complicated for images to scale in an ebook predictably.

SVG is already supported in major browsers, and it can be frustrating not to see such features supported in ebook reading systems. But there is typically a lag between when something is supported in browsers and when the epub standard requires it -- and when reading systems decide to deploy that.


Centering images in ePub made with Apple Pages

The right alignment results from the margin-left:16.5528% in the span surrounding the image. I am not sure if you can change that in Apple Pages.
I would experiment with Position (at the bottom of your screen) essentially
there should be no position in cm associated to something centered, as you
cannot know (in an ePub) the width of the page up-front.

If you cannot switch that off, you can resort to cleaning the epub with a script, this seems easy enough to find (e.g. using CSS locater span > img and changing the style on the parent of that img)


Finding the home screen's most recent books on Linux

Use the following shell command for listing the last three files:

find database/media/books -type f -exec stat --format '%Y :%y %n' {} \; \
    | sort -nr | cut -d: -f2- | head -3

For putting a book at the top of the list use touch:

touch database/media/books/mybook.epub


What was the average income from ebooks for independent authors in 2013?

Statista (The Statistics Portal) looks like it has some relevant ebooks revenue information (though not exactly what you are looking for). Unfortunately, you are forced to sign up for a premium account to access most of the reports. A sample report that they actually show you some of the information for is here (Global e-book revenue from 2009 to 2016*, by region (in million U.S. dollars), obviously some is projection).

I did manage to find an informal survey done by Marie Force about independent publishers here (covers total unit sales broken down between 2010, 2011, 2012 and some of 2013) . Here is an excerpt:

  The conversation on the loop led to me post an informal survey to get
  an idea of how our members and their self-publishing friends are
  really doing. I didn't ask people to give dollar amounts, but rather
  just their number of sales in 2010, 2011, 2012 and so far in 2013. I
  asked them to list their most successful book in 2012 and how many
  copies it sold. At the outset, I want to say that this survey was
  informal. There is nothing scientific about it, but it does provide an
  interesting snapshot of how self-published authors are really doing.

  To give context to the numbers, I wanted to also provide a guide to
  what the most popular price points translate to in actual dollars.
  Using Amazon's conversion chart, here it is:

  0.99 (35 percent royalty): $0.35 per sale
  1.99 (35 percent royalty): $0.70 per sale
  2.99 (70 percent royalty): $2.04 per sale
  3.99 (70 percent royalty): $2.74 per sale
  4.99 (70 percent royalty): $3.44 per sale

  While I didn't ask authors to list their most common price point
  (which I will add to the survey next time), I thought the breakdown
  above would be enlightening to the authors out there who might be
  waffling about whether they ought to try their hand at
  self-publishing. If you are thinking about whether or not you should
  dip your toe into the revolutionary waters, ask yourself these
  questions: When was the last time I made $3.44 on the sale of one
  book? When was the last time I made even $2.04 on the sale of one
  book?

She then goes on to post a bunch of survey results broken down by author. Here is a sample of one of the survey results:

  Elisabeth Naughton Romantic Suspense and Paranormal Total number of
  self-published titles: 12 Total number of self-published sales in
  2010: 0 Total number of self-published sales in 2011: 0 Total number
  of self-published sales in 2012: 102,179 Total number of
  self-published sales so far in 2013: Jan-March 2013: 370,059 Most
  successful book in 2012 and how many sold: MARKED - 30,673 copies

  I've been traditionally published for four years and my income comes
  primarily from my self-published titles, NOT my traditionally
  published titles.


How to perfectly convert and read malayalam ebooks on kindle?

Is there a good way that can easily get my kindle the ability to make
  reading malayalam ebooks possible on my kindle?

Create an ePub file with Calibre and/or find an existing ePub file. Make
sure that the source epub file is properly encoded. (I.e., if you open it with Calibre, it must show Malayalam characters.)
If it does, simply convert it to an AZW3 file (not a MOBI file) with Calibre, copy it to the documents folder of the Kindle and you're done.


Can I include code in .mobi to control the native voice synthesizer in a Kindle?

That is not possible in any of kindle eBook formats. Amazon is stripping all html which is not supported as they stated it in Kindle Publishing Guidelines. Also you don't have access to any of device settings - including Text to Speak.


Well in my opinion and also testing knowledge of ereaders... the djvu and pdf doesn't hold that great difference anymore...
In the past djvu use to have a higher compression ratio cause the files to be much smaller in storage and also had higher quality rates at this compression...
Now with tech as far as now pdf is also able to have high compression ratio...
Though when it comes to ereaders you see pdf is sometimes much more secured when doing DRM as such it would be more used above djvu... also I know from tft eReaders they tend to not always be able to support the djvu format that greatly where as all tft eReaders do support pdf, due to the fact that most development with eReaders ensure adobe support so that people can get DRM ebooks.
E-ink readers are able to support djvu again very good so yeah on the end nowadays I would say use the format of the ebooks easiest for you to obtain :D

I hope that my explanation help a bit.
This is my personal opinion from my experience of testing across different eReader devices and E-ink as the company I work for use to back in the day import them when they were big in the market and I was lead tester for many of these devices :)

Also seeing now the title you wanted advantage and disadvantages... okay well then

pdf: safer, more secured, available across more platforms, but more detail slower loading, refresh ratio is low

djvu: better caching for E-ink, redraw faster, graphical book, not as secured, not available on many different platforms


Get error when I try to upload book to kindle

First, what type of Kindle do you have? Do you have e-ink device or a Kindle tablet (i.e, Kindle Fire)?

If you have a Kindle tablet, then I recommend that you view the file with a PDF reader app instead of using the Kindle app. If there is a cloud-based app, that is even better.

File size is another problem -- PDF readers can typically read larger PDF files, but it is still difficult to transfer to the device. Perhaps you can use dropbox or gmail to send it, but I'm guessing you can open it through the browser in your tablet.

You have highlighted a very important problem on Kindles. I believe Google Play Books (GPB) is the best reading system across platforms, and it's crazy that there is no GPB app on Kindle (ios has a GPB app which works great).

Some places on the Net suggest a way to install Google Play store on Kindle by sideloading, and that is good, but I don't think that is an effective way to get GPB on your kindle. (I recommend against it -- though I wish Google and Amazon.com can figure out a solution....)


Is it possible to set font-color to the background-color

Let's analyze this question a little bit.

The 7; is it a background image or using some advanced css trick like this? https://stackoverflow.com/questions/15986216/how-can-i-add-a-large-faded-text-background-via-css

I haven't studied the issue in depth, but ebook reading systems generally don't support background images for pages. They generally are behind the curve of css which is supported in web browsers today.  Maybe in the next generation of e-readers (5-10 years from now), this will become possible.

If you used a Fixed Layout Book format (on kindle or Apple), maybe you might achieve this effect, but doing so would use a fixed display size  and generally disable user controls.

You're asking for the moon, bro....


The only metadata that is visible to the user in a Kindle Paperwhite is the title and author of the ebooks.

Connecting the Kindle to a PC does only help if you synced your Kindle with Calibre's library, because in this case you would have in the root folder of your Kindle a file called metadata.calibre that would contain the metadata of your ebooks in YAML format.


Universal Identification metadata for e-books

This is a great question, and I don't have any inside knowledge about how search engines interpret metadata for books.

I checked the source of several book distributors and found that there's an open graph generator for books. http://webcodetools.com/open-graph-generator/book

Librarything, Smashwords and Harper Row publishers embed ebook info in these tags, and possibly more (but not Amazon).

I don't know if putting things in the meta tag really counts as giving it semantic meaning though.

Also, it's interesting that I don't see anything human readable on Amazon that might resemble this.

Dublin core metadata is popular for library cataloguing, but I don't think it really offers useful information for search engines http://wiki.mobileread.com/wiki/Dublin_Core
http://dublincore.org/documents/dces/

Actually when you input metadata for an ebook in Calibre, it generates dublin core data in the metadata.opf file (and you can edit this metadata by right-clicking the epub in Calibre). DB metadata is required and it typically appears in package.opf. Of course, this  standard doesn't seem to be geared to ebooks, and things like ISBN don't translate well for ebooks.

While logically it makes sense to have metadata for all the ebook distributors, it's unlikely that ebook distributors would carry metadata on its competitors. Publishers and authors are more likely to benefit from embedding this metadata, but what I've seen so far looks very simple (and gives only one URL).

I am guessing that while you might be able to do ISBN searches across platforms (even for ebooks), this is not especially useful for ebooks. It sounds like  other than fuzzy searches, there is no direct way for a database to be linked to the same ebook on different ebook distributors.

These are superficial thoughts, but  I would not be surprised if some kind of solution emerges over the next few years.


How to avoid image distortion when convert my .epub to .mobi

Here is the css I use for my kindle images:

div.image-container  {
width: 95%;
margin-left:  auto;
 margin-right:  auto;
  }

div.image-container img {
 width: 100%;
 display: inline;
 }

The goal I wanted here was to have an image cover 95% of the screen, with the image in the center. You could change the 95% to 25% if that is what you want. I do not think the height property has any function in your code.

The idea behind responsive web design (and responsive ebook design)  is that the images will adapt to the different screen sizes.  You can use css media queries to change the css for your images and div depending on screen size. (I describe it here: https://kdp.amazon.com/community/thread.jspa?messageID=1005910 )

Kindle definitely supports the css width property and min-width on KF8 devices and apps. But it does NOT support the max-width property. Hope this helps.


Can I make custom fonts show up in iBooks?

It is certainly possible to embed custom fonts and have them be used in iBooks, as well as on other EPUB reading systems. The process is known as embedding. Embedded fonts are simply included in the .zip archive that comprises the EPUB file, and then referenced properly in all the relevant content files. Places you will need to reference them include:

CSS file

This is just like using fonts on the web: the first thing you need to do is define @font-face:

@font-face {
  font-family: roboto;
  src: url('fonts/Roboto/Roboto-Regular.ttf')
}

and then use that declaration in for whichever styles you'd like to use that font:

p.intro {
  font-family: roboto;
  font-weight: normal;
  font-style: normal;
}

content.opf file

Just like all the other files in your EPUB, you'll need to include any font files you're embedding in the <manifest> of your .opf file:

<item id="Roboto-Regular_ttf" href="fonts/Roboto-Regular.ttf" media-type="application/x-font-truetype" />

The above steps are sufficient for most reading systems, but iBooks has one more hoop to jump through:

com.apple.ibooks.display-options.xml

This is a file that goes in the META-INF folder of the EPUB, rather than the OEBPS folder, and as the name suggests it's iBooks-specific. Neither this file nor the container.xml file need to be declared in the <manifest>, so don't worry about that. Here is the file in its entirety:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<display_options>
<platform name="*">
<option name="specified-fonts">true</option>
</platform>
</display_options>

A more in-depth writeup can be found on Liz Castro's excellent blog. As noted elsewhere, be aware that there are some potential hurdles, both legal and practical, to embedding fonts.


What is the best tool for Smashwords submission?

The short answer is to use any tool which produces a valid epub file.

There are 2 options.

Create it in MS word and use Smashword's  meatgrinder tool to convert it to epub.

Or create the epub file yourself and submit it directly.

If you are more comfortable with MS Word and don't mind troubleshooting its strangeness, go ahead with that. But MS Word is a complex beast.

I would recommend trying to learn to create the epub file yourself. But the process is not that easy.

One option is to rent Adobe Indesign and pay for one month. That should be enough to create your book and export it into epub. This is overkill.

Sigil is a somewhat user-friendly tool for creating epub files. It requires knowing html.

One thing you can look into is the online pressbooks for generating ebooks. It's free and works moderately well.

There are now more commercial tools for producing ebooks. All have their limits or might cost money. But they might be fine for generating ebooks.

All the solutions are somewhat bad. They are useful for producing simple ebooks -- without much formatting.

Before you submit it, you should validate the epub file with the online validator. Smashwords won't accept a file which doesn't validate.

Two other things to keep in mind:
1)try not to use creation tools offered by the book distributor. They tend to be specific to their devices.
2)you may have to format something entirely different to make it work in kindle. However, if your epub file generally passes the epub validator, then you can use Amazon's kindle converter to make it.


Calibre - switching title and series column

No, there isn't a one click solution for swapping series and title. You can only swap title and author (in bulk metadata edit mode). If you want to automate this you have to write a (small) program that reads the metadata file (which is XML), does the swap for you, and feed it the offending files.

Not helpful for the files you already imported but maybe useful to know for new ones, is that you can change the regular expression ( Preferences -> Adding Books) that tries to extract metadata from the filename. The default there however does not put something in the series field, so you might already have changed that.

Biggest problem IMO is that Calibre uses the filename to guess the author/title etc, even if you add a file which has correct metadata available. I normally don't use Calibre's drag and drop feature, instead relying on programmatically adding files with the metadata extracted from the file internal data (for PDF/Epub etc) when available.


Kindle Cloud Reader can't open this book

The Kindle Cloud Reader is a Kindle Web App which anables us read Kindle books online.

As my own guess, Amazon use this web app to allow us to read kindle books online, and most of those contents are Kindle manga or comic.

For those long-text kindle eBooks(such as novels), we are limited to use Kindle desktop app or Kindle devices.


I am looking for a software or a way to list, extract, count, in short, analyze a book which is in epub or pdf format

Here is one way to find the number of words in an epub file sorted by their frequency, with the words used the most at the top of the list.

This is done on a Mac laptop and will also work on Unix hosts.

The overview of the process:

Install Calibre
Use the ./ebook-convert command in Calibre to convert the epub file to text
Transform the entire text file to lowercase (so "Word" and "word" match)
Convert punctuation to whitespace (so "period." and "period " match)
Convert all whitespace to a new line.  This puts each word on its own line.
Exclude any blank lines from the list
Sort the list of words alphabetically
Pipe (send) that list of words through uniq -c You now have a count of how often each word appears.
Sort the result in numerical order.  If you use the sort command with the -r argument, the most frequent words are at the top.

Here's an example of steps (2) through (9).  The head command lists the top ten words in the final output.

$ ./ebook-convert ./book.epub ./book.txt
$ cat   ./book.txt | tr '[:upper:]' '[:lower:]' | tr "“" " " | tr "”" " " | tr "," " " | tr "." " " | tr " " "\n" | grep -v ^$ |  sort | uniq -c | sort -gr  | head
 5303 the
 1960 and
 1934 of
 1910 to
 1874 a
 1168 i
 1067 you
  844 in
  812 that
  703 it
 $

The result is pretty boring.  The word 'the" appears 5303 times, while the word 'it' appears 703 times.

I suspect in most books the most common words are the tiny conjunctions, articles, prepositions and pronouns.  Perhaps on something that is not a novel this might be more interesting.

Good luck!


What fraction of unrestricted ebooks originate with the top digitization projects?

Forewords

I am assuming that the poster of the question calls
"unrestricted books" the books that have no DRM, i.e., no technical
devices intended tp prevent some uses, such as copy, search, or
adaptation to new reading devices. All books are born legally restricted by
copyright, at least today, until they enter the public domain. Very few rightsholders fully remove copyright
restrictions by providing adequate public licences.

Though I have read many papers on the topic, and written some, I doubt there is such a
document as requested in the question. The reason lies in the
diversity of objectives of the numerisation projects, on the lack of
standard definition of what a book is, on the wide variations
encountered on book counts in various studies (notably those concerned
with assessing the proportion of orphan books in various libraries).
The definition of a book depends on a variety of parameters, including
content and purpose, commercialization, relevance of distinct
editions, choice of illustrator, each of which may impact some numbers
by an order of magnitude. Does the Bible count for one, or for one
hundred thousands? What about Shakespeare's works, or Alice in
Wonderland? Does a single poem count as a book? What about a short story, a music score, a ship log, a catalog, a birth registry?  Recall that what figures may be available may have been
computed with different issues or purposes in mind, hence with different visions (often not explicited) of what counts as a book, and of what counts as two different books.   Hence, rather
than pointing on a specific document as requested, I try below to give a direct
answer, based on figures I may remember or retrieve. But a short crisp
answer would be misleading given the very fuzziness of available
information, and the fact that the question itself is thus
unwittingly very imprecise.

Global assessment

The production of unrestricted books by Project Gutenberg and similar
projects is tiny compared to raw digitization and OCR, as donne by
Google and large public and academic projects, for example by national libraries. It is on the order of
100 000 books, a magnitude order of 1/1000th of the total
number of books, that seems to range somewhere between 50 and 130
millions, depending on how books are counted. Large digitization
projects like those led by Google, National Libraries and large
institutions are about two orders of magnitude more productive, some producing several millions of digitized books, though
exact numbers are sometimes hard to assess.

However, if you consider quality digitization with proofread text and
structured formatting like the epub standard, efforts like the
Project Gutenberg seem significantly more productive, as large
digitization projects produce only a few thousands, unrestricted,
quality e-books (from what I have been able to check).

This is not surprising since large digitization projects are intended
mostly for preservation purposes, and for accessibility by the
research community (or for indexation purposes in the case of Google), while Project Gutenberg and its likes are intended for availability/accessibility purposes, i.e. to give convenient access to existing literature to a wider reading public.  Raw
digitization for conservation performed by large project is fairly
cheap and fast, while quality digitization require long and costly
human intervention (about one order of magnitude higher), that can be
well covered by crowd-proofreading and editing.

Another aspect is that, while the total number of books is very large,
only a small fraction is of interest to a wide audience. So the
relevant corpus for Project Gutenberg is probably much smaller than
the relevant corpus for large digitization project that have to deal
with all kinds of archives, inventories and the like. This is
compounded by the fact that the books that are of interest to a wide
audience are to a large extent still under copyright, hence much less
likely to be made available legally without restrictions, by any digitization project.

This actually stresses the importance in the book count of orphan
books, and more generally of books not cared for by rightholders, and
whether they can, or cannot, be made legally available, with or
without restrictions. This may represent on the order of half the
books in copyright. In the USA, it is an important aspect of the legal
battle around the Google Book Search Settlement Agreement, and it is
the object of a specific law in France.

So, I would tend to believe that cooperative projects like the
Project Gutenberg are the major source of unrestricted ebooks, if you
consider reading resources for a wide public. But, it makes little
sense to compare the output of two types of projects that have different
purposes, at least in the medium term.

Still, it should be noted that preservation is probably a more urgent
task than high quality digitization. It is rather sound that
preservation projects will avoid diverting much of their limited
resources on costly high quality output, other than for public
relation purposes. Also, the mass of documents
digitized by large projects provide a good source of raw material for
smaller projects (in size) that are aiming for quality output
that has a chance of attracting some readership.

We should also remember that digitization is not the only source of
ebooks. There are authors, publishers and institutions that produce a very significant number of
new books without DRM restrictions, though there may be legal
restrictions on use not enforced with DRM, as was the case before with
classical paper books.

Though I spent significant time analyzing the question and writing the
answer with some figures to substantiate it, it ended up being far too
long, and messed up by the heterogeneity of sources. Hence I decided
to cut it short here. If interested, you may read the rest in a
previous version from the history of this anwer, which contains some additional figures and references from various projects.

2 related questions:

What kinds of DRM are used in eBooks? Is it possible to purchase DRM free eBooks?

Some classic literature is available for free - but where?


How can I automate the creation of EPUB files from series of existing JPEG photos?

Part of the program I wrote for scanning and EPUB-ing scanned images can be reused for this purpose. I tried to make a minimal version, the output was tested with calibre book reader and a BookEen reading device and passed
EpubCheck version 3.0.1 without errors.

The program requires you to provide a Title (--title) and one or more JPEG files, which are taken as is (not scaled or rotated). Some extra options allow for specifying an output file name (otherwise constructed from the title), author/creator and series/series-index (as used by Calibre):

jpeg2epub --title "My Photo Album" img*.jpg

will create a file My_Photo_Album.epub in the current directory.

The program works with Python 2.7 and standard libraries, but will not work without modification on Python 3.X. All processing is done in memory, the computers memory limits the size of your EPUB, but no intermediate files are written.

#!/usr/bin/env python
# coding: utf-8
# jpeg2epub: copyright (C) 2013, RUAMEL bvba, A. van der Neut

import os
import sys
from io import open
from textwrap import dedent
from cStringIO import StringIO
import zipfile
import uuid
import datetime

class Jpeg2Epub(object):
    """simple epub creator for series of JPEG image files

    creates the file epub file in memory
    """
    version = 1  # class version when used a s library

    def __init__(self, title, file_name=None, creator=None, title_sort=None,
                 series=None, series_idx=None, verbose=0):
        self._output_name = file_name if file_name else \
            title.replace(' ', '_') + '.epub'
        self._files = None
        self._zip = None  # the in memory zip file
        self._zip_data = None
        self._content = []
        self._count = 0
        self._series = series
        self._series_idx = series_idx
        self.d = dict(
            title=title,
            title_sort=title_sort if title_sort else title,
            creator=creator if creator else 'Unknown',
            opf_name="c.opf",
            toc_name="toc.ncx",
            ncx_ns='http://www.daisy.org/z3986/2005/ncx/',
            opf_ns='http://www.idpf.org/2007/opf',
            xsi_ns='http://www.w3.org/2001/XMLSchema-instance',
            dcterms_ns='http://purl.org/dc/terms/',
            dc_ns='http://purl.org/dc/elements/1.1/',
            cal_ns='http://calibre.kovidgoyal.net/2009/metadata',
            cont_urn='urn:oasis:names:tc:opendocument:xmlns:container',
            mt='application/oebps-package+xml',  # media-type
            style_sheet='stylesheet.css',
            uuid=None,
            nav_point=None,
            nav_uuid=None,
        )

    def __enter__(self):
        return self

    def __exit__(self, typ, value, traceback):
        if value is None:
            if isinstance(self._zip_data, basestring):
                return
            self._write_toc()
            self._write_content()
            self._zip.close()
            self._zip = None
            self.d['nav_point'] = None
            with open(self._output_name, 'wb') as ofp:
                ofp.write(self._zip_data.getvalue())
            # minimal test: listing contents of EPUB
            # os.system('unzip -lv ' + self._output_name)
            return True
        return False

    def add_image_file(self, file_name):
        self._add_image_file(file_name)
        self._count += 1

    def _write_toc(self):
        self._add_from_bytes(self.d['toc_name'], dedent("""\
        <?xml version='1.0' encoding='utf-8'?>
        <ncx xmlns="{ncx_ns}" version="2005-1" xml:lang="eng">

            <meta content="{uuid}" name="dtb:uid"/>
            <meta content="2" name="dtb:depth"/>
            <meta content="ruamel.jpeg2epub (0.1)" name="dtb:generator"/>
            <meta content="0" name="dtb:totalPageCount"/>
            <meta content="0" name="dtb:maxPageNumber"/>

          <docTitle>
            <text>xx</text>
          </docTitle>
          <navMap>
            <navPoint id="{nav_uuid}" playOrder="1">
              <navLabel>
                <text>Start</text>
              </navLabel>
              <content src="{nav_point}"/>
            </navPoint>
          </navMap>
        </ncx>
        """).format(**self.d))
        self._content.append((self.d['toc_name'], 'ncx',
                              'application/x-dtbncx+xml'))

    def _write_content(self):
        d = self.d.copy()
        manifest = []
        spine = []
        d['manifest'] = ''
        d['spine'] = ''
        for f in self._content:
            manifest.append(
                '<item href="{}" id="{}" media-type="{}"/>'.format(*f))
            if f[1].startswith('html'):
                spine.append('<itemref idref="{}"/>'.format(f[1]))
        d['manifest'] = '\n    '.join(manifest)
        d['spine'] = '\n    '.join(spine)
        d['ts'] = datetime.datetime.utcnow().isoformat() + '+00:00'
        d['series'] = ''
        if self._series:
            d['series'] = \
                u'\n' \
                '<meta name="calibre:series" content="{}"/>' \
                '<meta name="calibre:series_index" content="{}"/>'.format(
                    self._series, self._series_idx)
        self._add_from_bytes(self.d["opf_name"], dedent(u"""\
        <?xml version='1.0' encoding='utf-8'?>
        <package xmlns="{opf_ns}" unique-identifier="uuid_id" version="2.0">
          <metadata xmlns:xsi="{xsi_ns}" xmlns:opf="{opf_ns}"
                    xmlns:dcterms="{dcterms_ns}"
                    xmlns:calibre="{cal_ns}"
                    xmlns:dc="{dc_ns}">
            <dc:language>en</dc:language>
            <dc:creator>{creator}</dc:creator>
            <meta name="calibre:timestamp" content="{ts}"/>
            <meta name="calibre:title_sort" content="{title_sort}"/>
            <meta name="cover" content="cover"/>
            <dc:date>0101-01-01T00:00:00+00:00</dc:date>
            <dc:title>{title}</dc:title>{series}
            <dc:identifier id="uuid_id" opf:scheme="uuid">{uuid}
            </dc:identifier>
            <dc:identifier opf:scheme="calibre">{uuid}</dc:identifier>
          </metadata>
          <manifest>
            {manifest}
          </manifest>
          <spine toc="ncx">
            {spine}
          </spine>
        </package>
        """).format(**d).encode('utf-8'))

    def _add_html(self, title):
        file_name = self._name(False)
        d = self.d.copy()
        d['title'] = title
        d['img_name'] = self._name()
        self._add_from_bytes(file_name, dedent(u"""\
        <?xml version='1.0' encoding='utf-8'?>

            <title>{title}</title>
            <meta http-equiv="Content-Type" content="text/html; \
        charset=utf-8"/>
          <link href="{style_sheet}" rel="stylesheet" type="text/css"/>

        """).format(**d).encode('utf-8'))
        self._content.append((file_name, 'html{}'.format(self._count),
                              'application/xhtml+xml'))
        if self.d['nav_point'] is None:
            self.d['nav_point'] = file_name
            self._write_style_sheet()

    def _write_style_sheet(self):
        file_name = self.d['style_sheet']
        self._add_from_bytes(file_name, dedent("""\
        .album {
            display: block;
            font-size: 1em;
            padding: 0;
            margin: 0;
        }
        .albumimg {
            height: auto;
            max-height: 100%;
            max-width: 100%;
            width: auto
        }
        """))
        self._content.append((file_name, 'css', 'text/css'))

    def _name(self, image=True):
        """no leading zero's necessary in zip internal filenames"""
        return '{}.{}'.format(self._count, 'jpg' if image else 'xhtml')

    def _add_image_file(self, file_name, width=None, height=None,
                        strip=None, max_strip_pixel=None, z=None):
        z = z if z else self.zip  # initializes if not done yet
        self._add_html(file_name)
        # you can compress JPEGs, but with little result (1-8%) and
        # more complex/slow decompression (zip then jpeg)
        # Gain 2.836 Mb -> 2.798 Mb ( ~ 1% difference )
        if width:
            im = EpubImage(file_name)
            z.writestr(self._name(), im.read(), zipfile.ZIP_STORED)
        else:
            z.write(file_name, self._name())
        self._content.append((self._name(), 'img{}'.format(self._count),
                              'image/jpeg'))

    @property
    def zip(self):
        if self._zip is not None:
            return self._zip
        self._zip_data = StringIO()
        # create zip with default compression
        #self._zip_data = '/var/tmp/epubtmp/yy.zip'
        self._zip = zipfile.ZipFile(self._zip_data, "a",
                                    zipfile.ZIP_DEFLATED, False)
        self.d['uuid'] = uuid.uuid4()
        self.d['nav_uuid'] = uuid.uuid4()
        self._add_mimetype()
        self._add_container()
        return self._zip

    def _add_from_bytes(self, file_name, data, no_compression=False):
        self._zip.writestr(
            file_name, data,
            compress_type=zipfile.ZIP_STORED if no_compression else None)

    def _add_mimetype(self):
        self._add_from_bytes('mimetype', dedent("""\
        application/epub+zip
        """).rstrip(), no_compression=True)

    def _add_container(self):
        self._add_from_bytes('META-INF/container.xml', dedent("""\
        <?xml version="1.0"?>
           <container version="1.0" xmlns="{cont_urn}">
          <rootfiles>
            <rootfile full-path="{opf_name}" media-type="{mt}"/>
          </rootfiles>
        </container>
        """).rstrip().format(**self.d))

def main():
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument("--title", "-t", required=True)
    parser.add_argument("--title-sort", help="alternative title for sorting")
    parser.add_argument(
        "--output", "-o",
        help="epub name if not specified, derived from title",
    )
    parser.add_argument("--series", help="series name")
    parser.add_argument("--index", help="series index")
    parser.add_argument("--creator", help="Creator/Author")
    parser.add_argument("file_names", nargs="+")
    args = parser.parse_args()
    with Jpeg2Epub(args.title, title_sort=args.title_sort,
                   file_name=args.output,
                   series=args.series, series_idx=args.index,
                   creator=args.creator,  verbose=0) as j2e:
        for file_name in args.file_names:
            j2e.add_image_file(file_name)

if __name__ == "__main__":
    main()


How to create clickable table of contents in a PDF?

Well, you could always buy a copy of Adobe Acrobat, which is actually designed solely for the purpose of creating and editing PDF files.

Or you could import the file into Calibre, convert it to ePub format, edit the ePub to add the table of contents, then convert it back to PDF.

There are other free tools for working with PDF directly. If you do a Google search, you would find this page which lists several free tools for editing or modifying PDF in various ways.


ePub 3 option for age restriction metadata?

Excellent question. To my knowledge there is no equivalent function in epub. In a web browser, RTA is done on the meta tag in your browser. But with epubs, you already have to store your Dublin Core metadata in the package.opf file, so there is no need to do so on individual html files.

I skimmed the Dublin Core metadata and did not see anything for an Adult label, although perhaps genre/audience/subject might be relevant here.

I knew that when you sell your ebook, Amazon or Google Play ask you to put a put it in a category (I later learned that they correspond to BISAC codes). An Oreilly article mentions other categorization schemes like marc and onix.

To summarize: The book creator usually can mention certain DC values which will be wrapped up in the epub. But I don't know of ebook reading systems which are using it to prevent the user from viewing it. On the other hand, when you submit your ebook to an ebookstore, they usually ask you to give some values that would allow the store to prevent younger readers from seeing it or buying it.

But what if you are selling directly from your own website? What can you do? In addition to RTA labeling, you can require some proof of age to access the page or file. Ultimately though, when you are dealing with DRM-free ebook files, there is nothing preventing an underage user from loading it into an ebook reading system.


I searched all over and could not find the solution until I came across a russian site http://kindle.zzweb.ru/paperwhite/repair/. Basicly it sates this:

Connect the Kindle Paperwhite to a computer USB-cable.
Create an empty file in the root directory DO_FACTORY_RESTORE.
Safely disconnect the reader from your computer.
Reboot your device by holding the power button.

I did this and my kindle paperwhite did a factory reset and I was able to use it again. I had previously tried to format the drive and place a firmware update on the drive so I do not know if this will remove your books. Please try and back up your books if you can before you do this.
Hope this helps others.

Copied from: https://www.reddit.com/r/kindle/comments/2xojx2/how_to_fix_your_paperwhite_if_it_says_your_kindle/


Tracking time spent reading on a kindle?

I discovered an answer to this in this quora thread:

The only way I've found to do this is to get the latest firmware for the Kindle Paperwhite and enroll yourself in "Kindle FreeTime". This is a program intended to restrict the content that children can read while tracking their progress. It provides reading time, books read, pages read, etc. Why this is hidden behind a feature that is 100% directed at children is unclear to me. But if you don't mind occasionally entering a parental control password (I just set mine to a single letter) and jumping through a few hoops, I'd checkout FreeTime.

I verified the solution, and wrote up a guide. Using Freetime, you can definitely track these metrics.


How to remove an article from kindle and Amazon cloud permanently

How do you add the articles to your device in the first place?

In my case, articles generally land up in my Kindle Paperwhite with the help of services like Amazon's own Send to Kindle or third party apps like Send to Kindle. Most of these services have a configurable option to send only to device but not to cloud.

If you use the former, just uncheck Save to Amazon Cloud Drive option at https://www.amazon.com/gp/sendtokindle/setup/. You may also want to choose which device should the content be sent to.


Formatting Table of Contents in epub using HTML TOC or Logical TOC and how to include TOCs in

The epub 3 toc.xhtml was created specifically to do away with the need to have separate logical and visual ToCs. Unfortunately, it's not quite there. As long as you're only interested in adding some styles to the text, though, you should be fine. Where you start to run into problems is if you want to have lots of other stuff going on in your ToC, like a number of images. Here's a quote from the relevant section of the epub 3 spec:

  The optional heading must be followed by a single ol ordered list; no
  other elements are permitted as direct children of the nav element.
  This ordered list represents the primary level of content navigation.

  Each list item ( li ) of the ordered list represents a primary
  heading, structure or other point of interest within the EPUB
  Publication and must contain either a child a element or a child span
  element. The a element describes the target within the Content
  Document that the link points to. The span element serves as a heading
  for breaking down lists into distinct groups (for example, a large
  list of illustrations can be segmented into several lists, one for
  each chapter).

So as long as all you're doing is enclosing parts of the list items in <span>s you'll be fine and won't need to create a separate visual ToC. If for some reason you do need to create a separate visual ToC, I would advise only including the visual one in the <spine>. The reading system will use as the logical ToC whichever file has properties="nav" declared in the <manifest>.

As far as using list=style-type: none; goes: technically, you shouldn't need it, but it doesn't hurt at all to include it, and some reading systems will include numbers if you don't use it. So yes, by all means include that statement. It will cause no problems with KindleGen.

Finally, the frustrating note: be sure that you also include an epub 2.0-style toc.ncx file. It's perfectly valid to do so in epub 3.0, and it's the only way that epub 2.0 reading systems will be able to make use of your table of contents. Yes, this means that if you have a visual ToC separate from the logical toc.xhtml, you're now up to three tables of contents in your file.


How do you remove a epub book margin for kobo?

Hi @Thomas a good program for converting pdf's to a reader is k2pdfopt it is it's purpose

it is available for all operating systems and free :)

see if you have better results with that. good luck


The answer to that can largely be broken down into two parts for EPUB2 and EPUB3.  First, for EPUB2 as it is currently the most common EPUB format: The most important thing to understand with regards to EPUB compatibility is that there are actually only a few readers available for commercial (i.e. DRM'd) EPUB content. As you might expect, Amazon and Apple made their own readers, but the vast majority of other commercially DRM'd readers are based off of Adobe's RMSDK, and as such they are mostly subject to similar limitations and quirks.  Now since there are literally hundreds of known and fixed issues with RMSDK, there is no possible way that I can list them all, but I can point you at the best publically available resource I know of, Datalogic's Release Notes.  These are issues that Datalogics finds and fixes itself with regards to RMSDK rendering bugs, and these issues are often then fixed by Adobe in future versions of RMSDK, so at any given time you have to be on the lookout for any of these issues with regards to whatever RMSDK renderer you are looking at (including for example any of the Bluefire Reader Branded Readers.) The last I knew, Kindle was still using RMSDK to render EPUBs, so this would apply to Kindle as well unless something has changed recently.

The second biggest place that I know of for rendering EPUBs is Apple's iBooks, and a quick google search will turn up copious numbers of frustrated authors trying to get their books rendering correctly, but unfortunately I don't have any kind of "current issues" source for them.  (If anyone else does, I would love to see it).  They do regularly improve their rendering engine as well, but their release notes tend to mention solely the user interface changes.

Then of course, the there is the issue of the EPUB3 Spec. This might be where I have the best news of all, which is that there is an on-going, regularly updated support grid put out by BISG that tracks which renderers support which features.  That extremely helpful document can be found here.


After I scanned(destructive) book: What are the steps to create a proper kindle ebook?

I've done work for pgdp.net, which is Project Gutenberg Distributed Proofreading. Here are the steps if you're not going through PGDP.

I'm assuming you scanned each page into a separate image. You might want to put all these images into a PDF file. You will probably have to cut  the pages out of the book so they lay perfectly flat on the scanner. A scan of a curved page is a huge source of OCR errors.
Use OCR to extract the text from the images and save book to a text file. Depending on the font, the smudges in the images, and other factors like straightness of lines of text, you might get 70-90% accuracy.
Proofread by hand every word.
Construct ebook in the format you want. I markup my text files with MultiMarkdown, and then I have a program which converts that to an EPUB. I just like MMD better than editing HTML.

Abbyy Finereader is one of the best OCR programs out there but pricey. Here is a site where you can OCR a few pages using their software, but there are limits.

If you have a PDF full of images (which is what much of the free books in Google Books is) try doing OCR at this site, again there may be limits to PDF file size you upload.

All in all, proofreading is a very time-consuming task.

EDIT: PGDP does not allow requests to digitize books. They have their own queue which they work on. However, Captcha is a way to crowd source digitizing books. They supposedly did many Google books, but I can't find that many there were actually edited. If you use Captcha to crowd source proofreading, it might cost you money. That depends if you use their service or if you are able to install the software yourself.

I found the Captcha concept to be fascinating, and the author/inventor even has a  TED talk.


Which platform is better Calibre or Kindle?

Calbre is free desktop software for managing digital libraries, and includes an ebook reader, ebook editor, conversion tools, and the ability to communicate with an ebook reader or other device over USB.

Kindle is Amazon's ebook/audiobook platform with desktop and mobile apps.

Both can be used for storing and reading ebooks, but usually they are used together (or Calibre with some other kind of ebook reader).

Library Management: Calibre
Ebook reading: Kindle (hardware or app)


What symbols/text to use for index references?

I have created an index for an nonfiction title before (a technical manual), and I think indices do serve a purpose -- and by the way, I created an author index too!

The key thing is making sure the links themselves are large enough that you can click each separate link and not get the wrong one. You should consider increasing the horizontal space between  entries. Separating things by commas also should help.

I don't think which character you use really matters -- though I prefer the symbols.  I have used as a label a name of a chapter or section or subsection.


Web service that sends html pages with code to kindle

Have you tried Push to Kindle from fivefilters? I tried a couple of webpages with java code on them and worked pretty good.


According the FAQs plain text files are compatible with some Nooks such as the Nook Tablet and Nook Color. On others such as the Nook Simple Touch you will need to convert the text file to an ePub file first using a tool like Calibre.


Are there libraries which lend ebooks to non residents?

I know this is an old question, but since no one else has answered it...

I did a quick Google search for "libraries for non-residents" and found a nice Wikipedia link that lists a number of libraries that you can access even as a non-resident.

The free sites that are mentioned are:

Digital Public Library of America
The Library of Congress
Open Library

Open Library is probably the closest thing to a real "library" of the three.  It actually has books--rather than allowing you to read manuscripts, etc.

The Wikipedia site also has a list of USA libraries that offer cards to non-residents, with each charging an annual fee.  The listed libraries are:

Brooklyn Public Library
Charlotte Mecklenburg County NC
Enoch Pratt Free Library, MD
Fairfax County, VA
The Free Library of Philadelphia, PA
New Orleans Public Library, LA
Orange County Library System, FL

All of the libraries in the last list use the Overdrive app, which you will have to download, but is a free app. I do almost all of my reading using the Overdrive app nowadays, and I love it.

If you do decide to pay for a library membership, make sure to look at the information on the wikipedia site, as it shows how many Overdrive titles are available at each library.  Please note that in my experience, certain genres are more likely than others to be part of a library's e-book catalog--frequently books I am interested in reading are not available or have a long waiting list.  Make sure to check out the options for putting yourself on a waiting list, or for requesting new books.  I have been really successful with both.

P.S.  I am sorry that I didn't include more links, but as a newbie to this stack exchange site, I don't have enough reputation.


How do I remove a book from my Sony Reader?

If you want to remove files from the PRS-T1 you can connect the reader via its USB cable to a computer and have the internal memory available as a USB drive. The TRS-1 shows itself as two USB devices, one named SETTINGS, the other READER.
The books are normally under READER/BOOKS.

You can just search for, and delete the books with your OS' file browser.

The device will rebuild the database of available books after disconnecting it from the computer.
Make sure to properly remove the device, do not just unplug it.


More than one chapter div in one epub file?

Kobo ereader devices have two different internal reading software.

Ebooks downloaded from the Kobo bookstore are a modified epub format with the particular extension .kepub.epub, while if you sideload a standard epub from your PC it retains its original extension (.epub).

By checking the extension of the files, the software automatically select the relative reading software (you don't normally notice many differences, they have some different internal features though).

I had the same issue with page break html code and experimented a bit, and it seems that the .kepub.epub engine (the one used with books from the Kobo store) doesn't support it, so I think that there is not much you can do about it.

A possible solution, like you have been suggested, could be to split the html file in multiple ones, exactly where you would have put the page break code. If you use Sigil or the Calibre internal editor you won't have to manually edit toc.ncx, contents.opf and all other files/references, because they will do automatically; it's an easy task, really.

Please note that books bought from the Kobo bookstore are stored inside the device database and not as individual files.


The M92 manual says:

Format Flash
Select Format Flash button in settings, you can format the
internal flash. Note, after doing this operation all of the data
in internal flash would be removed

From the internal flash memory, some should be reserved for databases containing the metadata of your ebooks and other content. Even empty databases take up some space.
2-3Gb out of 4Gb seems excessive for that, but only another Boox M92 user can really give you a comparable figure. As a comparison: My Cybook Odessey HD has 135Mb used from the 1.5Gb internal flash memory.
On the other hand I think you can expect such a device to complain if flash memory cannot be properly formatted.


list-style-type: none; does not convert from epub to mobi

At our shop we create a separate set of EPUB source files to convert to MOBI, and we perform a bunch of automated hacks on them before zipping and converting so the eventual MOBI file will be formatted correctly. In the case of list-style-type: none, our hack is to replace the li with a p and the ul with a div.


What are the differences between EPUB2 and EPUB3?

According to this page, EPUB3 adds, changes or improves:

Added HTML5 support
SVG documents can now appear in the spine in EPUB 3
Support for MathML
Semantic Inflection
Content switching has been simplified by having its processing model defined so that it does not require document preprocessing
Navigation
Linking
Scripting
Triggers
Bindings
Added modules from CSS3
EPUB 3 requires Reading Systems to support the OpenType and WOFF font formats for embedded fonts in conjunction with the CSS @font-face rules.
Audio and video
Media overlays
Publication Metadata and Identity
Resource Metadata
Text-to-speech
Manifest Fallbacks
Remote Resources
Whitespace in MIMETYPE file
Disallowed characters in OCF list has been extended

Things that have been removed:

DTBook
Out-of-Line XML Islands
Tours
Filesystem Container
Guide
NCX
2.0.1 meta element


With "automatic scaling", this setting is indeed meant. It would have been more clear if that post had used the actual names, otherwise you can search a long time through the various tabs:

  Preferences > Look & feel > Main interface (first tab) >
                Adjust for high resolution screens >
         set to off.

That you cannot change the value is most likely because you extended Calibre to a second screen to see the buttons (I guess that is the case as your image has a width > 2K). You probably also have font problems when moving the whole preference window to that screen.

To get a functional button, there leave Calibre on the first screen, use the scroll bar at the bottom until you can see "Automatic", and change it to "Off". Calibre will prompt to restart and come back with normal sized icons.


How to destructively scan well preserved books?

It depends on the amount of books: If you have more than several thousand you should get it done professionally, possibly you could also get a special deal on buying them already ocr'd and everything. Abort this guide here.

If you absolutely need true text ebooks where you can freely adjust font size and the like, scanning yourself is also not a good idea. OCR is too much of a manual process. But for most purposes, it should be ok to scan the pages as images. Try to buy the largest e-reader you can so the text doesn't end up too small. 7.8" should be good enough, but some books will appear a little small unless you can cut the pages up and rotate the screen so that the lines are parallel to the longer side of the screen. On computers and tablets and the like zoom functions work well enough that you should have no problems even on average phone screens.

So if you are still in, there are a few steps:

Separate book into individual pages.
Scan pages with scanner using adf automatic document feed.
Merge pages into a pdf per book.
Import into calibre e-book management (optional).
Cut the pages into two or three pieces in the whitespace between lines - this enables you to have bigger font sizes on ebook readers where the screen aspect ratio doesn't match the book aspect ratio. Other assorted image improvements.
Instead of cutting the pages into a few pieces, you can do OCR which enables to book to reflow exactly to the font and screen size of your choosing. This is optional and not recommended if the book is still in copyright and you are just doing this for yourself to read the book. Otherwise you should go help the people on Project Gutenberg and the like - they have processes to ensure the best possible quality.

Separate book into individual pages

If a books has a hard cover (that can't go through the scanner), cut it off with a paper knife. You need two cuts, one at the front and one at the back.

The next step depends on the amount of books:

Only a few: You can cut the pages apart with a paper knife.
More: You first separate the book into stacks that fit into a paper guillotine.

The sad truth is that for most books, you can just rip them apart. This doesn't apply to bound books where the pages are bound together with thread, but even hardcover books that might look like the have thread are often just glued. Open it as wide as possible, more than 180°, to pre-break the back. Then grip both halves at the top, firmly gripping both bundles so you don't pull on individual pages. Then slowly pull the halves apart. As long as you pull slowly, the glue tends to rip before the paper and even if sometime the paper tears a little, the tears very seldom reach into the printed text.
If you have a bound book, you need to unbind it, don't try to rip it apart. I haven't encountered enough of those to give many tips.
Then feed the bundles into a paper guillotine. If you have hundreds of books (or less if your time is valuable), get a paper guillotine with at least 5mm cutting depth, which will set you back around US$ 250. That way you can cut apart most books in less than 10 steps. If you have several thousand books (or less if your time is valuable), get a paper guillotine with at least 5cm cutting depth, which will set you back around US$ 1000. That way you can cut apart most books in one go (just remove hard covers first, those are usually not good for the blade).

Paper guillotine recommendation: Ideal 3005 (for up to hundreds of books) or a higher end one if it makes sense for you financially.

Scan

Make sure the title page or other distinctive page is the first page scanned. No harm in scanning such a page twice (once first, second time where it belongs). That way it will be easy to see where one book starts and another ends when you look at the sequence of scanned files.
Make sure the scanner puts all pages that you scan at once in a single pdf file - that way each book will only have a few files. That way it will be easy to see where one book starts and another ends when you look at the sequence of scanned files.
Choose the right color settings: Most scanners do a good job going from grayscale to black and white, so for normal black and white text, choose black and white. There have been informal studies that showed grayscale is not better for OCR than black and white and text display on e-readers is not improved by selecting grayscale, there is really no need for it. If there are color/grayscale images (or for the title pages, soft covers), you might want to choose color/grayscale for just those pages. If you scan grayscale/color the scans will be comparatively huge (as in, bigger than the movie version of the book). If the book is actually not that well preserved and the paper is not sufficiently white, you will need to scan it in color (and post process it to black and white if you want to read it on e-ink displays).
Always use the highest available resolution.
Don't mix up bundles of pages. I like to have stacks of separated books on one side of the scanner, and the pages of the currently scanned book that I already removed from the output tray on the other side.
When a books is finished, lay it on a floor or table with the cover up. Once you have it on your computer and made at least one backup copy (and only then), move the book into an appropriate (recyclable) waste bag or other container.
Use a scanner that doesn't need complex interaction to start a scan and which numbers its output files so you get them in the right order.

Scanner recommendation: Brother ADS 2800W, scan to USB stick, set up shortcut buttons for the scanning modes you need.

Merge pages into one pdf per book

My usual workflow is:

Go into preview/icon view mode in the file explorer, in the folder where the scans are.
You should be able to read the author and title from the previews.
Create a new folder (in another window) for each book named something like "author title", no need to be complete, this is going to be used as a search term later.
Copy the books files into the new folder.
Go into the folder where you have the nicely named book folders, and run the following script:

#!/bin/bash
set -x

mkdir -p out
for d in */; do
  if test "$d" = "out/"; then
      continue
  fi
  cd "$d"
  pdftk *.pdf cat output ../out/"$(basename "$d")".pdf &
  cd ..
done
echo -n "Waiting for pdftk..."
wait
echo " done."

Now you have an "out" folder with a pdf for each book, named like the folders you made.
Import the whole folder into calibre
Select the imported books, go to "edit metadata" and select "download metadata and covers".
Clean up the meta data and covers.
Back up your calibre database
Go through the physical books still lying around, verifying them in calibre (first few pages, last few pages, total amount of pages) and then throw them away.

Cut the pages into suitably sized pieces and other image conversions

I'm still working on that, but I have an automated script for denoising and compressing and also describe individual steps below.

Remove blank jpeg pages

Blank pages scanned in color (say the unprinted sides of soft covers for example) compress well, but still take some space and are also just annoying. Remove using pdftk input.pdf cat 1 3-r3 r1 output output.pdf (example removes second page and second to last page) or even a graphical pdf viewer using print to pdf.

Remove noise

For 600 dpi scans, -morphology Close Diamond:1 should remove noise and be pretty conservative about it, i.e. you don't risk removing too much. If you have a higher resolution, you can use Diamond:2 or higher, for a lower resolution possibly you can't use this method at all. As a second step, -define connected-components:area-threshold=30 -define connected-components:mean-color=true -connected-components 4 removes all blobs of black smaller than 30 pixels, which is also pretty safe if you set the amount of pixels to be less than the amount of pixels in a full stop (which is going to be the same for all scans at the same dpi, a value of 30 is good for 600dpi).

Compress using jbig2

The best compression algorithm for the purpose, achieves incredible compression ratios. Get encoder from Github, sadly you will need to compile it yourself.

It can handle files with noise and still achieves decent compression ratios, but then it takes forever. If you can remove some noise the output will be much smaller, more pleasant on the eye and generated in next to no time (compared to the denoising steps suggested above).

mkdir jbig2
cd jbigt2
../../jbig2enc/src/jbig2 -s -p ../input-image-folder/*.png
../../jbig2enc/pdf.py output > out.pdf

Script against noise and for compression

Available on github. Can take an hour per book, sorry. Use for example like this:

#!/bin/bash

for a in <list of author directories>; do
  for f in "${a%/}/"*/*.pdf; do
    sem -j 3 "nice -n 19 ../../incoming/compress.sh \"$f\" denoise"
  done
done

To use a parallelism of 3 and low scheduling priority of 19, so your computer remains responsive.


How do I change login info on my kindle?

You can change the same from the settings option of you device. Go to the settings and update the information.

http://www.dummies.com/how-to/content/how-to-manage-your-kindle-fire-hds-amazon-account.html

http://www.technipages.com/kindle-fire-how-to-change-stored-email-password

If you still face any issue, I would recommend to ask the Amazon customer care.


Can I only transfer files to my Kindle Paperwhite using the cable that shipped with the device?

Additionally, there are some USB cables that are with charge-only feature. They have less pins, usually a lot cheaper or come with devices that are not made for a pc-device storage connection. For example, a Chinese cable for 0.99$ or a cable that came with a portable charger (power bank). I've come across quite a few of these in my life, they will not work with your Android phone also, or your camera, or any other device that needs the data transfer pins.

[Edit] oh, and NO, the cable that goes with your Kindle is NOT the only one it can use, it's only the ability to transfer data with it that is required, as already stated by the other answerer :-)


Endnote formatting when using epub and kindlegen

When I put pagebreak elements between the footnotes, the two-footnotes-in-one problem on my paperwhite goes away.

The footnote section of my ch001.xhtml file (generated by Kindlegen) looks like this:

Here is the text of a footnote↩

Here is text of another footnote↩

and so on...


Calibre convertion: text goes out of the screen

I found the answer: the original .html file had table inside with fixed width, and that's why the text was running out of the screen. The solution: just use the option --linearize-tables !

ebook-convert 08-microprocesseur-son-environnement.html 08-microprocesseur-son-environnement.epub  --linearize-tables


Save your draft as a .docx file and convert it with Calibre to an epub.
(For best results make sure that each chapter title is formatted using a heading style, e.g., Heading 1.)