Wednesday, September 16, 2020

Single click conversion form any format to multiple format (EPUB, PDF, TXT, RTF...) using Calibre - with batch multiple files conversion

Many years ago I developed a script to convert ebooks in different format, using the command-line tool provided by Calibre

You can find the old version of my script ad the following link: 

v1: Single click conversion form any format to EPUB, using Calibre

v2: Single click conversion form any format to EPUB using Calibre v2.0 - now with batch multiple files conversion, and rename instead than overwrite

v3: Single click conversion form any format to MOBI using Calibre

And today, we have the version 4.

Click here to download the version 4 of the conversion script.

This updated version of the script is useful when you need to convert ebooks from any Calibre-supported formats, to multiple destination formats at once.

For example, you may have 3 ebooks: "mybook1.pfd  /  otherbook.epub  /  lastbook.mobi"  and you want to convert those 3 ebooks to 4 different formats: PDF, DOCX, MOBI, TXT.
You can do this with my script.

This script is configured to convert to all Calibre supported output format, you just need to enable the section of the format you need.
Keep in mind that if you enable all the supported formats, the script will be a bit slow.

You need to place this script in the same folder where you have the Calibre executable.

Then you can drag and drop the file you want to convert on the script:


The supported  output  format are:

  • AZW3
  • DOCX
  • EPUB
  • FB2
  • HTMLZ
  • LIT
  • LRF
  • MOBI
  • OEB
  • PDB
  • PDF
  • RB
  • RTF
  • SNB
  • TCR
  • TXT
  • TXTZ


The script will not convert a file to the same format of the source file.
So, if you configure the script to convert to PDF and DOCX, and you drab a PDF file on the script, you will only get a converted DOCX file. Reconverting a PDF to PDF it's not useful.

How to configure the script

By default the script will convert to 3 formats: EPUB / PDF / DOCX
You can enable/disable the various format by commenting/decommenting the section of the script.
The relevant part that you may comment/decomment are at the end of the sctript.
The final  part of the script,looks like that:

Each block of 4 lines manage a single extension:

 
So, you can comment out a block by adding REM at the start of the lines.
So, you can uncomment (activate) out a block by removing REM at the start of the lines.

For example, let say that:

  1. you don't need to convert do DOCX.
  2. you want to convert to EPUB, PDF, MOBI

so, you should comment the DOCX block, and uncomment the MOBI block, so your script will looks like that:



Bye,
Max