4,3 */
return html_entity_decode($string, $type, $charset);
}
$trans_tbl = get_html_translation_table (HTML_ENTITIES, $type);
$trans_tbl = array_flip ($trans_tbl);
$ret = strtr ($string, $trans_tbl);
$ret = preg_replace('/(\d+);/me', "chr('\\1')",$ret);
$ret = iconv('ISO-8859-1', $charset, $ret);
return $ret;
}
$path_pdf = "IMG/_article_PDF/" ;
$class_path = "lib/class_pdf/" ;
///////////////////////////////////////////////////
$conf_url_site = "#URL_SITE_SPIP" ;
$conf_nom_site = "#NOM_SITE_SPIP" ;
$charset = '#CHARSET';
// Recuperation et definition des differents elements
$site="#NOM_SITE_SPIP";
$rubrique="[(#TITRE|pdf_first_clean)]#NOM_SITE_SPIP/B_rubrique_mere>";
$date="[Première publication : (#DATE_REDAC|affdate), et mis en ligne le ] [(#DATE|nom_jour)] [(#DATE|affdate)]";
$date = _html_entity_decode($date, ENT_COMPAT, $charset);
$auteur="[(#NOM|pdf_first_clean)]";
$motsclef="#TITRE|pdf_first_clean";
$yahoo="-- [(#TITRE|pdf_first_clean)] --";
[$logo_fichier="(#LOGO_ARTICLE_RUBRIQUE|fichier)";]
[$logo_lien="(#URL_ARTICLE)";]
[$surtitre="(#SURTITRE|pdf_first_clean)";]
[$titre="(#TITRE|pdf_first_clean)";]
[$soustitre="(#SOUSTITRE|pdf_first_clean)";]
[$chapo="(#CHAPO|pdf_first_clean)";]
[$texte= "(#TEXTE|pdf_first_clean)";]
[$ps="(#PS|pdf_first_clean)";]
[$notes="(#NOTES|pdf_first_clean)";]
$id_article = #ID_ARTICLE ;
$files_pdf = "article_".$id_article.".pdf" ;
$file_out = $path_pdf . $files_pdf ;
header("Location: index.php");
exit;
/B_principale>
//////////////////////////////////////////////////
if (!file_exists($file_out)){
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
define('FPDF_FONTPATH',$class_path.'font/');
require_once($class_path.'fpdf.php');
require_once($class_path.'lib_pdf_global.php');
require_once($class_path.'lib_pdf_spip.php');
/////////////////////////////
// Debut génération du PDF //
/////////////////////////////
$pdf=new PDF_SPIP();
$pdf->Open();
$pdf->SetDisplayMode (fullwidth, continuous);
$pdf->SetTitle($titre);
$pdf->SetCreator($site);
$pdf->SetAuthor($auteur);
$pdf->SetSubject($rubrique);
$pdf->SetKeywords($motsclef);
$pdf->SetMargins(25,25);
$pdf->SetAutoPageBreak(auto, 30);
$pdf->SetCharset($charset);
$pdf->AjouterChapitre() ;
// Sortie
$pdf->Output( $file_out ) ;
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
}
header("location: ".$file_out."" ) ;
exit;
?>