# What changed between before.pdf and after.pdf Book: Lewis Carroll, *Alice's Adventures in Wonderland* (12 chapters), assembled by `make_sample.py` into `manuscript.docx`, then built wrong on purpose the way authors do: US Letter pages, narrow side margins (0.3 in), one picture shown too large for its pixels. `before.pdf` is that Word file exported to PDF (LibreOffice). `after.pdf` is `kdpfix manuscript.docx --trim 6x9 --shrink-low-res-images`. Both were checked with `kdpcheck --trim 6x9` (the size the author chose in KDP). Scores: before **73/100** (8 of 11 rules passed; failed K01, K03, K07); after **100/100** (11 of 11; failed none). | Setting | Before | After | |---|---|---| | Page size (K01) | 8.5 x 11 in (= 8.5" x 11") [fail] | 6 x 9 in (= 6" x 9") [pass] | | Page count (K02) | 54 pages [pass] | 88 pages [pass] | | Inside margin (K03) | smallest inside margin 0.3 in [fail] | smallest inside margin 0.5 in [pass] | | Top, bottom, outside margin (K04) | smallest top/bottom/outside margin 0.301 in [pass] | smallest top/bottom/outside margin 0.436 in [pass] | | Fonts embedded (K05) | 2 of 2 fonts embedded [pass] | 2 of 2 fonts embedded [pass] | | Smallest text (K06) | smallest text 12 pt [pass] | smallest text 12 pt [pass] | | Picture resolution (K07) | 3 picture(s); lowest 111 dpi [fail] | 3 picture(s); lowest 300 dpi [pass] | ## What kdpfix changed - Page size: US Letter to 6 x 9 in (all sections, portrait). - Margins: mirrored (book) margins. Inside 0.5 in (KDP minimum for 88 pages: 0.375 in; the program adds 0.125 in), outside 0.5 in, top and bottom 0.75 in, footer 0.4 in from the edge. - Fonts: the PDF is written by LibreOffice, which embeds a subset of every font used (2 of 2 embedded before and after; the Word file uses Times New Roman, which this machine replaces with the metric-compatible Liberation Serif, so the lines break as Liberation Serif breaks them). - Pictures: no pixels were changed (lossless export, no resampling; confirmed with `pdfimages -list`). Two pictures were already 400 dpi and keep their printed size. The low-resolution picture (500 x 375 px) was printed 4.50 in wide = 111 dpi; kdpfix printed it smaller, 1.67 in wide, so it reaches 300 dpi. The fix cannot add detail: if the author wants it large, they need a larger original picture. - Page count: 88 pages (Letter had 54). Pages are not comparable one for one. - Bookmarks: not written (KDP asks for none). ## What did not change - Words, their order, the chapter headings, the title page, the page-number footer, fonts and font sizes (12 pt), line spacing, paragraph breaks. - Not fixed, not checked: the cover, colour, anything in KDP's content rules. See `after.report.html` for the full 'did NOT check' list. ## Text comparison (run by kdpfix itself, stored in `after.fixlog.json`) - Method: all text of the .docx body (paragraphs and table cells, in order) against all text of the PDF, after Unicode NFKC normalisation, straight/curly quote unification and removal of all white space; one line equal to the page number is dropped from each PDF page (the added page-number footer). Headings (Heading/Title styles) are looked up in the PDF text in order. - Word file vs **before.pdf**: characters 116204 vs 116204, IDENTICAL. - Word file vs **after.pdf**: characters 116204 vs 116204, IDENTICAL; words 26448 in the Word file, 26467 counted in the PDF (the PDF count differs only where a line break fell inside a hyphenated word or ligature; the character sequence is identical); 13 headings found in order: True. ## Sources and public-domain status - Text: Lewis Carroll (died 1898), *Alice's Adventures in Wonderland* (1865), Project Gutenberg ebook 11, page https://www.gutenberg.org/ebooks/11 . File read from a Project Gutenberg mirror, https://gutenberg.pglaf.org/1/11/11-0.txt, on 2026-11-30 (www.gutenberg.org answered 'down for maintenance' that day). The author died more than 70 years ago, so the text is public domain in every country with life+70 or shorter terms; Project Gutenberg lists it as public domain in the USA. The Gutenberg header, license text and the table of contents were removed; nothing in the book's words was edited, but underscores that Gutenberg uses to mark italics (for example `_very_`) are still in the text, so they print as underscores. The original illustrations (Tenniel) are not used. - Pictures: three simple line drawings made by `make_sample.py` for this sample (a hole, a teapot, a card). No third-party picture is used; we release them for any use. Files in `source/`. - Software used to lay out: LibreOffice 7.3 (MPL 2.0). See README.md.