![]() |
#1 |
Member
![]() Posts: 20
Karma: 10
Join Date: Nov 2012
Location: Bellow the Sky
Device: Laptop
|
pdf to epub
i am trying to convert pdf to epub file using calibre
first i tried calibre gui which is taking hours but cannot convert that pdf to epub then i use python script with calibre ebook-convert.exe and that is converting pdf to epub but missing a lot of setting i am sharing you screenshot of pdf text and converted epub same area. check attached files (First image is original PDF and second image is converted epub and see text and diagram is broken in epub) here is my script code import subprocess import os # Path to your input PDF pdf_path = r"C:\Users\samsam\Downloads\Analysis of Fork.pdf" # <-- Change 'mybook.pdf' to your actual file name # Output EPUB path (same folder) epub_path = os.path.splitext(pdf_path)[0] + ".epub" # Full path to ebook-convert.exe calibre_convert_exe = r"C:\Program Files\Calibre2\ebook-convert.exe" # Command to run conversion command = [ calibre_convert_exe, pdf_path, epub_path, "--disable-font-rescaling", "--no-default-epub-cover", "--preserve-cover-aspect-ratio" ] try: subprocess.run(command, check=True) print(f"✅ EPUB created: {epub_path}") except subprocess.CalledProcessError as e: print("❌ Conversion failed:", e) Last edited by lonly; 06-26-2025 at 03:56 PM. |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Did you read this stickey (at the top of conversion)?
https://www.mobileread.com/forums/sh...d.php?t=118605 PDF is a page paste up format. The pieces can be in any order. Convert only handle the simplest Top -> Bottom text decently. Toss in images or ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Looks like a professionally created PDF, I suggest you open the PDF in Word (or Acrobat) and save as DOCX, and then have calibre convert the DOCX to EPUB.
This is an instance of a two step conversion being better than one step. BR |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convert a pdf to epub for edit back to pdf increased page numbers. | Construct | Conversion | 4 | 07-18-2023 12:56 PM |
ePub->pdf conversion doesn't allow to add watermark with third-party pdf editor | EbokJunkie | Conversion | 8 | 04-16-2023 08:38 PM |
When i add a pdf in caliber and open it with E-book viewer the pdf turns into a epub. | sourov | Library Management | 1 | 08-23-2021 05:05 AM |
EPUB to PDF Failure (Error msg & pdf attached) | Iamgoodlol | Conversion | 2 | 05-27-2017 05:22 AM |