Пример #1
0
        public BlocoCanhoto(DanfeViewModel viewModel, Estilo estilo) : base(viewModel, estilo)
        {
            var textoRecebimento = new TextoSimples(estilo, viewModel.TextoRecebimento)
            {
                Height = TextoRecebimentoAltura, TamanhoFonte = 8
            };
            var nfe = new NumeroNfSerie(estilo, viewModel.NfNumero.ToString(Formatador.FormatoNumeroNF), viewModel.NfSerie.ToString())
            {
                Height = AlturaLinha2 + TextoRecebimentoAltura, Width = 30
            };

            var campos = new LinhaCampos(Estilo)
            {
                Height = AlturaLinha2
            }
            .ComCampo("Data de Recebimento", null)
            .ComCampo("Identificação e assinatura do recebedor", null)
            .ComLarguras(50, 0);

            var coluna1 = new VerticalStack();

            coluna1.Add(textoRecebimento, campos);

            var linha = new FlexibleLine()
            {
                Height = coluna1.Height
            }
            .ComElemento(coluna1)
            .ComElemento(nfe)
            .ComLarguras(0, 16);

            MainVerticalStack.Add(linha, new LinhaTracejada(2));
        }
Пример #2
0
        public LinhaCampos AdicionarLinhaCampos()
        {
            var l = new LinhaCampos(Estilo, Width);

            l.Width  = Width;
            l.Height = Constantes.CampoAltura;
            MainVerticalStack.Add(l);
            return(l);
        }
        public BlocoEventoIdentificacao(DanfeEventoViewModel viewModel, Estilo estilo) : base(viewModel, estilo)
        {
            #region Propriedades

            var chaveAcesso = DanfeHelper.FormatarChaveAcesso(viewModel.ChaveAcesso);
            var modelo      = viewModel.ChaveAcesso.Substring(20, 2);
            var serie       = viewModel.ChaveAcesso.Substring(22, 3);
            var numero      = DanfeHelper.FormatarNumeroNF(viewModel.ChaveAcesso.Substring(25, 9));
            var ano         = viewModel.ChaveAcesso.Substring(2, 2);
            var mes         = viewModel.ChaveAcesso.Substring(4, 2);

            #endregion

            var codigoBarras = new Barcode128C(viewModel.ChaveAcesso, Estilo)
            {
                Height = AlturaCodigo
            };

            var coluna = new VerticalStack();
            var linha1 = new LinhaCampos(estilo)
            {
                Height = AlturaLinhaCampo
            }
            .ComCampo("MODELO", modelo)
            .ComCampo("SÉRIE", serie)
            .ComCampo("NÚMERO", numero)
            .ComCampo("MÊS / ANO DA EMISSÃO", $"{mes} / {ano}")
            .ComLargurasIguais();

            var linha2 = new Campo("CHAVE DE ACESSO", chaveAcesso, estilo)
            {
                Height = AlturaLinhaCampo
            };

            coluna.Add(linha1, linha2);

            var fl = new FlexibleLine {
                Height = codigoBarras.Height
            }
            .ComElemento(coluna)
            .ComElemento(codigoBarras)
            .ComLargurasIguais();

            MainVerticalStack.Add(fl);
        }
Пример #4
0
        public void Stack()
        {
            PdfDocument document = new PdfDocument();
            PdfPage     page     = document.AddPage();

            XGraphics gfx    = XGraphics.FromPdfPage(page);
            Gfx       gfx2   = new Gfx(gfx);
            Estilo    estilo = new Estilo();

            LinhaCampos stack = new LinhaCampos(estilo, 100);

            stack.Height = Constantes.CampoAltura;



            stack.ComCampo("Data", "Data")
            .ComCampo("Recebedor", "Recebedor")
            .ComLarguras(30, 0);


            VerticalStack pilha2 = new VerticalStack();

            pilha2.Width = 100;
            //   pilha2.Height = 2 * Constantes.CampoAltura;

            pilha2.SetPosition(10, 10);

            pilha2.Add(new Campo("Topo", "w", estilo));
            pilha2.Add(stack);

            pilha2.Draw(gfx2);

            pilha2.Y     = pilha2.BoundingBox.Bottom;
            pilha2.Width = 150;
            pilha2.Draw(gfx2);

            pilha2.Y     = pilha2.BoundingBox.Bottom;
            pilha2.Width = 100;
            pilha2.Draw(gfx2);

            document.Save("Pilha.pdf");
        }