GerarDanfse 1.0.12
dotnet add package GerarDanfse --version 1.0.12
NuGet\Install-Package GerarDanfse -Version 1.0.12
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GerarDanfse" Version="1.0.12" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GerarDanfse" Version="1.0.12" />
<PackageReference Include="GerarDanfse" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GerarDanfse --version 1.0.12
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GerarDanfse, 1.0.12"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GerarDanfse@1.0.12
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GerarDanfse&version=1.0.12
#tool nuget:?package=GerarDanfse&version=1.0.12
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DANFSe v2.0
Gerador de DANFSe (Documento Auxiliar da NFS-e) em C#/.NET.
Gera o DANFSe em PDF a partir do XML da NFS-e do Leiaute Nacional, seguindo a Nota Técnica nº 008 (SE/CGNFS-e) e o layout oficial do Portal Nacional.
Recursos
- Geração de DANFSe em PDF
- Compatível com o XML da NFS-e do Leiaute Nacional
- Layout conforme o modelo oficial do Portal Nacional
- Geração automática do QR Code
- Marca d'água para notas canceladas
- Modo Auditoria, exibindo a tag XML correspondente a cada campo
- Destaque visual para retenções
- Canhoto destacável
- Quebra automática de página entre grupos
- Suporte aos blocos IBS/CBS da Reforma Tributária
Instalação
Instale o pacote:
dotnet add package GerarDanfse --version 1.0.4
A biblioteca utiliza os seguintes pacotes:
- PDFsharp 6.x
- QRCoder
Obs.: essas dependências são instaladas automaticamente pelo NuGet.
Uso
Geração básica
Para a maioria dos casos, basta informar o XML.
var xml = File.ReadAllText("nfse.xml");
byte[] pdf = DanfseGenerator.Gerar(xml, new DanfseDeps());
File.WriteAllBytes("danfse.pdf", pdf);
A biblioteca já inclui as fontes necessárias internamente. O logotipo é opcional.
Configurando opções
var deps = new DanfseDeps
{
LogoPng = File.ReadAllBytes("logo.png"), // opcional
Cancelada = true,
isSubstituida = true, // ignorado se Cancelada também for true
Auditoria = false,
DestacarRet = false
};
byte[] pdf = DanfseGenerator.Gerar(xml, deps);
| Propriedade | Descrição |
|---|---|
| --- | --- |
LogoPng |
Logo exibida no DANFSe (opcional) |
Cancelada |
Exibe a marca d'água CANCELADA |
isSubstituida |
Exibe a marca d'água SUBSTITUÍDA |
Auditoria |
Exibe a tag XML correspondente a cada campo |
DestacarRet |
Destaca os campos de retenção em amarelo |
Observações
- As fontes necessárias já acompanham a biblioteca, não sendo necessário fornecê-las manualmente.
- O logotipo é opcional.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.