|
@@ -1,9 +1,36 @@
|
|
|
<?php
|
|
|
-//Juan Carlos Raña export to pdf for Dokeos
|
|
|
+/*
|
|
|
+==============================================================================
|
|
|
+ Dokeos - elearning and course management software
|
|
|
+
|
|
|
+ Copyright (c) 2004-2009 Dokeos SPRL
|
|
|
+
|
|
|
+ For a full list of contributors, see "credits.txt".
|
|
|
+ The full license can be read in "license.txt".
|
|
|
+
|
|
|
+ This program is free software; you can redistribute it and/or
|
|
|
+ modify it under the terms of the GNU General Public License
|
|
|
+ as published by the Free Software Foundation; either version 2
|
|
|
+ of the License, or (at your option) any later version.
|
|
|
+
|
|
|
+ See the GNU General Public License for more details.
|
|
|
+
|
|
|
+ Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
|
|
|
+ Mail: info@dokeos.com
|
|
|
+==============================================================================
|
|
|
+*/
|
|
|
+
|
|
|
+/**
|
|
|
+* Export html to pdf
|
|
|
+* @Author Juan Carlos Raña <herodoto@telefonica.net>
|
|
|
+*
|
|
|
+*/
|
|
|
+
|
|
|
|
|
|
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');
|
|
|
+?>
|