View Single Post
Old 08-26-2023, 06:29 PM   #587
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: 7,121
Karma: 92500001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by willemml View Post
Good to know that pages are type 2 entries, I had vaguely determined this already from the JSON output of this plugin, but was not sure. Do you know what all the content types are? I have so far only come across content type 2, but I guess that is because currently all the files I am examining are from print replica books created from PDF files.
Type 1 is text, type 2 is an image. For a print replica KFX there is a single image associated with each PDF page. There may also be type 1 entries if the source PDF had a text layer that was included in the KFX version of the book.

Quote:
Originally Posted by willemml View Post
If I were to extract the PDF from the KFX files I am generating I assume that would save me from dealing with trimming the PDFs for correct alignment?
As far as I can tell the included PDF is essentially the same as the original PDF, at least in terms of its page dimensions. The four margins for cropping are instead expressed as KFX metadata associated with each PDF page image resource.

That cropping data is currently not handled by the KFX Input plugin. Something will need to be done about that.

Quote:
Originally Posted by willemml View Post
And is there a point I can align the SVG to (say top left or right or similar) of the PDF with an offset to account for aspect ratio change?
Each XHTML page of the EPUB converted from the annotation notebook has an embedded SVG image that references the external SVG image containing the stroke data. If the aspect ratio of the annotation does not match the PDF then the style associated with the embedded SVG will have the height, width, top, and left properties needed to adjust it to match the associated PDF page aspect ratio.

Quote:
Originally Posted by willemml View Post
In the mean time I am trying to write a program that can convert from PDFs to write-on-able KFX files without going through the Kindle Create software (which for now means I am trying to create my own KPF files from scratch that contain the metadata to correctly map PDF pages) so that I can put them through the KFX Output plugin (which I realize still relies on Kindle Previewer for conversion, but I eventually want to write my own KPF to KFX converter as well.) I will be publishing all code on GitHub as soon as I have something that works a little bit.
I am curious to see what you come up with.

Quote:
Originally Posted by willemml View Post
Is there any documentation outside of this thread and the code of the KFX plugins you have (which is the closest I could find to documentation on the KFX and KPF formats other than a rough overview) that could help me?
I do not know of any existing documentation other than that provided by Amazon for the underlying Ion data format.
jhowell is offline   Reply With Quote