Publish Zymatica Voice LLM hepta-architecture showcase codebases (part 2)
Browse files
22_Zymatica_Voice_LLM/generate_voice_whitepaper_pdf.py
CHANGED
|
@@ -12,8 +12,8 @@ if sys.platform == "win32":
|
|
| 12 |
|
| 13 |
class PDF(FPDF):
|
| 14 |
def header(self):
|
| 15 |
-
# Small running header from page 2 onwards
|
| 16 |
-
if self.page_no() > 1:
|
| 17 |
self.set_draw_color(28, 54, 115)
|
| 18 |
self.set_line_width(0.85)
|
| 19 |
self.line(15, 10, self.w - 15, 10)
|
|
@@ -24,6 +24,8 @@ class PDF(FPDF):
|
|
| 24 |
self.ln(12)
|
| 25 |
|
| 26 |
def footer(self):
|
|
|
|
|
|
|
| 27 |
self.set_y(-15)
|
| 28 |
self.set_font("Helvetica", "", 8)
|
| 29 |
self.set_text_color(45, 45, 45)
|
|
@@ -212,6 +214,14 @@ def main():
|
|
| 212 |
print("Generating Zymatica Voice LLM Whitepaper PDF...")
|
| 213 |
pdf = PDF()
|
| 214 |
pdf.set_margins(15, 15, 15)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
pdf.add_page()
|
| 216 |
pdf.set_auto_page_break(auto=True, margin=22)
|
| 217 |
|
|
@@ -261,7 +271,7 @@ def main():
|
|
| 261 |
for row in table_rows:
|
| 262 |
cleaned_row = []
|
| 263 |
for cell in row:
|
| 264 |
-
cleaned_cell = cell.replace("`", "").replace("**", "")
|
| 265 |
cleaned_row.append(cleaned_cell)
|
| 266 |
cleaned_rows.append(cleaned_row)
|
| 267 |
|
|
@@ -488,6 +498,31 @@ def main():
|
|
| 488 |
pdf.set_x(18)
|
| 489 |
pdf.cell(0, 4, clean("We Are TheAiCollective.art"), new_x="LMARGIN", new_y="NEXT")
|
| 490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 491 |
# Output file
|
| 492 |
try:
|
| 493 |
pdf.output(pdf_path)
|
|
|
|
| 12 |
|
| 13 |
class PDF(FPDF):
|
| 14 |
def header(self):
|
| 15 |
+
# Small running header from page 2 onwards, and not on back cover
|
| 16 |
+
if self.page_no() > 1 and not getattr(self, "in_back_cover", False):
|
| 17 |
self.set_draw_color(28, 54, 115)
|
| 18 |
self.set_line_width(0.85)
|
| 19 |
self.line(15, 10, self.w - 15, 10)
|
|
|
|
| 24 |
self.ln(12)
|
| 25 |
|
| 26 |
def footer(self):
|
| 27 |
+
if self.page_no() == 1 or getattr(self, "in_back_cover", False):
|
| 28 |
+
return
|
| 29 |
self.set_y(-15)
|
| 30 |
self.set_font("Helvetica", "", 8)
|
| 31 |
self.set_text_color(45, 45, 45)
|
|
|
|
| 214 |
print("Generating Zymatica Voice LLM Whitepaper PDF...")
|
| 215 |
pdf = PDF()
|
| 216 |
pdf.set_margins(15, 15, 15)
|
| 217 |
+
pdf.add_page()
|
| 218 |
+
pdf.set_auto_page_break(auto=False)
|
| 219 |
+
|
| 220 |
+
# Page 1: Full-page Language U Logo Front Cover
|
| 221 |
+
front_cover_path = "language_u_logo.jpg" if os.path.exists("language_u_logo.jpg") else "j:/Language-U/language_u_logo.jpg"
|
| 222 |
+
if os.path.exists(front_cover_path):
|
| 223 |
+
pdf.image(front_cover_path, x=0, y=0, w=pdf.w, h=pdf.h)
|
| 224 |
+
|
| 225 |
pdf.add_page()
|
| 226 |
pdf.set_auto_page_break(auto=True, margin=22)
|
| 227 |
|
|
|
|
| 271 |
for row in table_rows:
|
| 272 |
cleaned_row = []
|
| 273 |
for cell in row:
|
| 274 |
+
cleaned_cell = clean(cell.replace("`", "").replace("**", ""))
|
| 275 |
cleaned_row.append(cleaned_cell)
|
| 276 |
cleaned_rows.append(cleaned_row)
|
| 277 |
|
|
|
|
| 498 |
pdf.set_x(18)
|
| 499 |
pdf.cell(0, 4, clean("We Are TheAiCollective.art"), new_x="LMARGIN", new_y="NEXT")
|
| 500 |
|
| 501 |
+
# Add back cover page
|
| 502 |
+
pdf.in_back_cover = True
|
| 503 |
+
pdf.set_auto_page_break(auto=False)
|
| 504 |
+
pdf.add_page()
|
| 505 |
+
back_cover_path = "Logo.jpg" if os.path.exists("Logo.jpg") else "j:/Language-U/Logo.jpg"
|
| 506 |
+
if os.path.exists(back_cover_path):
|
| 507 |
+
pdf.image(back_cover_path, x=0, y=0, w=pdf.w, h=pdf.h)
|
| 508 |
+
|
| 509 |
+
# Semi-transparent bottom banner (Hex #0D1527)
|
| 510 |
+
pdf.set_fill_color(13, 21, 39)
|
| 511 |
+
pdf.rect(0, pdf.h - 32, pdf.w, 32, style="F")
|
| 512 |
+
|
| 513 |
+
# Sign-off signatures
|
| 514 |
+
pdf.set_text_color(255, 255, 255)
|
| 515 |
+
pdf.set_font("Helvetica", "B", 9.5)
|
| 516 |
+
text1 = clean("zymatica.space | astronautshe.com | Devs One")
|
| 517 |
+
t1_w = pdf.get_string_width(text1)
|
| 518 |
+
pdf.text((pdf.w - t1_w) / 2.0, pdf.h - 18, text1)
|
| 519 |
+
|
| 520 |
+
pdf.set_text_color(99, 179, 237) # Hex #63B3ED
|
| 521 |
+
pdf.set_font("Helvetica", "B", 7.5)
|
| 522 |
+
text2 = clean("We Are TheAiCollective.art All Rights Reserved 2026©")
|
| 523 |
+
t2_w = pdf.get_string_width(text2)
|
| 524 |
+
pdf.text((pdf.w - t2_w) / 2.0, pdf.h - 10, text2)
|
| 525 |
+
|
| 526 |
# Output file
|
| 527 |
try:
|
| 528 |
pdf.output(pdf_path)
|