You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Leonardo Gregianin edited this page Feb 25, 2025
·
1 revision
Instale a dependência da impressão do documentos fiscal:
pip install 'pynfe[impressao]'
ou diretamente:
pip install 'brazilfiscalreport[damdfe]'
Exemplo de código
frombrazilfiscalreport.damdfeimportDamdfe# Path to the XML filexml_file_path='damdfe.xml'# Load XML Contentwithopen(xml_file_path, "r", encoding="utf8") asfile:
xml_content=file.read()
# Instantiate the DAMDFE object with the loaded XML contentdamdfe=Damdfe(xml=xml_content)
# Save the generated PDF to a filedamdfe.output('damdfe.pdf')