What I want is to print a pdf file with the text that I have in Ckeditor I get it and I send it with ajax using the following function
$('#botontexto').on('click', function() {
var texto = CKEDITOR.instances['editor1'].getData();
$.ajax({
type: 'POST',
data: {"texto": texto},
url:"php/imprimir_informe.php",
success: function(response){
},
complete: function(){
window.open('php/imprimir_informe.php');
}
})
});
and the php that receives the information is the following:
<?php
require '../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
$html = $_POST['texto'];
$html2pdf = new Html2pdf();
$html2pdf->writeHTML($html);
$html2pdf->output('prueba223.pdf','D');
?>
The problem is that it generates the blank PDF file