$('#printPdf').click(function() { var printPdfPedidoCompras = { content: [ {text: 'PEDIDO DE COMPRAS', style: 'header'}, {image: 'logo.png', width: 150, height: 150,}, {text: 'Dados do Solicitante', margin: [0, 20, 0, 8]}, { style: 'tableExample', table: { headerRows: 1, body: [ [ {text: 'Data Abertura', style: 'tableHeader'}, {text: 'Nome', style: 'tableHeader'}, {text: 'Número da Solicitação', style: 'tableHeader'}, {text: 'Número do Pedido', style: 'tableHeader'} ], [ $('#dataAbertura').val(), $('#nomeSolicitante').val(), $('#numSoli').val(), $('#numPedido').val() ], ] }, layout: { hLineWidth: function (i, node) { return (i === 0 || i === node.table.body.length) ? 2 : 1; }, vLineWidth: function (i, node) { return (i === 0 || i === node.table.widths.length) ? 2 : 1; }, hLineColor: function (i, node) { return (i === 0 || i === node.table.body.length) ? 'black' : 'gray'; }, vLineColor: function (i, node) { return (i === 0 || i === node.table.widths.length) ? 'black' : 'gray'; }, } }, {text: 'Informações Sobre o Produto', margin: [0, 20, 0, 8]}, { style: 'tableExample', table: { headerRows: 1, body: [ [ {text: 'Cod Produto', style: 'tableHeader'}, {text: 'Produto', style: 'tableHeader'}, {text: 'Fornecedor', style: 'tableHeader'}, {text: 'Tel Fornecedor', style: 'tableHeader'}, ], [ $('#codProduto___1').val(), $('#zoomProduto___1').val(), $('#zoomFornecedor___1').val(), $('#telFornecedor___1').val(), ], ] }, layout: { hLineWidth: function (i, node) { return (i === 0 || i === node.table.body.length) ? 2 : 1; }, vLineWidth: function (i, node) { return (i === 0 || i === node.table.widths.length) ? 2 : 1; }, hLineColor: function (i, node) { return (i === 0 || i === node.table.body.length) ? 'black' : 'gray'; }, vLineColor: function (i, node) { return (i === 0 || i === node.table.widths.length) ? 'black' : 'gray'; }, } },