private function getPdf($html, VentaCompletaTO $ventaCompletaTO, $pathDir, $nameFile) { $pdf = $this->get("white_october.tcpdf")->create('vertical', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetAuthor('VisitaYucatan.com'); $pdf->SetTitle('Voucher Electrónico'); $pdf->SetSubject('Voucher Electrónico'); $pdf->setFontSubsetting(true); $pdf->SetFont('helvetica', '', 11, '', true); $pdf->AddPage(); $file = $_SERVER["DOCUMENT_ROOT"] . Generalkeys::DOMAIN_VY . $pathDir . $nameFile . $ventaCompletaTO->getIdVenta() . '.pdf'; $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); $pdf->Output($file, 'F'); // This will output the PDF as a response directly (F => mueve a directorio, I => ver en linea) return $file; }