0

I have a few thousand files, mostly PDF, many postscript, that I need to convert to several other formats. I can't use calibre (don't get me started) - I have considered writing scripts to dump pages to image files and using dubious cli programs to compile the images to these formats, but thought I would ask here before reinventing the wheel. Hopefully someone has an elegant solution. Epub is just zipped html with a specific file layout, the others ( djvu, mobi ) seem a bit different.

  • Note that there are rather severe limitations on images (max size 64K) for mobi files. Without OCR it is going to be extremely difficult if your source PDFs consist of scanned images. Mobi is packed XHTML, similar to EPUB. DjVu are images with an option text layer. So you need probably need two conversion tracks: 1) SRC -> (optional OCR) text -> Epub/Mobi and 2) SRC -> images -> DjVu/Epub. For the latter see my answer here. – Anthon Aug 1 '16 at 6:14
  • 1
    What are you constraints? Could you expand your question to describe what you are working with? Perhaps the first, biggest, baddest file: (1) Do you have any alternate input source other than PDF or Postscript? (2) How big is it? (3) Does it have zero, one, or many images? (4) What output format do you need first? (5) What total output formats do you need? – StandardEyre Aug 1 '16 at 19:42
  • The biggest one is about 150MB. Many schematics ( images ) - about 1200 pages including index. Most of the files are standard PDFs with text, images and many have varying fonts. I need them converted to djvu, mobi, epub so I can have these formats available later. – user400344 Aug 1 '16 at 19:47
1

I've been converting PDF to other formats for over 3 years. I've converted at least 20 books.

A PDF file is not easily convertible, except for text paragraphs. I have a lot of experience extracting text from PDF. PDF is an endpoint, not meant for further processing or extracting of text. You will find you have a LOT of problems extracting images and tables. Images generally don't extract at all. Tables will be really messed up and converting to other formats will require a LOT of manual cleanup.

That said, if you want to extract the text I found this site to be better than others: http://online-convert.com. It supports many input and output formats. And I tried at least 5 other sites and 5 other OCR programs for the PC.

You will not get the accuracy you want from any program as far as I know. There might be better programs, like Abbyy Finereader but they are not free and there is no such thing as perfect conversion from PDF to anything else, especially for images and tabular data.

Books of fiction are easy to extract the text from because they are just wrapped paragraphs with few or no images and no tabular data. So to test your conversion, find a more challenging book with tabular data and images and see how it goes.

Some PDF books have the text inside them and extract fairly well. Some PDF files are just a bunch of images, one scanned page per image. For these you need OCR.

Also, there is no OCR that is 100% accurate. You might get 90-95% accuracy. But we don't know which letters or words are inaccurate, so that means we have to check every word in the output. This takes a lot of time.

0

For highly structured pages with many pictures, IMHO, is the only usable format DjVu. So, use the DjvuLibre application library.

To move it you can use scripts in python-djvulibre. I think there are instructions in English. But surely there are Slavic instructions (Instruction in Czech 1, Instruction in Czech 2). If the community wanted to, I could translate the tutorial (PDF/TIFF/JPG -> DjVu) into English or automate the process with a script. (Some parts would need machine learning algorithms. For a full automated process.)

For pure text, use the method for creating EPUB format, which have already been referenced.

If you are not commercial, you can not use mobi format when you already have epub. Epub is IMHO a better format than mobi format. For electronic book readers, update your firmware and then you can read epub format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.