-
Notifications
You must be signed in to change notification settings - Fork 7
/
arabic.php
42 lines (28 loc) · 987 Bytes
/
arabic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
include("../mpdf-6.1.2/mpdf.php");
$html_data = file_get_contents("body-ar.html");
$style_data = file_get_contents("style-ar.css");
// Create new PDF with font subsetting, 210mm wide, 297mm high
$mpdf = new mPDF('s', array(210,297));
// Make it a double sided document with 4mm bleed
$mpdf->mirrorMargins = 1;
$mpdf->bleedMargin = 4;
// Set right to left text
$mpdf->SetDirectionality('rtl');
// Generate the table of contents from H3 elements
$mpdf->h2toc = array('H3'=>0);
// Write the stylesheet
$mpdf->WriteHTML($style_data, 1); // The parameter 1 tells mPDF that this is CSS and not HTML
// Write the main text
$mpdf->WriteHTML($html_data, 2);
// Set the metadata
$mpdf->SetTitle("An Example Title");
$mpdf->SetAuthor("Cicero");
$mpdf->SetCreator("mPDF 6.1.2");
$mpdf->SetSubject("Lorem Ipsum");
$mpdf->SetKeywords("Lorem, Ipsum");
// Generate the PDF file
$mpdf->Output('arabic.pdf','F');
// Stop mPDF
exit;
?>