Пример #1
0
        //$this->embedFont = false;
    }
}
$pdf = new Creport('a4', 'portrait');
$pdf->ezSetMargins(20, 20, 20, 20);
//$pdf->rtl = true; // all text output to "right to left"
//$pdf->setPreferences('Direction','R2L'); // optional: set the preferences to "Right To Left"
$f = isset($_GET['font']) ? $_GET['font'] : 'FreeSerif';
$mainFont = $f;
// select a font and use font subsetting
$pdf->selectFont($mainFont, '', 1, true);
$pdf->ezText("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidfgfdgdfgdfgdfg ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur. et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur", 10, array('justification' => 'full'));
$pdf->ezText("\nGreek: (full justified)");
$pdf->ezText("Νες εα ελεστραμ σορρυμπιθ ινστρυσθιορ, υσυ διαμ ωπωρθεαθ τεμποριβυς ετ. Προμπτα βλανδιτ μωδερατιυς ευμ ευ, σεθερο ρεπυδιαρε αν φελ, φιξ πυρθο ρεγιονε φολυπθυα ατ. Σιθ δυις σωνσυλ ιρασυνδια ατ, νε νιηιλ φενιαμ φεριθυς ιυς, συ μελιορε ερροριβυς δισπυθανδο εσθ. Ηις εσεντ σοπιωσαε ιδ. Εξ εως μεις αυγυε ρεσυσαβο, φιξ φοσεντ μαλορυμ ινσιδεριντ ιν. Δισο ναθυμ σοντεντιωνες ευ μει.", 10, array('justification' => 'full'));
$pdf->ezText("\nCyrillic:");
$pdf->ezText("ыёюз лобортис ажжынтиор ыёюз лобортис ажжынтиор ыёюз лобортис ажжынтиор ыёюз лобортис ажжынтиор ыёюз лобортис ажжынтиор ыёюз лобортис ажжынтиор ыёюз лобортис ажжынтиор ыёюз лобортис ажжынтиор ыёюз лобортис ажжынтиор <u>КкЛлМмНнО</u> <u>оПпРр</u> <u>СсТтУу</u>");
$pdf->ezText("\nArabic:");
$pdf->ezText("لبسبيلتتاف لالبالفقث بببب");
$pdf->ezText("\nHebrew:");
$pdf->ezText("אבגדהוזחטיכלמנסעפצקרשת");
$pdf->ezText("\nChinese:");
$pdf->ezText("汉语/漢語 <- Some fonts might not contain these glyphs. Tested with Arial Unicode");
//$pdf->isUnicode = false;
//$pdf->selectFont('../src/fonts/Courier');
//$pdf->ezText("\nThis text is using Courier in a non-unicode standard");
// reusing the mainFont does not require to enable unicode with $this->isUnicode
if (isset($_GET['d']) && $_GET['d']) {
    echo $pdf->ezOutput(TRUE);
} else {
    $pdf->ezStream();
}
Пример #2
0
        $this->__construct($p, $o, 'none');
    }
}
$pdf = new Creport('a4', 'portrait');
$pdf->ezSetMargins(20, 20, 20, 20);
$mainFont = 'Times-Roman';
// select a font
$pdf->selectFont($mainFont);
$size = 12;
$height = $pdf->getFontHeight($size);
// modified to use the local file if it can
$pdf->openHere('Fit');
$pdf->ezText("PNG grayscaled with alpha channel");
$pdf->ezImage('images/test_grayscaled_alpha.png', 0, 0, 'none', 'right');
if (isset($_GET['d']) && $_GET['d']) {
    $pdfcode = $pdf->ezOutput(1);
    $pdfcode = str_replace("\n", "\n<br>", htmlspecialchars($pdfcode));
    echo '<html><body>';
    echo trim($pdfcode);
    echo '</body></html>';
} else {
    //$pdf->ezStream(array('compress'=>0));
    //die;
    //$pdf->options['compression']=0;
    $doc = $pdf->ezOutput();
    $recipients = array('*****@*****.**');
    /* boundary */
    $boundary = strtoupper(md5(uniqid(time())));
    $headers = array('From' => '*****@*****.**', 'To' => join(', ', $recipients), 'Subject' => 'Test compressed pdf', 'Content-type' => 'multipart/mixed; boundary=' . $boundary, 'MIME-Version' => '1.0');
    $body = "This is a multi-part message in MIME format  --  Dies ist eine mehrteilige Nachricht im MIME-Format\n";
    /* Hier faengt der normale Mail-Text an */
Пример #3
0
$_POST['profesor'] = "Test 456";
$_POST['créditos'] = "Test 456";
$_POST['curso'] = "Test 456";
$_POST['master'] = "Test 456";
$_POST['asignatura'] = "Test 456";
//$pdf->selectFont('Times-Bold');
$txtintro = $_POST['emisor'] . ", " . $_POST['cargo_emisor'] . " DEL " . $_POST['vicerrectorado'] . ",\n\n";
$pdf->ezText($txtintro, 12, array('spacing' => 1.5, 'justification' => 'full'));
//$pdf->selectFont('Times-Roman');
$pdf->ezText("INFORMA:\n\n");
$pdf->ezSetCmMargins(1, 3, 4, 4);
$pdf->ezText("Que según la documentación existente en este Secretariado, <strong>" . $_POST['profesor'] . "</strong> ha impartido docencia durante el curso " . $_POST['curso'] . " en el Máster Universitario en <b>" . $_POST['master'] . "</b>, impartiendo la asignatura <b><i>\"" . $_POST['asignatura'] . "\"</b></i>, perteneciente al primer cuatrimestre, con una docencia de " . $_POST['créditos'] . " créditos ECTS en la misma.\n", 0, array('spacing' => 1.5, 'justification' => 'full'));
$pdf->ezSetCmMargins(1, 3, 4, 4.3);
$pdf->ezText("\n\n", 11);
//$pdf->ezText("Y para que así conste y surta efecto, a petición del interesado/a firmo la presente, en Jaén, ".date('d'). " de ".$mesesEspanyol[date('n')-1]. " de ".date('Y').".", 12, array('spacing'=>1.5,'justification'=> 'full'));
$pdf->ezText("\n", 11);
$pdf->ezText("\n");
$pdf->ezText($_POST['cargo_emisor'], 11, array('justification' => 'center'));
$pdf->ezText("\n\n\n\n\n\n", 11);
$pdf->ezText($_POST['emisor'], 11, array('justification' => 'center'));
if (isset($_GET['d']) && $_GET['d']) {
    $pdfcode = $pdf->ezOutput(1);
    $pdfcode = str_replace("\n", "\n<br>", $pdfcode);
    echo '<html><body>';
    echo trim($pdfcode);
    echo '</body></html>';
} else {
    $pdf->ezStream(array('compress' => 0));
}
$end = microtime(true) - $start;
error_log($end . ' o');