0 %

from fpdf import FPDF

class InteractivePDF(FPDF):
    def header(self):
        self.set_font("Helvetica", "B", 16)
        self.set_text_color(40, 40, 40)
        self.cell(0, 10, "Checklist SEO Iniziale - netprimex", ln=True, align="C")
        self.ln(5)

    def footer(self):
        self.set_y(-15)
        self.set_font("Helvetica", "I", 8)
        self.set_text_color(128)
        self.cell(0, 10, "Netpirmex - www.netprimex.com", align="C")

    def checkbox_field(self, x, y, name):
        self.rect(x, y, 4, 4)
        self.form_checkbox(name=name, x=x, y=y, w=4, h=4)

pdf = InteractivePDF()
pdf.set_auto_page_break(auto=True, margin=15)
pdf.add_page()

pdf.set_font("Helvetica", "", 12)
pdf.set_text_color(50, 50, 50)

y = pdf.get_y()

field_count = 1
for section, items in sections.items():
    pdf.set_font("Helvetica", "B", 13)
    pdf.set_text_color(30, 30, 30)
    pdf.cell(0, 10, section.replace("–", "-"), ln=True)
    pdf.set_font("Helvetica", "", 12)
    pdf.set_text_color(50, 50, 50)
    for item in items:
        x = 15
        y = pdf.get_y()
        pdf.checkbox_field(x, y + 2, f"chk{field_count}")
        pdf.set_xy(x + 6, y)
        pdf.multi_cell(0, 6, f"{item.replace('–', '-').replace('’', '\'')}")
        field_count += 1
    pdf.ln(4)

# Salvataggio PDF interattivo
interactive_pdf_path = "/mnt/data/checklist_seo_netpirmex_interattivo.pdf"
pdf.output(interactive_pdf_path)

interactive_pdf_path
NETPRIMEX
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.