Files
kdp_generator/__pycache__/kdp_format.cpython-313.pyc
T

133 lines
13 KiB
Plaintext
Raw Normal View History

2026-03-24 19:36:04 +02:00
ó
ÈÂiú1ã óè•SrSSKrSSKrSSKJr SSKJr SSKJr SSK J
r
SSK J r J
r
SSKJrJrJr SS KJrJr \R*"\5rS
rS rS rS rS
rSrSrS\S\ 4Sjr!S\S\S\ S\"\ \ \ \ 44Sjr#S\S\$S\$S\$S\4
Sjr%S\
S\&S\&S\ S \ SS4 S!jr'S\
S\&S\&S\ S \ SS4 S"jr(S\
S\ S \ S\$SS4
S#jr)S\
S$\*\"\&\4S\ S \ SS4
S%jr+S\
S&\S\ S \ SS4
S'jr,S+S(\S)\&S\$S\$S\4
S*jjr-g),zòKDP-specific formatting: margins, front matter, page numbering, TOC.
Assembles a complete print-ready PDF book that meets Amazon KDP
requirements for trim size, margins (including gutter), page count,
and includes professional front matter.
éN)ÚOptional)ÚParagraphStyle)Úinch)ÚCanvas)ÚFrameÚ Paragraph)Ú CrosswordÚ
PuzzleBookÚTrimSize)Úrender_puzzle_pageÚrender_solution_pageéi<çà?g333333ã?Ú Helveticaé Ú
page_countÚreturncó<•US::agUS::agUS::agUS::agg )
zBKDP minimum inside (gutter) margin in inches, based on page count.é–gØ?i,riôgä?i¼çè?gì?©)rs ÚO/Users/mihai.stefanescu/Projects/personal/crossword-kdp-generator/kdp_format.pyÚ_gutter_marginr)s1€à�SÓØØ�SÓØØ�SÓØØ�SÓØØ óÚtrimÚabs_pageÚguttercóö•UR[-nUR[-n[[-nU[-n[[-n[
[-nUS-S:XaUn OUn X6-
U-
n
XG-
n XG-
U-
n X›X¬4$)z¨Return (content_x, content_top_y, content_w, content_h) in points.
Odd pages (recto) have the gutter on the *left*;
even pages (verso) have the gutter on the *right*.
éé)ÚwidthrÚheightÚ_OUTSIDE_MARGINÚ _TOP_MARGINÚ_BOTTOM_MARGIN)
rrrÚpwÚphÚoutsideÚgutÚtopÚbotÚ content_xÚ content_wÚ
content_top_yÚ content_hs
rÚ
_content_rectr06s†€ð
�‰”dÑ €BØ
�‰”tÑ €Bä¤Ñ$€GØ
”4‰-€CÜ
τ
€CÜ
œ4Ñ
€Cà�!�|�qÓØ‰ àˆ à‘˜7Ñ"€IØ‘H€MØ‘˜3‘€Ià  YÐ 9Ð9rÚ puzzle_countÚsolutions_at_endÚ include_tocÚinclude_instructionscód•SnU(aUS-
nU(aUS-
nUS-S:waUS-
nUS-nXE-$)zAPre-calculate total pages so the gutter margin can be determined.rr rr)r1r2r3r4ÚfrontÚcontents rÚ_estimate_page_countr8UsG€ð
€EÞØ
�‰
ˆÞØ
�‰
ˆØ ˆq�y�Aƒ~Ø
�‰
ˆà˜QÑ€GØ ‰?ÐrÚcvÚtitleÚauthorr&r'có•US-nURSS5 URSSS5 URUSS5nURX6-
S- XQ5 [ US-S5nUR SSS5 UR
S5 US -
nURX7-
S- XƒU-S- U5 U(aTURS
S 5 URS S S 5 URUS
S 5n URX9-
S- US
-
U5 gg)Ng�Âõ(\�â?úHelvetica-BoldérrgffffffÖ?é´réréçÐ?é)ÚsetFontÚsetFillColorRGBÚ stringWidthÚ
drawStringÚminÚsetStrokeColorRGBÚ setLineWidthÚline)
r9r:r;r&r'Úy_titleÚtwÚrule_wÚrule_yÚaws
rÚ_draw_title_pagerQjs€à�4‰i€Gà‡J�JРÔ$Ø×Ñ�q˜!˜QÔØ �‰˜Ð/°Ó 4€B؇M�M�2‘7˜a‘- Ô0ô��d‘˜CÓ
€FØ×ј˜t TÔ*؇O�O�DÔØ
�r‰\€F؇G�GˆR‰[˜AÑ ˜v¨V© °qÑ'8¸&ÔAæ
Ø
�
‰
�; Ô#Ø
×ј4  tÔ,Ø
�^‰^˜F K°Ó
4ˆØ
�
‰
�r‘w !‘m V¨b¡[°&Õ9ð rc ó®•[RR5Rn[ SSSSSSS9n[ SUS3U5/nU(a!UR
[ S US
U3U55 UR[ S U5[ S U5[ S
US3U5/5 S[-n[XˆUSU--
US-SSSSS9RXp5 g)NÚ Copyrightrré
é©ÚfontNameÚfontSizeÚleadingÚ spaceBeforeÚ
spaceAfterz<i>z</i>zCopyright &copy; Ú zAll rights reserved.zxNo part of this publication may be reproduced, distributed, or transmitted in any form without prior written permission.zFirst published Ú.rrrBr©Ú leftPaddingÚ rightPaddingÚ
topPaddingÚ
bottomPadding) ÚdatetimeÚdateÚtodayÚyearrrÚappendÚextendrrÚ addFromList) r9r:r;r&r'rfÚstyleÚitemsÚmargins rÚ_draw_copyright_pagerm�sð€ä �=‰=× Ñ Ó × %Ñ %€DÜ Ø˜k°A¸rØ !ñ
€Eô �C˜�w˜dÐ# UÓ+ð€EöØ
� ‰ ”YÐ!2°4°&¸¸&¸ÐBÀEÓJÔKØ ‡L�LÜÐ(¨%Ó0Üð
Kà ó ô Ð$ T F¨!Ð,¨eÓ4ð
ôð”D‰[€FÜ ˆ&˜"˜q 6™z™/¨2°©9Ø aØ añ)ç)4©°UÕ)?rc óÌ•S[-nUSU--
nURSS5 URSSS5 SnURUSS5nX$-
S-
nUR X-
S- X†5 [ SSS S
S S S 9n U(aS
n
OSn
[
SU 5[
SU 5[
SU 5[
SU 5[
U
S3U 5/n US
-
n [XDX\U-
SSSSS9RX°5 g)Nrrr=érz How to SolveÚ Instructionsré rAérVzASolutions for every puzzle can be found at the back of this book.zJThe solution for each puzzle appears on the page immediately following it.z�Each puzzle consists of a grid of white and black squares and a set of numbered clues. Solve the clues and write one letter per white square.zG<b>Across</b> clues are answered by writing letters from left to right.zE<b>Down</b> clues are answered by writing letters from top to bottom.zžWhere an across answer and a down answer share a square, the letter must be the same for both words &mdash; these intersections are your best starting points!z Good luck and have fun!r^) rrDrErFrGrrrri)
r9r&r'r2rlr-ÚheadingÚhwÚ heading_yrjÚsol_noteÚparasÚ frame_tops
rÚ_draw_instructions_pagery�s0€à
”D‰[€FØ�Q˜‘Z‘€Ià‡J�JРÔ$Ø×Ñ�q˜!˜QÔØ€GØ �‰˜Ð!1°2Ó 6€BØ‘ ˜bÑ €I؇M�M�2‘7˜a‘- Ô4ä Ø °rÀ2Ø !ñ
€Eö
ð$‰ð0ˆô ð
'à(-ó /ô ð
"Ø#(ó *ô ð
"Ø#(ó *ô ð
;à<Aó Cô �X�JÐ7Ð8¸%Ó@ð
€Eð$˜B‘€IÜ ˆ&˜)°Ñ%7Ø aØ añ)ç)4©°UÕ)?rÚentriescóΕS[-nUSU--
nURSS5 URSSS5 SnURUSS5nUR X'-
S- X4-
S-
U5 X4-
S-
nSn S n
S
n UH×upÍX„S-:a OÌURXš5 URSSS5 UR XHU 5 [ U
5nURXéU
5nUR
X$-