<?php
@ini_set('zend.ze1_compatibility_mode', '1');
define('FPDF_FONTPATH', 'font/');
include_once('ufpdf.php');
$pdf = new UFPDF();
$pdf->Open();
$pdf->SetTitle('UFPDF is Cool.');
$pdf->SetAuthor('Khaled Al-Shamaa');
$pdf->AddFont('ae_AlHor', '', 'ae_AlHor.php');
$pdf->AddPage();
require('ArGlyphs.class.php');
$ArabicPDF = new ArGlyphs();
$filename = 'ajax.txt';
$handle = fopen($filename, 'r');
$text = fread($handle, filesize($filename));
fclose($handle);
$font_size = 16;
$chars_in_line = $ArabicPDF->a4_max_chars($font_size);
$total_lines = $ArabicPDF->a4_lines($text, $font_size);
$text = $ArabicPDF->convert($text, $chars_in_line);
$pdf->SetFont('ae_AlHor', '', $font_size);
$pdf->MultiCell(0, $total_lines, $text, 0, 'R', 0);
$pdf->Close();
$pdf->Output();
?>
|