0
Is there any property of viewing a file . PDF from the event Click on Picturebox without having to create a new modal?
Example:
I have this Picturebox, where I created the code below, as soon as it is clicked it of the option to print the file, however I would like to leave more dynamic, viewing the . PDF and the user chooses whether or not to print.
Code:
private void picPDF_Click(object sender, EventArgs e)
        {
            try
            {
                NotasFiscais objNotasFiscais = new NotasFiscais();
                Pedido objPedido = new Pedido();
                if (objPedido.ConsultarNFPedido(Metodos.empresa, txtNumPedido.Text) > 0)
                {
                    objNotasFiscais.NFEmpresa = Metodos.empresa;
                    objNotasFiscais.NFNumero = objPedido.pedNFNumero;
                    objNotasFiscais.NFSerie = objPedido.pedNFSerie;
                    objNotasFiscais.NFCliente = Convert.ToInt32(txtCodigo.Text);
                    objNotasFiscais.NFTipo = objPedido.pedNFTipo;
                }
               if (objNotasFiscais.ConsultarNotaFiscal(Metodos.empresa, objNotasFiscais.NFNumero, objNotasFiscais.NFSerie, objNotasFiscais.NFTipo) > 0 )
                {
                   // if (objNotasFiscais.NFStatus == "I")
                   // {
                        Operacoes operacoes = new Operacoes();
                        string danfe = operacoes.ConsultarDanfePdf(objNotasFiscais.NFEmpresa, objNotasFiscais.NFNumero, objNotasFiscais.NFSerie, objNotasFiscais.NFCliente.ToString(), objNotasFiscais.NFTipo, true);
                        string Filepath = danfe;
                        new PrintPDF(danfe);
                    //}
                }
                else
                {
                    MessageBox.Show("PDF da Danfe não encontrado.", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
						