Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Rogerio Pancini

Ideia para imprimir documento

Recommended Posts

Boa noite pessoal.

 

Estou refazendo uma intranet e surgiu uma dúvida.

Fiz um teste com vários campos (o documento pode ter mais ou menos campos).

Estou testando imprimir via javascript (window.print()) e pelo FPDF.

Em ambos os casos, me deparei com essa característica (na imagem).

A parte da assinatura dos responsáveis corta ao meio.

Alguém já se deparou com algo parecido?

Seria possível, na impressão, não quebrar as assinaturas?

 

Obrigado!

 

Segue o código atual (versão não FPDF)

<?php 
	/******* Conexão com o bando de dados *******/
	include "Conexao/config.php";
			
	mysqli_select_db($config, $database_config);
	mysqli_set_charset($config,"utf8");
	/******* Conexão com o bando de dados *******/
		
	$info = "Não há itens cadastrados no momento";
	$erro = "Erro ao acessar dados";	
	
	include "php/restrict.php"; 	

	$id_item = $array_pgn[5];
	
	$sql_2 = mysqli_query($config, "SELECT ma.titulo, ma.datadecadastro, usr.nome, usr.id_estabelecimento, ma.datadecadastro, ma.protocolo, ma.id_usuario_envio, ma.datadeenvio, ma.id_transportadora, ma.id_usuario_recebimento, ma.dataderecebimento, ma.datadefechamento, ma.id_estabelecimento_destino, ma.id_estabelecimento_origem, ma.id_usuario_cadastro FROM malote ma LEFT JOIN usuario AS usr ON (ma.id_usuario_cadastro = usr.id) WHERE ma.id = '$id_item'") or die(mysqli_error($config));
				
	if(@mysqli_num_rows($sql_2) <= '0'){
		echo "
			<div class=\"row\">
				<div class=\"col-lg-6\">
					<div class=\"alert alert-danger\">
						<strong>Erro!</strong> $erro
					</div>
				</div>	
			</div>
		";
	}else{
		while($r_sql_2 = mysqli_fetch_array($sql_2)){
			$titulo                        = $r_sql_2[0];
			$datadecadastro                = date("d/m/Y", strtotime($r_sql_2[1]));
			$nome_usuario_cadastro              = $r_sql_2[2];
			$id_usuario_estabalecimento    = $r_sql_2[3];
			$datadecadastro_malote         = date("d/m/Y", strtotime($r_sql_2[4])); 
			$hora_datadecadastro_malote    = date("H:i", strtotime($r_sql_2[4]));
			$protocolo                     = $r_sql_2[5];
			$id_usuario_envio              = $r_sql_2[6];
			$datadeenvio_malote            = date("d/m/Y", strtotime($r_sql_2[7])); 
			$hora_datadeenvio_malote       = date("H:i", strtotime($r_sql_2[7]));
			$id_transportadora             = $r_sql_2[8];
			$id_usuario_recebimento        = $r_sql_2[9];
			$dataderecebimento_malote_c    = $r_sql_2[10];
			$dataderecebimento_malote      = date("d/m/Y", strtotime($r_sql_2[10])); 
			$hora_dataderecebimento_malote = date("H:i", strtotime($r_sql_2[10]));
			$datadefechamento_malote       = date("d/m/Y", strtotime($r_sql_2[11])); 
			$hora_datadefechamento_malote  = date("H:i", strtotime($r_sql_2[11]));	
			$id_estabelecimento_destino    = $r_sql_2[12];
			$id_estabelecimento_origem     = $r_sql_2[13];
			$id_usuario_cadastro           = $r_sql_2[14];
			
			$sql_3_a = mysqli_query($config, "SELECT id_estabelecimento FROM usuario WHERE id = '$id_usuario_cadastro'") or die(mysqli_error($config));
						
			if(@mysqli_num_rows($sql_3_a) <= '0'){
				$estabelecimento_destino = "";
			}else{
				while($r_sql_3_a = mysqli_fetch_array($sql_3_a)){
					$id_estabelecimento_origem_usuario = $r_sql_3_a[0];
				}
			}

			$sql_3_b = mysqli_query($config, "SELECT titulo FROM estabelecimento WHERE id = '$id_estabelecimento_origem_usuario'") or die(mysqli_error($config));
						
			if(@mysqli_num_rows($sql_3_b) <= '0'){
				$estabelecimento_destino = "";
			}else{
				while($r_sql_3_b = mysqli_fetch_array($sql_3_b)){
					$estabelecimento_cadastro = $r_sql_3_b[0];
				}
			}			
			
			/****** Origem ******/
			$sql_3_c = mysqli_query($config, "SELECT titulo FROM estabelecimento WHERE id = '$id_estabelecimento_origem'") or die(mysqli_error($config));
			
			if(@mysqli_num_rows($sql_3_c) <= '0'){
				$estabelecimento_origem = "";
			}else{
				while($r_sql_3_c = mysqli_fetch_array($sql_3_c)){
					$estabelecimento_origem = $r_sql_3_c[0];
				}
			}			
							
			$sql_3_d = mysqli_query($config, "SELECT titulo FROM estabelecimento WHERE id = '$id_usuario_estabalecimento'") or die(mysqli_error($config));
			if(@mysqli_num_rows($sql_3_a) <= 0){
				echo "";
			}else{
				while($r_sql_3_d = mysqli_fetch_array($sql_3_d)){
					$usuario_estabalecimento_origem = $r_sql_3_d[0]; 
				}
			}
			/****** Origem ******/			
			
			/****** Envio ******/
			$sql_3_e = mysqli_query($config, "SELECT nome FROM usuario WHERE id = '$id_usuario_envio'") or die(mysqli_error($config));
			if(@mysqli_num_rows($sql_3_e) <= 0){
				echo "";
			}else{
				while($r_sql_3_e = mysqli_fetch_array($sql_3_e)){
					$nome_usuario_envio = $r_sql_3_e[0]; 
				}
			}	

			$sql_3_e = mysqli_query($config, "SELECT titulo FROM transportadora WHERE id = '$id_transportadora'") or die(mysqli_error($config));
			if(@mysqli_num_rows($sql_3_e) <= 0){
				echo "";
			}else{
				while($r_sql_3_e = mysqli_fetch_array($sql_3_e)){
					$transportadora = $r_sql_3_e[0]; 
				}
			}	
			/****** Envio ******/

			/****** Recebimento ******/							
			$sql_3_f = mysqli_query($config, "SELECT nome FROM usuario WHERE id = '$id_usuario_recebimento'") or die(mysqli_error($config));
			if(@mysqli_num_rows($sql_3_f) <= 0){
				echo "";
			}else{
				while($r_sql_3_f = mysqli_fetch_array($sql_3_f)){
					$nome_usuario_recebimento = $r_sql_3_f[0]; 
				}
			}	

			$sql_3_g = mysqli_query($config, "SELECT titulo FROM estabelecimento WHERE id = '$id_estabelecimento_destino'") or die(mysqli_error($config));
						
			if(@mysqli_num_rows($sql_3_g) <= '0'){
				$estabelecimento_destino = "";
			}else{
				while($r_sql_3_g = mysqli_fetch_array($sql_3_g)){
					$estabelecimento_destino = $r_sql_3_g[0];
				}
			}
			/****** Recebimento ******/		
		}
	}	

	if(isset($_POST['voltar']) && $_POST['voltar'] == 'ok'){
		header("location:http://localhost/projetos/intranet/listar-malotes");
	}
?>

<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Properità Negócios</title>
		<link href="<?php echo $dir_base; ?>fonts/OpenSans/stylesheet.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo $dir_base; ?>assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />		
        <link href="<?php echo $dir_base; ?>assets/global/css/components-imprime.min.css" rel="stylesheet" id="style_components" type="text/css" />		
				
		<style type="text/css">
			/* reset */

			*{
				border: 0;
				color: inherit;
				font-family: "Open Sans",sans-serif;
				font-size: inherit;
				font-style: inherit;
				font-weight: inherit;
				line-height: inherit;
				list-style: none;
				margin: 0;
				padding: 0;
				text-decoration: none;
				vertical-align: top;
			}
			
			body{
				margin: initial;
				padding: initial;
			}

			/* content editable */

			*[contenteditable] { min-width: 1em; outline: 0; }

			*[contenteditable] { cursor: pointer; }

			*[contenteditable]:hover, *[contenteditable]:focus, td:hover *[contenteditable], td:focus *[contenteditable], img.hover { background: #DEF; box-shadow: 0 0 1em 0.5em #DEF; }

			span[contenteditable] { display: inline-block; }

			/* heading */

			h1 { text-align: center; text-transform: uppercase; }

			/* table */

			html { font: 16px/1 'Open Sans', sans-serif; overflow: auto; padding: 0.5in; }
			html { background: #999; cursor: default; }

			body { box-sizing: border-box; /* height: 11in;*/ margin: 0 auto; overflow: hidden; padding: 0.5in; /* width: 8.5in;*/ }
			body { background: #FFF; box-shadow: 0 0 1in -0.25in rgba(0, 0, 0, 0.5); }

			/* header */

			header { margin: 0 0 1em; }
			header:after { clear: both; content: ""; display: table; }

			header h1 {font-size: 26px; background: #000; color: #FFF; margin: 0 0 1em; padding: 0.5em 0; }
			header address { float: left; font-size: 75%; font-style: normal; line-height: 1.25; margin: 0 1em 1em 0; }
			header address p { margin: 0 0 0.25em; }
			header span, header img { display: block; float: right; }
			header span { margin: 0 0 1em 1em; max-height: 25%; max-width: 60%; position: relative; }
			header img { max-height: 100%; max-width: 100%; }
			header input { cursor: pointer; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; height: 100%; left: 0; opacity: 0; position: absolute; top: 0; width: 100%; }

			/* article */

			article, article address, table.meta, table.inventory { margin: 0 0 3em; }
			article:after { clear: both; content: ""; display: table; }
			article h1 { clip: rect(0 0 0 0); position: absolute; }

			article address { float: left; font-size: 125%; font-weight: bold; }

			/* table meta & balance */

			table.meta, table.balance { float: right; width: 36%; }
			table.meta:after, table.balance:after { clear: both; content: ""; display: table; }

			/* table meta */

			table.meta th { width: 40%; }
			table.meta td { width: 60%; }

			/* table items */

			table.inventory { clear: both; width: 100%; }
			table.inventory th { font-weight: bold; text-align: center; }

			table.inventory td:nth-child(1) { width: 26%; }
			table.inventory td:nth-child(2) { width: 38%; }
			table.inventory td:nth-child(3) { text-align: right; width: 12%; }
			table.inventory td:nth-child(4) { text-align: right; width: 12%; }
			table.inventory td:nth-child(5) { text-align: right; width: 12%; }

			/* table balance */

			table.balance th, table.balance td { width: 50%; }
			table.balance td { text-align: right; }

			/* aside */

			aside h1 { border: none; border-width: 0 0 1px; margin: 0 0 1em; }
			aside h1 { border-color: #999; border-bottom-style: solid; }

			/* javascript */

			.add, .cut
			{
				border-width: 1px;
				display: block;
				font-size: .8rem;
				padding: 0.25em 0.5em;	
				float: left;
				text-align: center;
				width: 0.6em;
			}

			.add, .cut
			{
				background: #9AF;
				box-shadow: 0 1px 2px rgba(0,0,0,0.2);
				background-image: -moz-linear-gradient(#00ADEE 5%, #0078A5 100%);
				background-image: -webkit-linear-gradient(#00ADEE 5%, #0078A5 100%);
				border-color: #0076A3;
				color: #FFF;
				cursor: pointer;
				font-weight: bold;
				text-shadow: 0 -1px 2px rgba(0,0,0,0.333);
			}

			.add { margin: -2.5em 0 0; }

			.add:hover { background: #00ADEE; }

			.cut { opacity: 0; position: absolute; top: 0; left: -1.5em; }
			.cut { -webkit-transition: opacity 100ms ease-in; }

			tr:hover .cut { opacity: 1; }

			@media print {
				* { -webkit-print-color-adjust: exact; }
				html { background: none; padding: 0; }
				body { box-shadow: none; margin: 0; }
				span:empty, .btn.blue { display: none; }
				.add, .cut { display: none; }
			}

			@page { margin: 0; }

			.sepador_div{
				border-bottom: 1px solid #000000;
			}
			
			.responsaveis{
				display: block;
				margin-bottom: 60px;
			}
			
			.responsavel_1{
				border-top: 1px solid #000000;
				padding-top: 10px;
			}
			
			.responsavel_2{
				border-top: 1px solid #000000;
				margin-top: 80px;
				padding-top: 10px;				
			}		

			.responsaveis_div{
				width: 50%;
				margin: 0 auto;			
			}
		</style>
		<link rel="license" href="http://www.opensource.org/licenses/mit-license/">
	</head>
	<body>
		<form role="form" id="form_voltar" name="form_voltar" action="" method="post" enctype="multipart/form-data" class="text-right" style="margin-bottom: 20px;">
			<button type="submit" class="btn blue" tabindex="7">
				<i class="fa fa-check"></i> Fechar
			</button>
			<input type="hidden" name="voltar" value="ok" />
		</form>
		<header>
			<h1>Malote <?php echo $titulo; ?></h1>
		
				<div>
					<h4>Origem: <?php echo $estabelecimento_origem; ?></h4>
					<p>Cadastrado por: <?php echo $nome_usuario_cadastro; ?> (<?php echo $usuario_estabalecimento_origem; ?>)</p>
					<p>Data de cadastro: <?php echo $datadecadastro_malote; ?> às <?php echo $hora_datadecadastro_malote; ?></p>
					<p>Protocolo: <?php echo $protocolo; ?></p>					
				</div>
				<hr />
				<div>
					<p>Enviado por: <?php echo $nome_usuario_envio; ?> (<?php echo $estabelecimento_cadastro; ?>)</p>
					<p>Data de envio: <?php echo $datadeenvio_malote; ?> às <?php echo $hora_datadeenvio_malote; ?></p>
					<p>Transportadora: <?php echo $transportadora; ?></p>					
				</div>
				<hr />
				<div>
					<h4>Destino: <?php echo $estabelecimento_destino; ?></h4>
					<!-- <p>Enviado para: <?php //echo $nome_usuario_recebimento; ?></p> -->
				</div>
			</div>
		</header>
		<article>
			<?php
				$sql_3_aux = mysqli_query($config, "SELECT bm.fornecedor, bm.vencimento, bm.valor, bm.datadecadastro, usr.nome FROM boletosdomalote bm LEFT JOIN usuario AS usr ON (bm.id_usuario = usr.id) WHERE bm.id_malote = '$id_item'") or die(mysqli_error($config));
								
				if(@mysqli_num_rows($sql_3_aux) > 0){
			?>
			<div class="portlet-body">
				<h4 class="block">Boletos do malote</h4>
				<table class="table table-bordered table-striped">
					<thead>
						<tr class="bg-default bg-font-default">
							<th> Fornecedor </th>
							<th> Vencimento </th>
							<th> Valor </th>
							<th> Data de Cadastro </th>
							<th> Cadastrado Por </th>
						</tr>
					</thead>
				<tbody>
			<?php
				$sql_3 = mysqli_query($config, "SELECT bm.fornecedor, bm.vencimento, bm.valor, bm.datadecadastro, usr.nome FROM boletosdomalote bm LEFT JOIN usuario AS usr ON (bm.id_usuario = usr.id) WHERE bm.id_malote = '$id_item'") or die(mysqli_error($config));
				if(@mysqli_num_rows($sql_3) <= 0){
					echo "";
				}else{
					while($r_sql_3 = mysqli_fetch_array($sql_3)){
						$forcenedor_1          = $r_sql_3[0]; 
						$vencimento_1          = date("d/m/Y", strtotime($r_sql_3[1])); 
						$valor_1               = "R$ " . number_format($r_sql_3[2],2, ',', '.');
						$datadecadastro_1      = date("d/m/Y", strtotime($r_sql_3[3])); 
						$hora_datadecadastro_1 = date("H:i", strtotime($r_sql_3[3]));
						$usuario_1             = $r_sql_3[4];
			?>											
						<tr>
							<td class="alinhamento_central"> <?php echo $forcenedor_1; ?> </td>
							<td class="alinhamento_central"> <?php echo $vencimento_1; ?> </td>
							<td class="alinhamento_central"> <?php echo $valor_1; ?> </td>
							<td class="alinhamento_central"> <?php echo $datadecadastro_1 . " às " . $hora_datadecadastro_1; ?> </td>
							<td class="alinhamento_central"> <?php echo $usuario_1; ?> </td>
						</tr>
			<?php
					}
				}												
			?>                                               
					</tbody>
				</table>
			</div>							
			<?php
			}
			?>
							
			<?php
				$sql_4_aux = mysqli_query($config, "SELECT cm.pdv, cm.datadecadastro, cm.datadeemissao, usr.nome FROM caixasdomalote cm LEFT JOIN usuario AS usr ON (cm.id_usuario = usr.id) WHERE cm.id_malote = '$id_item'") or die(mysqli_error($config));
								
				if(@mysqli_num_rows($sql_4_aux) > 0){
			?>
			<div class="portlet-body">
				<h4 class="block">Caixas do malote</h4>
				<table class="table table-bordered table-striped">
					<thead>
						<tr class="bg-default bg-font-default">
						<th> PDV </th>
						<th> Data de Emissão </th>
						<th> Data de Cadastro </th>
						<th> Cadastrado Por </th>
						</tr>
					</thead>
					<tbody>
			<?php
				$sql_4 = mysqli_query($config, "SELECT cm.pdv, cm.datadecadastro, cm.datadeemissao, usr.nome FROM caixasdomalote cm LEFT JOIN usuario AS usr ON (cm.id_usuario = usr.id) WHERE cm.id_malote = '$id_item'") or die(mysqli_error($config));
				if(@mysqli_num_rows($sql_4) <= 0){
					echo "";
				}else{
					while($r_sql_4 = mysqli_fetch_array($sql_4)){
						$pdv_2                 = $r_sql_4[0]; 
						$datadecadastro_2      = date("d/m/Y", strtotime($r_sql_4[1])); 
						$hora_datadecadastro_2 = date("H:i", strtotime($r_sql_4[1]));									
						$emissao_2             = date("d/m/Y", strtotime($r_sql_4[2])); 
						$usuario_2             = $r_sql_4[3];
			?>											
					<tr>
						<td class="alinhamento_central"> <?php echo $pdv_2; ?> </td>
						<td class="alinhamento_central"> <?php echo $emissao_2; ?> </td>
						<td class="alinhamento_central"> <?php echo $datadecadastro_2 . " às " . $hora_datadecadastro_2; ?> </td>
						<td class="alinhamento_central"> <?php echo $usuario_2; ?> </td>
					</tr>
			<?php
					}
				}												
			?>                                               
					</tbody>
				</table>
			</div>	
			<?php
			}
			?>
							
			<?php
				$sql_5_aux = mysqli_query($config, "SELECT nfm.numero, nfm.fornecedor, nfm.datadeemissao, nfm.datadecadastro, usr.nome, nfm.valor FROM notasfiscaisdomalote nfm LEFT JOIN usuario AS usr ON (nfm.id_usuario = usr.id) WHERE nfm.id_malote = '$id_item'") or die(mysqli_error($config));
								
				if(@mysqli_num_rows($sql_5_aux) > 0){
			?>
			<div class="portlet-body">
				<h4 class="block">Notas Fiscais do malote</h4>
				<table class="table table-bordered table-striped">
					<thead>
						<tr class="bg-default bg-font-default">
							<th> Número da nota fiscal </th>
							<th> Fornecedor </th>
							<th> Data de Emissão </th>
							<th> Valor </th>
							<th> Data de cadastro </th>
							<th> Cadastrado por </th>              
						</tr>
					</thead>
					<tbody>
						<?php
							$sql_5 = mysqli_query($config, "SELECT nfm.numero, nfm.fornecedor, nfm.datadeemissao, nfm.datadecadastro, usr.nome, nfm.valor FROM notasfiscaisdomalote nfm LEFT JOIN usuario AS usr ON (nfm.id_usuario = usr.id) WHERE nfm.id_malote = '$id_item'") or die(mysqli_error($config));
							if(@mysqli_num_rows($sql_5) <= '0'){
								echo "";
							}else{
								while($r_sql_5 = mysqli_fetch_array($sql_5)){
									$numero_3              = $r_sql_5[0]; 
									$fornecedor_3          = $r_sql_5[1]; 
									$emissao_3             = date("d/m/Y", strtotime($r_sql_5[2])); 
									$datadecadastro_3      = date("d/m/Y", strtotime($r_sql_5[3])); 
									$hora_datadecadastro_3 = date("H:i", strtotime($r_sql_5[3]));									
									$usuario_3             = $r_sql_5[4];
									$valor_3               = "R$ " . number_format($r_sql_5[5],2, ',', '.');
						?>											
						<tr>
							<td class="alinhamento_central"> <?php echo $numero_3; ?> </td>
							<td class="alinhamento_central"> <?php echo $fornecedor_3; ?> </td>
							<td class="alinhamento_central"> <?php echo $emissao_3; ?> </td>
							<td class="alinhamento_central"> <?php echo $valor_3; ?> </td>
							<td class="alinhamento_central"> <?php echo $datadecadastro_3 . " às " . $hora_datadecadastro_3; ?> </td>
							<td class="alinhamento_central"> <?php echo $usuario_3; ?> </td>
						</tr>
						<?php
								}
							}												
						?>                                               
					</tbody>
				</table>
			</div>	
			<?php
				}
			?>	

			<?php
				$sql_6_aux = mysqli_query($config, "SELECT dm.titulo, dm.datadecadastro, usr.nome FROM documentosdomalote dm LEFT JOIN usuario AS usr ON (dm.id_usuario = usr.id) WHERE dm.id_malote = '$id_item'") or die(mysqli_error($config));
								
				if(@mysqli_num_rows($sql_6_aux) > 0){
			?>
			<div class="portlet-body">
				<h4 class="block">Documentos do malote</h4>
				<table class="table table-bordered table-striped">
					<thead>
						<tr class="bg-default bg-font-default">
							<th> Título </th>
							<th> Data de cadastro </th>
							<th> Cadastrado por </th>              
						</tr> 
					</thead>
					<tbody>
					<?php
						$sql_6 = mysqli_query($config, "SELECT dm.titulo, dm.datadecadastro, usr.nome FROM documentosdomalote dm LEFT JOIN usuario AS usr ON (dm.id_usuario = usr.id) WHERE dm.id_malote = '$id_item'") or die(mysqli_error($config));
						if(@mysqli_num_rows($sql_6) <= '0'){
							echo "";
						}else{
							while($r_sql_6 = mysqli_fetch_array($sql_6)){
								$titulo_4              = $r_sql_6[0]; 
								$datadecadastro_4      = date("d/m/Y", strtotime($r_sql_6[1])); 
								$hora_datadecadastro_4 = date("H:i", strtotime($r_sql_6[1]));									
								$usuario_4             = $r_sql_6[2];
					?>											
						<tr>
							<td class="alinhamento_central"> <?php echo $titulo_4; ?> </td>
							<td class="alinhamento_central"> <?php echo $datadecadastro_4 . " às " . $hora_datadecadastro_4; ?> </td>
							<td class="alinhamento_central"> <?php echo $usuario_4; ?> </td>
						</tr>
					<?php
							}
						}												
					?>                                               
					</tbody>
				</table>
			</div>	
			<?php
				}
			?>		
		</article>
		<aside>
			<div class="row text-center">
				<div class="responsaveis_div">
					<h4 class="responsaveis">Responsáveis</h4>
					<div class="responsavel_1"><?php echo $nome_usuario_envio; ?> (<?php echo $estabelecimento_cadastro; ?>)</div>
					<div class="responsavel_2"><?php echo $estabelecimento_destino; ?> (<?php //echo $nome_usuario_recebimento; ?>)</div>			
				</div>
			</div>
		</aside>
		
        <script src="<?php echo $dir_base; ?>assets/global/plugins/jquery.min.js" type="text/javascript"></script>		
        <script src="<?php echo $dir_base; ?>assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>	
        <script>
            $(document).ready(function() {
				window.print();
			})
	</script>
	</body>
</html>

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por ment0r
      Boa tarde à todos.
      Pessoal, estou com o seguinte problema: preciso imprimir uma ficha mensal de trabalho, mas quando vou imprimir, a página para impressão sai "cortada".
       

       
      A imagem acima representa a ficha que preciso imprimir, está tudo ok com essa (tirei o cabeçalho, pois não vinha ao caso)
       

       
      Vejam como fica na impressão: com aproximadamente 2/3 da largura.
       
      <style> body { width: 100%; height: 100%; margin: 0; padding: 0; background-color: #FAFAFA; } * { box-sizing: border-box; -moz-box-sizing: border-box; } .page { width: 210mm; min-height: 297mm; padding: 4mm; margin: 1mm auto; border: 1px #D3D3D3 solid; border-radius: 5px; background: white; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); } /*.subpage { padding: 0.5cm; border: 0px red solid; height: 257mm; outline: 2cm #FFEAEA solid; }*/ .cliente { margin-top: 30px; font-size: 20px; } th {font-size: 14px; } td {font-size: 12px; } .logo {height: 64px; margin: 20px 0px 0px 20px;} .font-cabecalho {font-size: 12px; margin-left: 20px; text-align: center; margin: 20px 0px 0px 20px;} @page { width: 100%; height: 100%; margin: 0; padding: 0; } @media print { html, body { width: 210mm; height: 297mm; } .page { margin: 0; border: initial; border-radius: initial; width: initial; min-height: initial; box-shadow: initial; background: initial; page-break-after: always; } } </style> Código CSS da página.
       
      O que pode ser? Como faço pra deixar a página de impressão igual à página PHP? Obrigado desde já à todos.

      Um abraço.
       
    • Por ment0r
      Boa tarde pessoal, tudo bem?

      É possível remover o cabeçalho e rodapé da impressão de uma página html via php, css ou javascript? Já adianto que não gostaria de gerar pdf, mas sim saber se é possível remover ou não.
      Obrigado a todos.
       

    • Por danicarla
      Olá pessoas,

      Estou tentando fazer uma versão de impressão usando CSS eu queria colocar um cabeçalho e um rodapé em todas as paginas,  O problema é que o conteúdo vem do banco de dados,  e dependendo do tamanho dos parágrafos em algumas vezes o texto acaba ficando em cima do cabeçalho ou do rodapé.. alguém tem alguma idéia de como posso fazer isso?
       
      Meu cód está assim:
       
      header {font-family:Arial;font-size: 22px;color: #000;text-align: center;} footer {font-family:Arial;font-size: 10px; color: #CD090C;text-align: center;} article {font-family:Arial;font-size: 14px; color: #000;text-align: justify;} @page {size: A4;margin: 11mm 17mm 17mm 17mm;} @media print { header {position: fixed;top: 0;} footer {position: fixed;bottom: 0;} article {position: relative;top:40px;} .content-block, p {top:40px;page-break-inside: avoid;} html, body {width: 210mm;height: 297mm;} } E no HTML
       
      <header>CABEÇALHO</header> <article>Conteudo.. texto.. etc..</article> <footer>Texto do Rodapé</footer>  
    • Por Ana Gauna
      Eu já tentei diversas vezes, mas ainda não consegui fazer funcionar.  Inclusive já alterei o arquivo .htaccess mas isso não funcionou.  Estou tentando criar um bloqueio em página de site online, para bloquear o download de imagens, bloquear o download de fotografias.  Estou tentando também criar o bloqueio de impressão da tela de um site, para fazer o control p parar de funcionar em determinada página do site.    Vi na internet sites que tem isso funcionando direito.  Eu ainda não consegui criar.  Alguém sabe como fazer?   Eu sei um pouco de PHP, este mês comprei 3 livros novos de PHP que estou estudando para tentar me ajudar nas minhas dúvidas...
      Boa noite
    • Por Joelend
      Estou enviando impressões diretamente para o spool da impressora: 

      WritePrinter(HandleImp, PAnsiChar(ComandoAnsiString), Length(ComandoAnsiString), CaracteresImpressos); 

      Na maioria dos casos isso supre minha necessidade. 

      Minha duvida é a respeito dos comandos que exigem uma resposta da impressora: Ler status. 
      Vi sobre o ReadPrinter...mas não consegui utiliza-lo.
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.