### Install SrPattif.Danfe via Package Manager Source: https://github.com/srpattif/srpattif.danfe/blob/main/README.md Use the Package Manager Console to install the latest version of the SrPattif.Danfe library. ```csharp > Install-Package SrPattif.Danfe ``` -------------------------------- ### Install SrPattif.Danfe via .NET CLI Source: https://github.com/srpattif/srpattif.danfe/blob/main/README.md Use the .NET CLI to add the SrPattif.Danfe package to your project, specifying the version. ```csharp > dotnet add package SrPattif.Danfe --version 1.0.0 ``` -------------------------------- ### Install SrPattif.Danfe via ProjectReference Source: https://github.com/srpattif/srpattif.danfe/blob/main/README.md Add the SrPattif.Danfe package to your project's dependencies using PackageReference in the .csproj file. ```xml ``` -------------------------------- ### Generate and Save DANFE PDF Source: https://github.com/srpattif/srpattif.danfe/blob/main/README.md Generate the DANFE PDF from a Nota Fiscal model and save it to a specified file path. Ensure the Danfe object is disposed after use. ```csharp // Gera o PDF da DANFE e salva-o no local indicado. using (var danfe = new Danfe(nf)) { danfe.Generate(); danfe.Save("danfe.pdf"); } ``` -------------------------------- ### Create Nota Fiscal Model from XML File Source: https://github.com/srpattif/srpattif.danfe/blob/main/README.md Deserialize a Nota Fiscal XML file into a model object using DanfeViewModelCreator.CreateFromXmlFile. This is the first step before generating a DANFE. ```csharp // Cria o model a partir do arquivo XML da NF-e. var nf = DanfeViewModelCreator.CreateFromXmlFile("nfe.xml"); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.