From 195ecd4c4b9bef382f55f312c2b24da2ba691a11 Mon Sep 17 00:00:00 2001 From: Lucas Cimon <925560+Lucas-C@users.noreply.github.com> Date: Mon, 16 Mar 2026 08:39:28 +0100 Subject: [PATCH] Upgrade calls to fpdf2 to avoid mypy errors --- 020-xmp/main.py | 2 +- 024-annotations/create_annotated_pdf.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/020-xmp/main.py b/020-xmp/main.py index c00b9ce..b143281 100644 --- a/020-xmp/main.py +++ b/020-xmp/main.py @@ -9,7 +9,7 @@ pdf = FPDF() pdf.add_page() pdf.set_font("Helvetica", size=12) -pdf.cell(200, 10, txt="Hello, World!", ln=1, align="C") +pdf.cell(200, 10, text="Hello, World!", align="C", new_x="LMARGIN", new_y="NEXT") pdf.output(name=output) output.seek(0) diff --git a/024-annotations/create_annotated_pdf.py b/024-annotations/create_annotated_pdf.py index 38c7cce..92912cf 100644 --- a/024-annotations/create_annotated_pdf.py +++ b/024-annotations/create_annotated_pdf.py @@ -11,7 +11,7 @@ pdf.add_page() pdf.set_font("Helvetica", size=24) -pdf.text(x=10, y=20, txt="Some text.") +pdf.text(x=10, y=20, text="Some text.") pdf.text_annotation( x=60, y=20, @@ -21,8 +21,8 @@ with pdf.highlight("Highlight comment"): pdf.text(50, 50, "Line 1") pdf.set_y(50) - pdf.multi_cell(w=30, txt="Line 2") -pdf.cell(w=60, txt="Not highlighted", border=1) + pdf.multi_cell(w=30, text="Line 2") +pdf.cell(w=60, text="Not highlighted", border=1) pdf.ink_annotation(