Necesito convertir esta página web en PDF pero cuando lo hago me lo renderiza mal. Solo me pasa cuando uso el pagesplit en true. Pero si no pongo en true no tengo forma de generar paginas adicionales.
<?php
include ('includes/connection.php'); ?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Ingreso de prestadores</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-
alpha.6/css/bootstrap.min.css" integrity="sha384-
rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ"
crossorigin="anonymous">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700"
rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<style>
body {
font-family: 'Open Sans', sans-serif;
font-size: 10px;
margin-top: 30px;
margin-bottom: 70px;
margin-left: 40px;
margin-right: 40px;
}
img {
width: 8%;
height: 8%;
float: left;
margin-right: 5%;
margin-left: 70px;
}
p {
font-size: 10px;
margin-bottom: -1%;
margin-right: 1%
}
th {
background-color: #E0DFDF;
border-radius: 7px;
font-size: 10px;
text-align: center;
}
td {
margin-top: 5px;
font-size: 10px;
}
table {
border-color: white;
}
tfoot {
font-size: 10px;
background-color: #E0DFDF;
}
</style>
<?php
session_start();
$perio = $_POST['perio'];
$sql = "SELECT a.profesional,a.periodo,a.cuit,a.provincia,b.id,b.cuit,b.prestador,c.periodo
FROM detalles a inner join users_entidades b INNER JOIN periodo c on
a.cuit=b.cuit and a.periodo=c.periodo WHERE b.id=".$_SESSION['idUsuario']."
AND a.periodo='$perio'";
//$sql .= "GROUP BY a.periodo";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result);
?>
<div class="container">
<div>
<div class="container-fluid img-responsive">
<img src="images/oaicono.jpg" alt="" class="img-rounded">
</div>
<div class="container-fluid">
<h2><b>Detalle Liquidación Entidad</b></h2>
</div>
<div class="row">
<div class="col-4">
<p>Entidad:<b><?php echo $_SESSION['prestador']; ?>.</b> </p>
<p>Provincia: <b><?php echo $row['provincia']; ?>.</b> </p>
</div>
<div class="col-4">
<p>Período: <b><?php echo $row['periodo']; ?></b> </p>
<p>C.U.I.T: <b><?php echo $row['cuit']; ?></b> </p>
</div>
<div class="col-4">
<p>Fecha Liq: <b><?php echo $row['periodo']."/25"; ?></b> </p>
<p>Centro Ate: <b>Odontopraxis S.A.</b></p>
</div>
</div>
</div>
<br>
<h4 class="text-left"><b>Comprobantes de la entidad</b></h4>
<table class="table text-center table-sm">
<thead>
<tr>
<th>Afiliado</th>
<th>Nº Afiliado</th>
<th>Plan</th>
<th>Fecha Prest.</th>
<th>Prest.</th>
<th>Pieza</th>
<th>Arancel</th>
<th>Mont. Liq. Exento</th>
<th>Mont. Liq. Gravado</th>
<th>Mont. Liq. IVA</th>
<th>Motivo Deb/Cred</th>
</tr>
</thead>
<tbody class="text-left">
<?php
$prestador = $row['profesional'];
$periodo = $perio;
mysqli_set_charset($con, "utf8");
$sql1 = "SELECT * FROM detalles WHERE profesional='$prestador' AND periodo='$periodo' ORDER BY detalles.periodo ASC";
$result1 = mysqli_query($con, $sql1);
while ($row1 = mysqli_fetch_array($result1)) { ?>
<tr>
<td><b><?php echo $row1['paciente']; ?></b></td>
<td><b><?php echo $row1['codigo'].$row1['vinc1']; ?></b></td>
<td><b><?php echo $row1['plan']."-".$row1['desc_plan']; ?></b></td>
<td><b><?php echo $row1['fecha']; ?></b></td>
<td><b><?php echo $row1['codigo_prest']; ?></b></td>
<td class="text-center"><b><?php echo $row1['pieza']; ?></b></td>
<td class='text-right'><b><?php echo $row1['valor']; ?></b></td>
<?php if ($row1['iva']=='S') {
echo "<td class='text-right'><b>--</b></td>";
echo "<td class='text-right'><b>".$row1['valor']."</b></td>" ;
}else{
echo "<td class='text-right'><b>".$row1['valor']."</b></td>";
echo "<td class='text-right'><b>--</b></td>" ;
} ?>
<?php if ($row1['iva']=='S') {
echo "<td class='text-right'><b>".number_format($row1['valor']*(0.105),2,'.',',')."</b></td>";
}else{
echo "<td class='text-right'><b>0.00</b></td>";
} ?>
<td class='text-center'><b><?php echo substr($row1['causa_rech'], 0, 10); ?></b></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td>Total</td>
<td></td>
<td></td>
<td></td>
<?php include('calculo.php'); ?>
<td style="background-color: white;" class="text-right"><b><?php echo number_format($row['total']-$row1['gravado'],2,'.',','); ?></b></td>
<td style="background-color: white;" class="text-right"><b><?php echo number_format($row1['gravado'],2,'.',','); ?></b></td>
<td style="background-color: white;" class="text-right"><b><?php echo number_format($row1['gravado']*(0.105),2,'.',','); ?></b></td>
<td style="background-color: white;"></td>
</tr>
</tfoot>
</table>
</div>
<script
src="http://code.jquery.com/jquery-3.2.1.js"
integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE="
crossorigin="anonymous">
</script>
<script
src="http://code.jquery.com/ui/1.12.1/jquery-ui.js"
integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-
alpha.6/js/bootstrap.min.js" integrity="sha384-
vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn"
crossorigin="anonymous"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.4/jspdf.debug.js">
</script>
<script src="js/html2pdf.js"></script>
<script src="js/addhtml.js"></script>
<script src="js/html2canvas.js"></script>
<script>
var pdf = new jsPDF('l', 'mm', 'a4');
var options = {
pagesplit: true,
};
pdf.addHTML($('html'), options, function()
{
pdf.save("Detalle_liquidacion_<?php echo $perio ?>.pdf");
});
</script>
</body>
</html>