0
How can I avoid an image of a particular page that saved as PDF
be cut. as in the example below:
The file is generated using the command print
javascript:window.print()
Follow my html code:
<html>
<head>
<link href="print.css" rel="stylesheet" type="text/css" media="print">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<title><?=$linha['nivel']?> –
<?=$linha['ano']?>
</title>
</head>
<body>
<!-- Retorna dados da tabela -->
<?php
function criarCombo($table,$id,$valor)
{
$sql = "SELECT * FROM perguntas";
$rs_sql = mysql_query($sql);
while($linha=mysql_fetch_array($rs_sql))
{
$chave = $linha[$id];
$nome = $linha[$valor];
$combo = $combo . "<option value=\"$id\">$nome</option>";
}
echo $combo;
}
?>
<?php
// se o número de resultados for maior que zero, mostra os dados
if($total > 0) {
// inicia o loop que vai mostrar todos os dados
do {
?>
<p><hr><u><b>(<?=$linha['name']?>)</b></u>
<?=$linha['nivel']?> –
<?=$linha['ano']?>
<!-- -- <button><== Remover</button> -- <button>Adicionar ==></button> -->
<?=$linha['questiontext']?></br>
<?=$linha['answer']?>
<?php
// finaliza o loop que vai mostrar os dados
}while($linha = mysql_fetch_assoc($dados));
// fim do if
}
?>
<a style="display:scroll;position:fixed;top:30px;right:60px;" class="soTela" title='Imprimir conteúdo' href='javascript:window.print()'>Imprimir Prova</a>
</body>
</html>
<?php
// tira o resultado da busca da memória
mysql_free_result($dados);
?>
Embed html with CSS
– Leandro Angelo
Perhaps the documentation of
page-break-before
,page-break-after
andpage-break-inside
help you. And this article also– fernandosavio
There’s no CSS, it’s just the pure page anyway.
– Miguel Silva
Remembering that this error happens in firefox
– Miguel Silva