Browse Source

[svn r16146]

Juan Carlos Raña 16 years ago
parent
commit
cb827a818a
1 changed files with 27 additions and 0 deletions
  1. 27 0
      main/wiki/export_html2pdf.php

+ 27 - 0
main/wiki/export_html2pdf.php

@@ -0,0 +1,27 @@
+<?php
+//Juan Carlos Raña export to pdf for Dokeos
+ 
+include("../inc/global.inc.php");
+api_block_anonymous_users();
+require('../plugin/html2fpdf/html2fpdf.php');
+
+$contentPDF=stripslashes(html_entity_decode($_POST['contentPDF'])); 
+$titlePDF=stripslashes(html_entity_decode($_POST['titlePDF'])); 
+
+//activate Output -Buffer:
+ob_start();
+////START-OF-PHP code
+echo $contentPDF; //original
+//END -OF- PHP code
+//Output-Buffer in variable:
+$htmlbuffer=ob_get_contents();
+//// delete Output-Buffer:
+ob_end_clean();
+$pdf= new HTML2FPDF(); 
+$pdf->AddPage();
+$pdf->SetAuthor('Wiki Dokeos'); 
+$pdf->SetTitle($titlePDF); 
+$pdf->SetKeywords('Dokeos Wiki');
+$pdf->WriteHTML($htmlbuffer); 
+$pdf->Output();
+?>