# Strip out all non-Latin-1 characters to ensure compatibility with the FPDF library
import unicodedata
def clean_text(text):
return unicodedata.normalize("NFKD", text).encode("latin-1", "ignore").decode("latin-1")
pdf = PDF()
pdf.add_page()
pdf.chapter_title("Entity TS-01: Angel of Death")
pdf.chapter_body(clean_text("Status: [REDACTED]\n\nSummary:\nSubject remains uncontained. Reports confirm multiple visual distortions--most commonly as a wolf-like entity with variable ocular manifestations. Hunger levels influence form.\n\nNote: Entity speaks only when calmed via Item-9 (plush object resembling a bear)."))
pdf.chapter_title("Message Recovered from Forest")
pdf.chapter_body(clean_text("\"He said thank you...\" -- transcribed from Audio Log #091\n\nSpectrogram analysis reveals symbols correlating to lunar patterns.\n\nLocation: Forest Sector ██-██."))
pdf.chapter_title("New Presence Detected")
pdf.chapter_body(clean_text("Unconfirmed sightings of second entity, codename: TS-02\nAlias: Demon of Life\n\nIdentifiers:\n- Eye with crescent mark\n- Unusual gravitational field distortions\n\nThey are brothers.\n\nPrepare for contact."))
# Save the final cleaned PDF
output_pdf_path = "/mnt/data/TS01_RISE.pdf"
pdf.output(output_pdf_path)
# Bundle into ZIP archive again
zip_path = "/mnt/data/AngelOfDeath_ARG_Kit.zip"
with zipfile.ZipFile(zip_path, 'w') as zipf:
zipf.write(html_path, arcname="index.html")
zipf.write(output_audio_path, arcname="TS01_tree_echo.mp3")
zipf.write(output_pdf_path, arcname="TS01_RISE.pdf")
zip_path