下載一本azw3格式的電子書,經過郵箱推送到kindle時,郵件會被退信,提示不支持的格式,所以須要將azw格式轉爲mobi格式。html
在kindle伴侶網上看到轉換方法linux
Calibre 下載:http://kindlefere.com/tools#calibre
Kindlegen 下載:http://kindlefere.com/tools#KindleGenpost
一、安裝並打開 Calibre,將 azw3 格式的電子書拖進 Calibre;
二、右鍵點擊它,依次展開菜單「轉換書籍」 -> 「逐個轉換」(多本也可選擇「批量轉換」);
三、在彈出的窗口中將「輸出格式」選擇爲「EPUB」,點擊肯定開始轉換;
四、轉換完成後,再次右鍵點擊這本書,點擊菜單中的「打開所在目錄」獲得 epub 格式電子書;
五、將此 epub 格式電子書複製到桌面上備用。ui
* 若是電子書原本就是 epub 格式可略過這一步。把電子書放到桌面上是爲了方便演示,若是願意您能夠將它放到任何位置。spa
一、將下載的 KindleGen 壓縮包解壓,獲得 kindlegen.exe 並放置到桌面上;
二、打開「命令提示符」(Mac OS X 系統打開「終端」),輸入下面的命令將目錄定位到桌面:code
cd desktop
htm
三、輸入下面的命令將 epub 格式電子書轉換成 mobi 格式:文檔
Windows 系統請輸入:kindlegen.exe "bookname.epub"
get
Mac OS X 系統請輸入:/users/你的用戶名/desktop/kindlegen "bookname.epub"
* 注意爲避免文件名中的字符致使錯誤,文件名如 bookname.epub 最好用英文雙引號包裹。it
* Windows 系統用戶也能夠將電子書直接拖放到 kindlegen.exe 文件上實現轉換。
四、獲得最終的 mobi 格式電子書,能夠推送或拷貝到 Kindle 中閱讀。
--------------------------------------------------------------------------------------------------------
在經過kindlegen將epub轉換爲mobi時,系統會提示錯誤
```
Warning(prcgen):W14001: Hyperlink not resolved: /home/xxx/Downloads/kindlegen_linux_2.6_i386_v2_9/jingjin_FILES/text/part0000.html#0-c6789ac79b5c427b831de25d238bf6fa
Warning(prcgen):W14001: Hyperlink not resolved: /home/xxx/Downloads/kindlegen_linux_2.6_i386_v2_9/jingjin_FILES/text/part0001.html#UGI0-c6789ac79b5c427b831de25d238bf6fa
Warning(prcgen):W14002: Some hyperlinks could not be resolved.
Info(prcgen):I1008: Resolving start reading location
Info(prcgen):I1049: Building table of content URL: /home/xxx/Downloads/kindlegen_linux_2.6_i386_v2_9/jingjin_FILES/toc.ncx
Error(prcgen):E24010: Hyperlink not resolved in toc (One possible reason can be that the link points to a tag with style display:none):/home/xxx/Downloads/kindlegen_linux_2.6_i386_v2_9/jingjin_FILES/text/part0000.html#0-c6789ac79b5c427b831de25d238bf6fa
````
將epub文件解壓後,文檔連接所指向的id時存在的,只是id值0-c6789ac79b5c427b831de25d238bf6fa值對應的tag是part0000.html的<body>,須要將body修改成div標籤kindlegen才認識,同時額外在外層補一個<body>.
再次經過
`kindlegen 解壓epub文件目錄/conten.opf -o xxx.mobi`
便可成功生成mobi文件,這個文件比直接使用Calibre轉換獲得的文件大一點