diff --git a/main/wiki/export_html2pdf.php b/main/wiki/export_html2pdf.php index 7a6e45108a..06b4049289 100644 --- a/main/wiki/export_html2pdf.php +++ b/main/wiki/export_html2pdf.php @@ -1,9 +1,36 @@ +* +*/ + include("../inc/global.inc.php"); api_block_anonymous_users(); -require('../plugin/html2fpdf/html2fpdf.php'); + +require('../inc/lib/html2pdf/html2pdf.class.php'); $contentPDF=stripslashes(api_html_entity_decode($_POST['contentPDF'], ENT_QUOTES, $charset)); $titlePDF=stripslashes(api_html_entity_decode($_POST['titlePDF'], ENT_QUOTES, $charset)); @@ -17,12 +44,23 @@ echo $contentPDF; //original $htmlbuffer=ob_get_contents(); //// delete Output-Buffer: ob_end_clean(); -$pdf= new HTML2FPDF(); -//$pdf->DisplayPreferences('FullScreen'); -$pdf->AddPage(); -$pdf->SetAuthor('Wiki Dokeos'); -$pdf->SetTitle($titlePDF); -$pdf->SetKeywords('Dokeos Wiki'); -$pdf->WriteHTML($htmlbuffer); -$pdf->Output(); -?> + + +//$script = " +//var rep = app.response('Your name'); +//app.alert('Hello '+rep); +//"; + +//$html2pdf = new HTML2PDF('P','A4','es', array(0,0,0,0)); //margin left, margin top, margin right, margin bottom +$html2pdf = new HTML2PDF('P','A4','en'); +$html2pdf->pdf->SetDisplayMode('fullpage'); +//$html2pdf->pdf->IncludeJS($script); +//$html2pdf->pdf->IncludeJS("print(true);"); +//$html2pdf->pdf->IncludeJS("app.alert('Generated by Dokeos to PDF');"); +//$html2pdf->pdf->SetProtection(array('print'), 'guest');//add a password sample: guest +$html2pdf->pdf->SetAuthor('Wiki Dokeos'); +$html2pdf->pdf->SetTitle($titlePDF); +$html2pdf->pdf->SetKeywords('Dokeos Wiki'); +$html2pdf->WriteHTML($htmlbuffer); +$html2pdf->Output($titlePDF.'.pdf', 'D'); +?> \ No newline at end of file diff --git a/main/wiki/export_tcpdf.php b/main/wiki/export_tcpdf.php deleted file mode 100644 index 92c92f0530..0000000000 --- a/main/wiki/export_tcpdf.php +++ /dev/null @@ -1,63 +0,0 @@ -SetCreator(PDF_CREATOR); -$pdf->SetAuthor("Nicola Asuni"); -$pdf->SetTitle("TCPDF Example 006"); -$pdf->SetSubject("TCPDF Tutorial"); -$pdf->SetKeywords("TCPDF, PDF, example, test, guide"); - -// set default header data -$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); - -// set header and footer fonts -$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); -$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); - -//set margins -$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); -$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); -$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); - -//set auto page breaks -$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); - -//set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); - -//set some language-dependent strings -$pdf->setLanguageArray($l); - -//initialize document -$pdf->AliasNbPages(); - -// add a page -$pdf->AddPage(); -// output the HTML content -$pdf->writeHTML($contentPDF, true, 0, true, 0); - -// reset pointer to the last page -$pdf->lastPage(); - - -////////////////////////////////////////////////////////////////Generar el documento pdf ////////////////////////////////////////////// -$pdf->Output(); - - -?> \ No newline at end of file