Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 11-12-2023, 09:52 PM   #1
jackm8
Zealot
jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!
 
Posts: 141
Karma: 100000
Join Date: Nov 2015
Device: none
Fixed page KPS to KFX or blank PDF to KFX conversion?

I'm trying to circumvent horrible Scribe pdf rendering engine by just embedding .pdf files into .kfx to use it's slightly less horrible rendering engine. I'm wondering what's the purest way to achieve that, with as little processing as possible done to files.

Kindle's Send to Kindle does it's job well, omitting covers and thumbnails, but it's online, going through Amazon, so I'm looking at different options. Using Calibre and it's PDF input and KFX's output plugin, gives me readable KFX files that have large margins, that I assume from long files, went to from pdf to epub and then to KFX. I can't find a way to change anything in input or output options.
I assume the solution is going the route of Command Line Interface (CLI) of KFX Output plugin as documented in https://www.mobileread.com/forums/sh...d.php?t=272407, but for the life of me I can't get that to work. Any help would be appreciated.



I figured all my problems. I'm sure this all will sound obvious to most people here, but I did crash my head against this problem for a whole day now, so it may possible help someone in the future:


PDF to KFX

Using Kindle Create, Calibre, and Command Line Interface (CLI) of KFX Output Plugin

First make sure all programs are installed properly.
Kindle Create: (Used to create KFS out of PDF)
https://www.amazon.com/Kindle-Create/b?node=18292298011
Kindle Preview: (Needed by KFX Output Plugin)
https://www.amazon.com/Kindle-Previe...de=21381691011
Calibre: (Calibre Portable may not work)
https://calibre-ebook.com/download
KFX Output Plugin: (It can be installed from within Calibre, Preferences: Plugins: Get New Plugins: KFX Output: Install)
https://www.mobileread.com/forums/sh...d.php?t=272407 (Best to read all thread, especially Command Line Interface (CLI) section of that thread)

Optional test:
Quote:
Open command prompt or windows power shell in windows to test if Calibre and KFX Output Plugin are properly installed. (Right click on Windows start button: Windows PowerShell: type in: 'calibre-debug' without ' and press enter
If you get this message Calibre is installed properly:
Quote:
Module readline not available.
Welcome to the interactive calibre shell!
Use exit to quit
>>>"
Type 'exit' to go back to normal command prompt.
Now to test KFX Output plugin type this in command prompt:
Type 'calibre-debug -r "KFX Output"' without ' but with "

If you get following message it's installed properly:
Quote:
Software versions: KFX Output 2.3.1, calibre 6.29, Windows-10-10.0.19045-SP0
KFX Output plugin help is available at https://www.mobileread.com/forums/sh...d.php?t=272407

usage: calibre-debug -r "KFX Output" -- [-h] [-a ASIN] [-c] [-d] [-p PAGES] [-q] [-t] [-l] infile [outfile]
calibre-debug -r "KFX Output" --: error: the following arguments are required: infile
— Create KFS file out of PDF using Kindle Create:
Open Kindle Create. file: new project; select Print Replica; upload your own .PDF file; after Kinde Create does it thing click Export button in top right corner of the program. Save KFS file that it creates to a folder.
— Convert KFS to KFX using Calibre
Open command prompt in the folder where KFS file is located. (one way to do this: https://www.lifewire.com/open-comman...folder-5185505)

Type: 'calibre-debug -r "KFX Output" -- "NAMEOFYOURFILE.kpf" "NAMEOFYOURFILE.kfx" -d' without ' into the command prompt with NAMEOFYOURFILE replaced by the name of your KFS file.

Quote:
Examples:
calibre-debug -r "KFX Output" -- test.kpf test.kfx -d
calibre-debug -r "KFX Output" -- random_test.kpf random_test_output.kfx -d
calibre-debug -r "KFX Output" -- "Ed Greenwood - Volo's Guide to Baldur's Gate (AD&D Forgotten Realms)-Wizards of the Coast (2000).kpf" "Ed Greenwood - Volo's Guide to Baldur's Gate (AD&D Forgotten Realms)-Wizards of the Coast (2000).kfx" -d
It will create KFX file next to your KPF file. You should get message "Successfully converted to KFX" at the end of the process.
  • " " must be used for names of files with space in it, otherwise it's not needed.
  • Copy paste works in the command prompt, and is useful with long names of files.
  • -d command prompt is used to generate Create personal document (PDOC) instead of book (EBOK). Without -d, thumbnails will not display in reader. I'm not certain if there are any drawbacks of using it instead of creating (EBOK) files regarding this use.

Now you can sideload that KFX file to your Kindle. It will show first image in the document as cover when device is turned off, and it will show a thumbnail in library view.

Last edited by jackm8; 11-13-2023 at 10:53 AM.
jackm8 is offline   Reply With Quote
Old 11-13-2023, 08:09 AM   #2
jackm8
Zealot
jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!
 
Posts: 141
Karma: 100000
Join Date: Nov 2015
Device: none
So I've figured how to get the command line to work moments after creating this thread.

I was running commands on Calibre Portable installation, and getting no "KFX Output" plugin found error. Running them on installed Calibre version fixed that.

Generated .KFX files open on Kindle, are formatted properly, and even have cover and thumbnail when -d command is used. As far as I know this is now the best best possible way to display PDF files on Kindle Scribe.

Now I'm just wondering what happens to quality during conversion.
File sizes from .KFS to .KFX roughly halve when using Comics option in Kindle Create to pack images. While if I pack the same images into PDF before, and I then use Print Replica option in Kindle Create, they end up being roughly the same size.
jackm8 is offline   Reply With Quote
Advert
Old 11-13-2023, 10:07 AM   #3
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,570
Karma: 84812983
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by jackm8 View Post
Now I'm just wondering what happens to quality during conversion.
File sizes from .KFS to .KFX roughly halve when using Comics option in Kindle Create to pack images. While if I pack the same images into PDF before, and I then use Print Replica option in Kindle Create, they end up being roughly the same size.
In Comic format each page of the original PDF is rendered as a JPEG image at 300 pixels per inch and those images make up the bulk of the resulting KFX file. This will render much more quickly on a Kindle device but will not support annotation, dictionary lookup, or hyperlinks.

Print Replica format includes the original PDF along with metadata. Kindles render page images from the embedded PDF, making it slower, but handle text and hyperlinks using the associated metadata. Annotation by drawing on pages is supported on Scribes in this format.
jhowell is offline   Reply With Quote
Old 11-13-2023, 12:36 PM   #4
jackm8
Zealot
jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!jackm8 rocks like Gibraltar!
 
Posts: 141
Karma: 100000
Join Date: Nov 2015
Device: none
I see, thank you for explaining things, even more for making KFX plugins, I can't imagine living in Amazon's ecosystem without them.

I was looking at file sizes and came to wrong conclusions. As far as I know plugin doesn't compress anything when used with CLI, it just takes whatever .KFS has, and packages it into .KFX. It's Kindle Create that does things differently as it creates .KFS files depending on which tool it uses, but again I don't think that it does anything at all to files themselves.

Test:
Quote:
7 jpeg photos, around 20mp each, 100% compression rate, 56mb combined file total size. (I went overboard intentionally to better see any compressions)

7 jpegs converted into pdf via pdf24 program = jpegtopdf.pdf, 58mb file size
jpegtopdf.pdf to kpfreplica.kpf via Kindle Create print replica = kpfreplica.kpf, 58mb file size
kpfreplica.kpf to kpfreplica via KFX output = kpfrepica.kfx, 59mb file size

7jpegs to kpfcomic.kpf via Kindle Create comics = kpfcomic.kpf, 116mb file size (!) (no extra work done in editor)
kpfcomic.kpf to kpfcomic.kpx via KPX ouptut = kpfcomic.kfx, 58mb
Kindle Create via comics bloats the file, but it's then debloated by KFX output. As far as quality of end files is concerned, they are all the same. And I'm certain that they are the same as original files. There is quite a bit of difference in how they are displayed in Kindle later. kpfcomic.kfx is displayed by Kindle's Comic viewer, kpfreplica.kfx by it's KFX documents (?) viewer, and jpegtopdf.pdf by it's pdf viewer. Each behaves differently.
  • Pdf; progress percentage at the bottom, thin white borders, no covers, no thumbnails, slowest page turns
  • KFX document; no progress, no white borders, covers, thumbnails, contrast options in page layout
  • KFX comics; layout page does not have contrast options, but gets animation, crop margins, page refresh, virtual panel, preview double page, (no testing done on how if any work,), dark mode doesn't invert colours, fastest page turns.
jackm8 is offline   Reply With Quote
Old 04-08-2024, 06:19 AM   #5
BasJack
Junior Member
BasJack began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2024
Device: Kindle Scribe
Hi, sorry for the necro but I was using this process to put pdf on Kindle Scribe, problem is that, I think, during the kfx conversion I lose all indexing and the pdf comes out for all intent and purposes as a image pdf, can’t use search in the kindle. Also while using the calibre debug it gives a warning that I don’t understand to every line.

Also while using kindle create you have to let the pdf “simmer” until the program asks you if you want to preserve links and indexes.
BasJack is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with conversion to Kindle KFX in Linux! itssudipok Conversion 1 07-10-2022 07:49 AM
Calibre adding blank pages before and after KFX conversion morty92222 Conversion 16 05-21-2021 11:04 AM
PDF to KFX conversion error pkv96 Conversion 2 07-14-2020 10:52 AM
Epub to KFX conversion issue Surreal Introduce Yourself 0 10-18-2019 02:15 PM
KFX to KFX to remove DRM Tomifonication Conversion 12 08-09-2018 01:32 PM


All times are GMT -4. The time now is 09:53 AM.


MobileRead.com is a privately owned, operated and funded community.