![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 262
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
|
Sharing your scripts for converting files
Hi,
I have found a few threads with parts of script in different languages, but not one regrouping complete scripts (maybe I'm wrong). I'd be happy to see what some of you have come up with. Here are mine: pdf to Epub (ms-Dos on winXP) Code:
setlocal enableextensions enabledelayedexpansion for /R "D:\_D\_01avril2013\ebooks\husserl" %%G IN (*.pdf) DO ( echo "%%~nG" if not exist "%%G.epub" "D:\PortableApps\Calibre Portable\Calibre\ebook-convert.exe" "%%G" "%%G.epub" --authors "Husserl" --title "%%~nG" --no-default-epub-cover --language "fr" --enable-heuristics -v ) endlocal
Doc to epub (ms-dos, libreoffice, xp) Actually, the epub plugin of libreoffice works a lot better than this script (although if your doc file has drawings - not picture, drawings - it gets stuck) But the plugin needs opening each file one at a time (I think) This second example is a conversion in two steps:
Code:
REM chcp 1252 setlocal enableextensions enabledelayedexpansion for /R "D:\_organised\_etexts\_philosophy\docs" %%G IN (*.doc) DO ( if not exist "%%~nG.rtf" "D:\PortableApps\LibreOfficePortable\App\libreoffice\program\soffice.exe" --headless --convert-to rtf --outdir "D:\_organised\_etexts\_philosophy\docs" "%%G" ) for /R "D:\_organised\_etexts\_philosophy\docs" %%G IN (*.rtf) DO ( if not exist "D:\_organised\_etexts\_philosophy\docs\%%~nG2.epub" "D:\PortableApps\Calibre Portable\Calibre\ebook-convert.exe" "%%G" "D:\_organised\_etexts\_philosophy\docs\%%~nG2.epub" --authors "Fxp33" --title "Philo : %%~nG" --no-default-epub-cover --no-svg-cover --language "fr" -v ) endlocal
I know there are lots of ways for python and perl to play along directly with Calibre. I hope someone will share their tips. Perl, xp (accented filenames) All the filenames are jammed for me. And I also had problem sending mutliple arguments from console to perl (and between perl programmes) The only solution I found was:
Hope this helps François |
![]() |
![]() |
![]() |
#2 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 262
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
|
Linux bash (raspberry Pi)
I'm not a specialist of bash. My experiment needs enhancement. Code:
#!/bin/bash # https://www.mobileread.com/forums/showpost.php?p=2098144&postcount=254 cd /media/xxx/Kobo/philo_pdf for file in *.pdf; do #title=`cat ../../title/$file` #title=`$file` echo "" echo " Title is $file" echo "" oldfile=$file newfile="$file.epub" echo " Converting: $file " echo "" echo "started: $(date)" echo "" echo $newfile [ ! -f "$newfile" ] && /usr/bin/ebook-convert "$file" "$file.epub" --no-default-epub-cover --no-svg-cover --insert-metadata --authors "pdfConvert" --title "$file" || echo "$newfile already exists" done François |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Arc Sharing files to Mac | KobosAreGreat1 | Kobo Tablets | 2 | 03-22-2013 02:37 AM |
converting pdf screenplays / scripts for movies into ePUB format | alanjay | Calibre | 15 | 10-07-2011 07:49 AM |
Mac user needs help converting pdf's (TV Scripts) and keeping format!! | mcforman | Kindle Developer's Corner | 12 | 06-20-2011 05:28 PM |
Hello Need help converting files | badapple | Introduce Yourself | 1 | 07-20-2007 11:57 PM |