Как конвертировать файл ePub в формат PDF на Linux CLI
Вы ищете способ преобразования файла формата EPUB в файл PDF с помощью интерфейса командной строки Linux?
Epub формат файла
EPUB — это формат файла электронной книги, в котором используется расширение «.epub».
Несмотря на то, что формат ePub поддерживается большинством электронных книг, устанавливаемых на Windows, смартфонах, планшетах и т. Д., У вас все равно может возникнуть необходимость конвертировать EPUB в формат PDF, который обычно используется.
В этом руководстве я покажу вам самый простой и безопасный способ преобразования файлов ePub в PDF.
Это возможно с помощью Caliber.
Это программное обеспечение предварительно не установлено в большинстве дистрибутивов Linux, но его можно легко установить с помощью диспетчера пакетов ОС.
Установите Calibre в Debian / Ubuntu
Для семейства Linux Ubuntu / Debian установите Caliber, выполнив следующую команду:
Установка Calibre предоставляет команду ebook-convert, которую мы будем использовать для фактического преобразования.
Установите Calibre на Arch Linux / Manjaro
Пакет Calibre доступен в исходном репозитории Arch Linux.
Установите его, запустив:
Установите Calibre на CentOS / Fedora
Caliber имеет бинарную установку, которая включает в себя закрытые версии всех его зависимостей.
Выполните команду ниже в вашем терминале, чтобы установить Caliber на CentOS / Fedora.
Если не wget установлен, сначала установите его:
Как конвертировать файл ePub в формат PDF на Linux CLI
Теперь, когда вы установили Calibre, вы можете начать процесс конвертации.
Измените свой текущий рабочий каталог на файл EPUB контейнера контейнера.
Преобразуйте файл ePub в PDF с помощью команды:
Смотрите пример ниже:
Подтвердите тип файла.
Попробуйте открыть свой PDF-файл и посмотрите, можно ли его прочитать.
Если вывод не является привлекательным, попробуйте:
converting epub files to PDF format
I would like to know the ways in which epub files can be converted to pdf in ubuntu. Any method, GUI or command line conversion is fine as far as my epub gets converted to pdf. Thanks.
6 Answers 6
You definitely want Calibre. You can use it to convert virtually any file type to any other file type, as long as the source file doesn’t have DRM (like Amazon, Adobe, etc.). If it does have DRM, check out Apprentice Alf’s blog for help stripping it out with Calibre plugins. Don’t use the DRM stripper to pirate books or otherwise violate your agreement with the vendor. Use it so you can enjoy your books on any device in any format.
Calibre is also an awesome e-book management program that can do virtually everything. It can manage Kindles, Android phones/tablets, etc. It can even email your books with one click to your Kindle’s email address if you want. You won’t be disappointed 🙂
sudo apt-get install calibre
Or search for it in Ubuntu Software Center
To actually convert the EPUB file you can use the following command:
ebook-convert file.epub file.pdf (For details, check this other answer)
Or you can check the details for the conversion dialog using the Calibre GUI.
- Install Calibre from the Ubuntu Software Center.
- Open Calibre and click on the Add books icon in the Calibre menu. A file selection window will open up.
- Browse to the epub file(s) that you want to add, and select one or more epub files to add to Calibre.
- Select one or more epub files from the Calibre library in the center pane. Or type formats:»=EPUB» in the search box to search for only EPUB format files and select one or more epub files from the filtered library list in the center pane. Click on the Convert books icon in the Calibre menu.
- A new Convert window will open up. In the Convert Window for the Input format select EPUB. For the Output format select PDF. Click the OK button to start converting the file(s).
- To find your PDF files, click on a file that you converted to PDF. In the pane on the right-hand side of Calibre you will see an entry called Path: Click to open. Click on the link for «Click to open» to open a new file browser window at the directory of the PDF file.
Before trying calibre, I actually converted my file using the above program, a command line epub to pdf converter that is actually good with some handy options.
Usage:
1) unzip the file into a convenient location, and change to the unzipped folder in terminal
2) make the .sh file executable
The default output directory is home folder, but a lot of customization is available through a properties file where it can be changed.
Though the program hasn’t been updated for a while, it works really good and I thought it might be an option for people to try out for converting their epub to pdf.
if the additon of —toc and —chapters does not produce the desired results, leave these out. Sometimes the pictures inside the epub are invalid to be used with latex so you need to convert them in the process :
Here’s a workaround. Check to see if a tex file can be produced:
Extract images and other media contained in the epub container to the path DIR, creating it if necessary, and adjust the images references in the [LaTeX] document so they point to the extracted files, with the option —extract-media= DIR . Select the current directory which also contains the ePub file. Add —extract-media= . which means extract in the current directory, which is also $HOME/Documents
Repeal the extracted .jpg images by creating new LaTeX compatible JPEG images with the `convert’ utility (from the imagemagick program suite)
and Replace the previously with pandoc extracted .jpg images with the newly created .jpeg images:
One can do this with a single for loop on the commandline:
Run the first command line again, but this time have the LuaTeX engine seek for its \includegraphics in the same directory as where the ePub images were extracted earlier ( —data-dir=DIRECTORY Specify the user data directory to search for pandoc data files. If this option is not specified, the default user data directory will be used. This is, in Unix: $HOME/.pandoc ) by adding the option —data-dir=. :
How to Convert ePub file to PDF Format on Linux CLI
Are you looking for a way to convert an EPUB format file to a PDF file on the Linux command line interface?. EPUB is an e-book file format that uses the “.epub” file extension. Even though the ePub format is supported by most E-Readers installable on Windows, Smartphones, Tablets, e.t.c., you could still have a need to convert EPUB to PDF format which is commonly used.
The conversion process of PDF has become very easy, and you can find many Convert PDF to word tools. These tools are very useful, efficient, and reliable to use. Such tools instantly perform the conversion process within seconds.
In this guide, I’ll show you the easiest and safest way of converting ePub files to PDF. This is possible with the help of Calibre. This software is not pre-installed on most Linux distributions but it can be easily installed using the OS package manager.
Install Calibre on Debian / Ubuntu
For Ubuntu / Debian family of Linux, install Calibre by running the command below:
Installation of Calibre provides ebook-convert command which we’ll use for the actual conversion.
Install Calibre on Arch Linux / Manjaro
The Calibre package is available on Arch Linux upstream repository. Install it by running:
Install Calibre on CentOS / Fedora
Calibre has a binary install that includes private versions of all its dependencies. Execute command below in your terminal to install Calibre on CentOS / Fedora.
This requires wget. If not installed, first install it:
How to Convert ePub file to PDF Format on Linux CLI
Now that you have installed Calibre, you can start the conversion process. Change your current working directory to folder container EPUB file.
The convert the ePub file to PDF using the command:
Try to open your PDF and see if readable. If the output is not appealing, then try:
You can also do the conversion from the Calibre GUI.
Linux Mint Forums
Welcome to the Linux Mint forums!
Epub to PDF [SOLVED]
Epub to PDF [SOLVED]
Post by Nightchild27 » Sat Sep 10, 2011 4:12 pm
I have been trying all day to convert a .epub file to a .pdf file with no such luck. I really would like to place this ebook on my kindle. I downloaded calibre but it doesn’t seem to be working for me.
It tells me that the .epub file has an invalid LRF reader. which makes no sense to me. I’m completely lost.
Any suggestions or advice would be wonderful.
Re: Epub to PDF
Post by DrHu » Sat Sep 10, 2011 4:20 pm
Some data might help, which software you are using ?
http://wiki.mobileread.com/wiki/E-book_ . FreeBSD.29
- Linux (Also potentially Solaris or FreeBSD)
This listing includes both commercial and free tools as there are not very many commercial tools available.
LRF issues..
http://manual.calibre-ebook.com/faq.htm . conversion
http://www.teleread.com/drm/the-abcs-of . ibre-tips/
- Check which formats are being supported, which epub readers you are using
Re: Epub to PDF
Post by Nightchild27 » Sat Sep 10, 2011 5:04 pm
Im sorry. im just as lost as i was before.
what do you mean what system am i using?
Re: Epub to PDF
Post by ThistleWeb » Sat Sep 10, 2011 5:11 pm
Re: Epub to PDF
Post by Nightchild27 » Sat Sep 10, 2011 5:42 pm
Thank you for dumbing it down for me lol. Ok that makes sense. I have installed Calibre because I did read somewhere that, that was best for kindle and I can poke around under the hood a bit. Once I read this I realized. maybe instead of installing from the software manager..I should download it off line and thankfully I know how to use the terminal. Turns out the one I downloaded first is for LRF only. So, second download from the site and converted the epub to mobi. Now the book is on my kindle.