From f6584896cb612f85d3628ac232b02b504b7ab11e Mon Sep 17 00:00:00 2001 From: Mateus Zanini Date: Wed, 17 May 2023 15:26:21 -0300 Subject: [PATCH] =?UTF-8?q?Desenhar=20marca=20d'=C3=A1gua=20"Documento=20C?= =?UTF-8?q?ancelado"=20quando=20CodigoStatusResposta=20for=20igual=20a=201?= =?UTF-8?q?01.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DanfeSharp/Danfe.cs | 4 ++++ DanfeSharp/DanfePagina.cs | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/DanfeSharp/Danfe.cs b/DanfeSharp/Danfe.cs index af093149..d5b55483 100644 --- a/DanfeSharp/Danfe.cs +++ b/DanfeSharp/Danfe.cs @@ -181,6 +181,10 @@ private DanfePagina CriarPagina() p.DesenharAvisoHomologacao(); } + // NF-e cancelada + if (ViewModel.CodigoStatusReposta == 101) + p.DesenharAvisoCancelamento(); + return p; } diff --git a/DanfeSharp/DanfePagina.cs b/DanfeSharp/DanfePagina.cs index d242c77b..9148b147 100644 --- a/DanfeSharp/DanfePagina.cs +++ b/DanfeSharp/DanfePagina.cs @@ -91,6 +91,22 @@ public void DesenhaNumeroPaginas(int n, int total) Gfx.Flush(); } + public void DesenharAvisoCancelamento() + { + TextStack ts = new TextStack(RetanguloCorpo) + { + AlinhamentoVertical = AlinhamentoVertical.Centro, + AlinhamentoHorizontal = AlinhamentoHorizontal.Centro, + LineHeightScale = 0.9F + } + .AddLine("DOCUMENTO CANCELADO", Danfe.EstiloPadrao.CriarFonteRegular(48)); + + Gfx.PrimitiveComposer.BeginLocalState(); + Gfx.PrimitiveComposer.SetFillColor(new org.pdfclown.documents.contents.colorSpaces.DeviceRGBColor(0.35, 0.35, 0.35)); + ts.Draw(Gfx); + Gfx.PrimitiveComposer.End(); + } + public void DesenharAvisoHomologacao() { TextStack ts = new TextStack(RetanguloCorpo) { AlinhamentoVertical = AlinhamentoVertical.Centro, AlinhamentoHorizontal = AlinhamentoHorizontal.Centro, LineHeightScale = 0.9F }