Пример #1
0
set_time_limit(1800);
set_include_path('../src/' . PATH_SEPARATOR . get_include_path());
include 'Cezpdf.php';
require_once "Mail.php";
class Creport extends Cezpdf
{
    function Creport($p, $o)
    {
        $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;
Пример #2
0
include 'Cezpdf.php';
class Creport extends Cezpdf
{
    public function __construct($p, $o)
    {
        parent::__construct($p, $o, 'none', array());
    }
}
$pdf = new Creport('a4', 'portrait');
// to test on windows xampp
if (strpos(PHP_OS, 'WIN') !== false) {
    $pdf->tempPath = 'C:/temp';
}
// make sure cache is regenerated
$pdf->ezSetCmMargins(1, 3, 2.5, 2.5);
$pdf->selectFont('Times-Roman');
$pdf->ezText("\n\n\n\n\n\n\n\n");
$pdf->ezText("\n\n\n", 12);
$_POST['emisor'] = "Test";
$_POST['cargo_emisor'] = "Test 123";
$_POST['vicerrectorado'] = "Test 456";
$_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");
Пример #3
0
    {
        $this->__construct($p, $o, 'none', array());
        $this->isUnicode = true;
        $this->allowedTags .= '|uline';
        // always embed the font for the time being
        //$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
Пример #4
0
class Creport extends Cezpdf
{
    function Creport($p, $o)
    {
        $this->__construct($p, $o, 'none', array());
    }
}
$pdf = new Creport('a4', 'portrait');
// to test on windows xampp
if (strpos(PHP_OS, 'WIN') !== false) {
    $pdf->tempPath = 'C:/temp';
}
// IMPORTANT: In version >= 0.12.0 it is required to allow custom tags (by using $pdf->allowedTags) before using it
$pdf->allowedTags .= "|comment:.*?";
$pdf->ezSetMargins(20, 20, 20, 20);
$pdf->selectFont('Helvetica');
$pdf->ezText("Some annotations are only shown in Adobe Reader. Chrome Viewer for instance does not show the icons\n");
// text annotation (also know as comments)
$pdf->ezText("<b>The 'Text' annotation:</b>");
$pdf->ezText("This Example shows how easy it is to put comments like this (<C:comment:Hello World comment text>) in between of some text lines.\nHere is another one <C:comment:Isn't it cool?> in between\n");
$pdf->addComment("Fixed position", "This comment is set to a fixed position by\nusing the addComment method explicitly", 500, $pdf->y + 20);
// external links
$pdf->ezText("<strong>The 'External Link' annotation:</strong>");
$pdf->ezText("This is an <c:alink:http://pdf-php.sf.net>external</c:alink> link.\n");
// internal links
$pdf->addDestination('test001', 'FitH', $pdf->y);
$pdf->ezText("<strong>The 'Internal Link' annotation:</strong>");
$pdf->ezText("Followed by an <c:ilink:test001>internal</c:ilink> link which requires to set a destination first. Use \$pdf->addDestination() before adding internal links.\n");
$pdf->ezText("More annotations soon...");
if (isset($_GET['d']) && $_GET['d']) {
    echo $pdf->ezOutput(TRUE);
Пример #5
0
error_reporting(E_ALL);
set_include_path('../src/' . PATH_SEPARATOR . get_include_path());
date_default_timezone_set('UTC');
include 'Cezpdf.php';
class Creport extends Cezpdf
{
    public function __construct($p, $o)
    {
        parent::__construct($p, $o, 'none', array());
    }
}
$pdf = new Creport('a4', 'portrait');
// to test on windows xampp
if (strpos(PHP_OS, 'WIN') !== false) {
    $pdf->tempPath = 'C:/temp';
}
$pdf->ezSetMargins(20, 20, 20, 20);
$pdf->openHere('Fit');
$pdf->selectFont('Helvetica');
$pdf->ezText("Text in Helvetica");
$pdf->selectFont('Courier');
$pdf->ezText("Text in Courier");
$pdf->selectFont('Times-Roman');
$pdf->ezText("Text in Times New Roman");
$pdf->selectFont('ZapfDingbats');
$pdf->ezText("Text in zapfdingbats");
if (isset($_GET['d']) && $_GET['d']) {
    echo $pdf->ezOutput(TRUE);
} else {
    $pdf->ezStream(array('compress' => 0));
}
Пример #6
0
$ypos = 540;
// vertical starting position
$font_size_8 = 8;
$font_size_10 = 10;
$font_size_12 = 12;
$font_size_14 = 14;
$row_spacing = 15;
// ---------- COLUMN POSITIONS BEGIN ----------
$x1 = array('justification' => 'left', 'left' => 1, 'spacing' => 0);
$x1b = array('justification' => 'full', 'left' => 1, 'spacing' => 1);
$x1c = array('justification' => 'left', 'left' => 1, 'spacing' => 1.5);
$x4 = array('justification' => 'left', 'left' => 645, 'spacing' => 0);
$x5 = array('justification' => 'right', 'right' => 0, 'spacing' => 0);
// ---------- COLUMN POSITIONS END ----------
// ---------- COLUMN HEADER VALUES BEGIN ----------
$pdf->selectFont('Helvetica-Bold');
$title = "Program Plan Narrative";
$title_width = $pdf->getTextWidth($font_size_14, "{$title}");
$title_position = 420.95 - $title_width * 0.5;
// ---------- COLUMN HEADER VALUES END ----------
$prev_dept = "ZZZZ";
$curr_dept = " ";
$curr_progid = "XXXXXXXX";
$prev_progid = " ";
$total_flag = "no";
$new_page_flag = "no";
// ---------- PRINTS HEADER AND FOOTER BEGINS ----------
$pdf->selectFont('Helvetica-Bold');
$all = $pdf->openObject();
$pdf->saveState();
$pdf->addText($title_position, $ypos, $font_size_14, $title);
Пример #7
0
 $data5 = array();
 while ($regexp = $stmt->fetch(PDO::FETCH_ASSOC)) {
     $data5[] = array('Nombre Contratante' => $regexp['nombre_contratante'], 'Objeto del Contrato' => $regexp['objeto_contrato'], 'Departamento' => $regexp['departamento'], 'Lugar del contrato' => $regexp['lugar_contrato'], 'Monto del Contrato' => $regexp['monto_contrato'], 'Descripcion del Contrato' => $regexp['descripcion_contrato'], 'Tipo Experiencia' => $regexp['tipo'], 'Fecha Inicio' => $regexp['inicio_contrato'], 'Fecha Fin' => $regexp['fin_contrato'], 'Meses' => $regexp['meses'], 'Verifique' => '[  ]');
 }
 // FIN experiencia
 //print_r($data1);
 //print_r($data12);
 //print_r($data13);
 //print_r($data2);break;
 //$fecha = date("F j, Y");
 //$fecha = date();
 setlocale(LC_TIME, "es_ES");
 $fecha = strftime("%d de %B del %Y");
 $pdf = new Creport('a4', 'landscape');
 $pdf->ezSetMargins(20, 70, 20, 20);
 $pdf->selectFont('./fonts/Helvetica');
 $pdf->ezText('CONSULTOR', 20, array('justification' => 'center'));
 $pdf->ezText('AEVIVIENDA                                                                                      <c:uline>Registro #</c:uline>  ' . $idregistro_entidad, 11, array('justification' => 'center'));
 $pdf->ezText('www.aevivienda.gob.bo                                                                      <c:uline>Fecha Actual:</c:uline>  ' . $fecha, 11, array('justification' => 'center'));
 $pdf->ezText('');
 $pdf->ezText('DATOS GENERALES', 15, array('justification' => 'left'));
 $pdf->ezTable($data1, '', 'Datos Provenientes Durante el Registro', array('width' => 560, 'maxWidth' => 600, 'fontSize' => 7));
 $pdf->ezText('');
 $pdf->ezText('DATOS ESPECIFICOS', 15, array('justification' => 'left'));
 $pdf->ezTable($data12, '', 'Datos Provenientes Durante el Registro', array('width' => 560, 'maxWidth' => 600, 'fontSize' => 7));
 $pdf->ezText('');
 $pdf->ezText('DATOS COMPLEMENTARIOS', 15, array('justification' => 'left'));
 $pdf->ezTable($data13, '', 'Datos Provenientes Durante el Registro', array('width' => 560, 'maxWidth' => 600, 'fontSize' => 7));
 $footer = $pdf->openObject();
 $pdf->addText(500, 30, 8, "TECNICO");
 $pdf->line(490, 40, 600, 40);
Пример #8
0
$pdf->saveState();
$pdf->setStrokeColor(0, 0, 0, 1);
$pdf->line(20, 40, 578, 40);
$pdf->line(20, 822, 578, 822);
$pdf->addText(50, 34, 6, 'http://ros.co.nz/pdf - http://www.sourceforge.net/projects/pdf-php');
$pdf->restoreState();
$pdf->closeObject();
// note that object can be told to appear on just odd or even pages by changing 'all' to 'odd'
// or 'even'.
$pdf->addObject($all, 'all');
$pdf->ezSetDy(-100);
//$mainFont = './fonts/Helvetica.afm';
$mainFont = './fonts/Times-Roman.afm';
$codeFont = './fonts/Courier.afm';
// select a font
$pdf->selectFont($mainFont);
$pdf->ezText("PHP Pdf Creation\n", 30, array('justification' => 'centre'));
$pdf->ezText("Module-free creation of Pdf documents\nfrom within PHP\n", 20, array('justification' => 'centre'));
$pdf->ezText("developed by R&OS Ltd\n<c:alink:http://www.ros.co.nz/pdf/>http://www.ros.co.nz/pdf</c:alink>", 18, array('justification' => 'centre'));
$pdf->ezText("\n<c:alink:http://sourceforge.net/projects/pdf-php>http://sourceforge.net/projects/pdf-php</c:alink>\n\nversion 0.09", 18, array('justification' => 'centre'));
$pdf->ezSetDy(-100);
// modified to use the local file if it can
$pdf->openHere('Fit');
function ros_logo(&$pdf, $x, $y, $height, $wl = 0, $wr = 0)
{
    $pdf->saveState();
    $h = 100;
    $factor = $height / $h;
    $pdf->selectFont('./fonts/Helvetica-Bold.afm');
    $text = 'R&OS';
    $ts = 100 * $factor;