当前位置: 首页>>代码示例>>PHP>>正文


PHP FPDF::SetCompression方法代码示例

本文整理汇总了PHP中FPDF::SetCompression方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::SetCompression方法的具体用法?PHP FPDF::SetCompression怎么用?PHP FPDF::SetCompression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FPDF的用法示例。


在下文中一共展示了FPDF::SetCompression方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: FPDF

if (isset($_GET['sonuc'])) {
    $readerUTime = $_GET['readerUTime'];
    $pdf = new FPDF('L', 'mm', 'A4');
    $tabanhesabi = null;
    AddPage($readerUTime);
    $pdf->SetXY(15, 120);
    $pdf->Cell(200, 5, "Genel baþarý seviyesi deðerlendirmesidir.", 0, 0, 'L');
    $tabanhesabi = 0;
    AddPage($readerUTime);
    $pdf->SetXY(15, 120);
    $pdf->Cell(200, 5, "Sadece \" {$tabanhesabi} \" baþarý seviyesinden büyük olanlarýn deðerlendirmesidir.", 0, 0, 'L');
    $tabanhesabi = 50;
    AddPage($readerUTime);
    $pdf->SetXY(15, 120);
    $pdf->Cell(200, 5, "Sadece \" {$tabanhesabi} \" baþarý seviyesinden büyük olanlarýn deðerlendirmesidir.", 0, 0, 'L');
    $pdf->SetCompression(true);
    $pdf->Output();
} else {
    ?>
<html>
<head><title>OMR</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" /></head>
<body>
<form id="form1" name="form1" method="get" action="">
<table border="1" cellspacing="0" cellpadding="5">
<tr><td colspan="2">Rapor PDF Çiktisi</td></tr>
<tr><td colspan="2">Optik Form Kayit Tarihi</td>
</tr><tr><td><label for="readerUTime"></label>
<select name="readerUTime" id="readerUTime">
<?php 
    $result = mysql_query("SELECT `utime` FROM `d_reader` GROUP BY `utime` ORDER BY `utime` DESC");
开发者ID:naimakin,项目名称:BitirmeProjesi,代码行数:31,代码来源:a4pdfrapor.php

示例2:

	}

	// création du document
	$pdf->SetCreator($gepiSchoolName);
	// auteur du document
	$pdf->SetAuthor($gepiSchoolName);
	// mots clé
	$pdf->SetKeywords('');
	// sujet du document
	$pdf->SetSubject('Bilan journalier des absences');
	// titre du document
	$pdf->SetTitle('Bilan journalier des absences');
	// méthode d'affichage du document à son ouverture
	$pdf->SetDisplayMode('fullwidth', 'single');
	// compression du document
	$pdf->SetCompression(TRUE);
	// change automatiquement de page à 5mm du bas
	$pdf->SetAutoPageBreak(TRUE, 5);


/* **************************** */
/* début de la boucle des pages */

// comptage du nombre de page traité
$nb_page_traite = 0;

// initialiser la variable compteur de ligne passé pour le tableau
$nb_ligne_passe = 0;

// initialiser un compteur temporaire autre que i
// il serviras pour savoir à quelle endroit de la liste nous somme rendus
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:bilan_absences_quotidien_pdf.php

示例3: parse_pdf_content

function parse_pdf_content($content, $member_id)
{
    // parse text content from Smarty to pdf content
    global $db, $config, $t;
    $pdf_content = '';
    $margins = array(mm_to_pt(20), mm_to_pt(20), mm_to_pt(20), mm_to_pt(20));
    //left, top, right, bottom (in points) 56pt ~= 20mm
    $font_size = 14;
    //points
    $pdf = new FPDF('P', 'pt', 'A4');
    // portrait, A4
    $pdf->SetCompression(false);
    $pdf->SetMargins($margins[0], $margins[1], $margins[2]);
    //only left, top, right margins. bottom margin equals to 20mm by default.
    $pdf->SetTitle('Your Invoice');
    $pdf->SetSubject('*** Your Payment');
    $pdf->SetAuthor('aMember');
    $pdf->AddPage();
    $pdf->SetFont('Arial', '', $font_size);
    $current_x = $pdf->GetX();
    $current_y = $pdf->GetY();
    $width = mm_to_pt(210);
    $height = mm_to_pt(270);
    $width = $width - $margins[0] - $margins[2];
    // target width
    $height = $height - $margins[1] - $margins[3];
    // target height
    $image = $config['root_dir'] . "/logo.jpg";
    // logo path to include in pdf at top-right corner
    if (is_file($image)) {
        $size = getimagesize($image);
        $x = $width - $size[0] + $margins[0];
        $y = $current_y;
        $pdf->Image($image, $x, $y, $size[0], $size[1]);
        // use original size
        $current_y += $size[1];
    }
    $current_y += $font_size;
    //pt
    $contacts = explode("\n", $config['invoice_contacts']);
    // output contact information right-aligned
    $max_length = 0;
    foreach ($contacts as $row) {
        $row = trim($row);
        $length = $pdf->GetStringWidth($row);
        if ($length > $max_length) {
            $max_length = $length;
        }
    }
    $x = $width - $max_length + $margins[0];
    $y = $current_y;
    foreach ($contacts as $row) {
        $row = trim($row);
        $attr = get_font_styles($row);
        $pdf->SetFont('Arial', $attr, $font_size);
        $pdf->Text($x, $y, strip_tags($row));
        $y += $font_size;
    }
    $current_y = $y;
    $pdf->SetFont('Arial', '', $font_size);
    //return font settings
    // customer contacts
    $u = $db->get_user($member_id);
    if (!$t) {
        $t =& new_smarty();
    }
    $t->assign('u', $u);
    $cust_contacts = $t->fetch('mail_receipt_contact.pdf.txt');
    $cust_contacts = explode("\n", $cust_contacts);
    // output contact information left-aligned
    $num_rows = count($contacts);
    $x = $margins[0];
    $y = $current_y - $font_size * $num_rows;
    // $num_rows rows up from contact information and output customer data
    foreach ($cust_contacts as $row) {
        $row = trim($row);
        $attr = get_font_styles($row);
        $pdf->SetFont('Arial', $attr, $font_size);
        $pdf->Text($x, $y, strip_tags($row));
        $y += $font_size;
    }
    $current_y = $y;
    /*
    $y = $current_y - $font_size * 4; // 4 rows up from contact information and output customer data
    
    $string = $u['name_f'] . ' ' . $u['name_l'];
    $pdf->Text ($x, $y, $string);
    $y += $font_size;
    
    $string = $u['street'];
    $pdf->Text ($x, $y, $string);
    $y += $font_size;
    
    $string = $u['zip'] . ' ' . $u['city'];
    $pdf->Text ($x, $y, $string);
    $y += $font_size;
    
    	$state = db_getStateByCode($u['country'], $u['state']);
    	$country = db_getCountryByCode($u['country']);
    $string = $state .  ' '  . $country;
//.........这里部分代码省略.........
开发者ID:subashemphasize,项目名称:test_site,代码行数:101,代码来源:common.inc.php

示例4: FPDF

 /**
  * Download task list as attachment
  *
  * @access public
  * @param void
  * @return null
  */
 function download_list()
 {
     $task_list = ProjectTaskLists::findById(get_id());
     if (!$task_list instanceof ProjectTaskList) {
         flash_error(lang('task list dnx'));
         $this->redirectTo('task');
     }
     // if
     $this->canGoOn();
     if (!$task_list->canView(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectToReferer(get_url('task'));
     }
     // if
     $output = array_var($_GET, 'output', 'csv');
     $project_name = active_project()->getName();
     $task_list_name = $task_list->getName();
     $task_count = 0;
     if ($output == 'pdf') {
         Env::useLibrary('fpdf');
         $download_name = "{$project_name}-{$task_list_name}-tasks.pdf";
         $download_type = 'application/pdf';
         $pdf = new FPDF();
         $pdf->AddPage();
         $pdf->SetTitle($task_list_name);
         $pdf->SetCompression(true);
         $pdf->SetCreator('ProjectPier');
         $pdf->SetDisplayMode(fullpage, single);
         $pdf->SetSubject(active_project()->getObjectName());
         $pdf->SetFont('Arial', 'B', 16);
         $task_lists = active_project()->getOpenTaskLists();
         $pdf->Cell(0, 10, lang('project') . ': ' . active_project()->getObjectName(), 'C');
         $pdf->Ln();
         foreach ($task_lists as $task_list) {
             $pdf->SetFont('Arial', 'B', 14);
             $pdf->Write(10, lang('task list') . ': ' . $task_list->getObjectName());
             $pdf->Ln();
             $tasks = $task_list->getTasks();
             $line = 0;
             // Column widths
             $w = array(10, 0, 0);
             // Header
             //for($i=0;$i<count($header);$i++)
             //  $this->Cell($w[$i],7,$header[$i],1,0,'C');
             //$this->Ln();
             $pdf->SetFont('Arial', 'I', 14);
             foreach ($tasks as $task) {
                 $line++;
                 if ($task->isCompleted()) {
                     $task_status = lang('completed');
                     $pdf->SetTextColor(100, 200, 100);
                     $task_completion_info = lang('completed task') . ' : ' . format_date($task->getCompletedOn());
                 } else {
                     $task_status = lang('open');
                     $pdf->SetTextColor(255, 0, 0);
                     $task_completion_info = lang('due date') . ' : ' . lang('not assigned');
                     if ($task->getDueDate()) {
                         $task_completion_info = lang('due date') . ' : ' . format_date($task->getDueDate());
                     }
                 }
                 if ($task->getAssignedTo()) {
                     $task_assignee = $task->getAssignedTo()->getObjectName();
                 } else {
                     $task_assignee = lang('not assigned');
                 }
                 $pdf->Cell($w[0], 6, $line);
                 $pdf->Cell($w[2], 6, $task_status, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Cell($w[2], 6, $task_completion_info, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Cell($w[2], 6, $task_assignee, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->MultiCell($w[2], 6, $task->getText(), "TLRB");
                 $pdf->Ln();
             }
         }
         $pdf->Output($download_name, 'D');
     } else {
         $download_name = "{$project_name}-{$task_list_name}-tasks.txt";
         $download_type = 'text/csv';
         $download_contents = $task_list->getDownloadText($task_count, "\t", true);
         download_contents($download_contents, $download_type, $download_name, strlen($download_contents));
     }
     die;
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:98,代码来源:TaskController.class.php

示例5: FPDF

 /**
  * Download task list as attachment
  *
  * @access public
  * @param void
  * @return null
  */
 function download_list()
 {
     $task_list = ProjectTaskLists::findById(get_id());
     if (!$task_list instanceof ProjectTaskList) {
         flash_error(lang('task list dnx'));
         $this->redirectTo('task');
     }
     // if
     $this->canGoOn();
     if (!$task_list->canView(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectToReferer(get_url('task'));
     }
     // if
     $output = array_var($_GET, 'output', 'csv');
     $project_name = active_project()->getName();
     $task_list_name = $task_list->getName();
     $task_count = 0;
     if ($output == 'pdf') {
         Env::useLibrary('fpdf');
         $download_name = "{$project_name}-tasks.pdf";
         $download_type = 'application/pdf';
         $pdf = new FPDF("P", "mm");
         $pdf->AddPage();
         $pdf->SetTitle($project_name);
         $pdf->SetCompression(true);
         $pdf->SetCreator('ProjectPier');
         $pdf->SetDisplayMode('fullpage', 'single');
         $pdf->SetSubject(active_project()->getObjectName());
         $pdf->SetFont('Arial', 'B', 16);
         $task_lists = active_project()->getOpenTaskLists();
         $pdf->Cell(0, 10, lang('project') . ': ' . active_project()->getObjectName(), 'B', 0, 'C');
         $pdf->Ln(14);
         $w = array(0 => 12, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 120, 140);
         foreach ($task_lists as $task_list) {
             $pdf->SetFont('Arial', 'B', 14);
             $pdf->Write(10, lang('task list') . ': ' . $task_list->getObjectName());
             $pdf->Ln(14);
             $tasks = $task_list->getTasks();
             $pdf->SetFont('Arial', 'I', 14);
             $pdf->SetFillColor(230, 230, 230);
             $pdf->Cell($w[1], 6, '#', 1, 0, 'C', true);
             $pdf->Cell($w[3], 6, lang('status'), 1, 0, 'C', true);
             $pdf->Cell($w[10], 6, lang('info'), 1, 0, 'C', true);
             $pdf->Cell(0, 6, lang(user), 1, 0, 'C', true);
             $pdf->Ln();
             foreach ($tasks as $task) {
                 $line++;
                 if ($task->isCompleted()) {
                     $task_status = lang('completed');
                     $task_status_color_R = 0;
                     $task_status_color_G = 150;
                     $task_status_color_B = 0;
                     $task_completion_info = lang('completed task') . ' : ' . format_date($task->getCompletedOn()) . ' @ ' . format_time($task->getCompletedOn());
                 } else {
                     $task_status = lang('open');
                     $task_status_color_R = 200;
                     $task_status_color_G = 0;
                     $task_status_color_B = 0;
                     $task_completion_info = lang('due date') . ' : ' . lang('not assigned');
                     $task_completion_info_color_R = 200;
                     $task_completion_info_color_G = 0;
                     $task_completion_info_color_B = 0;
                     if ($task->getDueDate()) {
                         $task_completion_info = lang('due date') . ' : ' . format_date($task->getDueDate()) . ' @ ' . format_time($task->getDueDate());
                         $task_completion_info_color_R = 0;
                         $task_completion_info_color_G = 0;
                         $task_completion_info_color_B = 0;
                     }
                 }
                 if ($task->getAssignedTo()) {
                     $task_assignee = $task->getAssignedTo()->getObjectName();
                     $task_assignee_color_R = 0;
                     $task_assignee_color_G = 0;
                     $task_assignee_color_B = 0;
                 } else {
                     $task_assignee = lang('not assigned');
                     $task_assignee_color_R = 200;
                     $task_assignee_color_G = 0;
                     $task_assignee_color_B = 0;
                 }
                 $pdf->SetFillColor(245, 245, 245);
                 $pdf->Cell($w[1], 6, $line, 1, 0, 'C', true);
                 $pdf->SetTextColor($task_status_color_R, $task_status_color_G, $task_status_color_B);
                 $pdf->Cell($w[3], 6, $task_status, 1, 0, 'C', true);
                 $pdf->SetTextColor($task_completion_info_color_R, $task_completion_info_color_G, $task_completion_info_color_B);
                 $pdf->Cell($w[10], 6, $task_completion_info, 1, 0, 'C', true);
                 $pdf->SetTextColor($task_assignee_color_R, $task_assignee_color_G, $task_assignee_color_B);
                 $pdf->Cell(0, 6, $task_assignee, 1, 0, 'C', true);
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Ln();
                 $pdf->MultiCell(0, 6, $task->getText(), 1);
                 //$pdf->Ln();
//.........这里部分代码省略.........
开发者ID:federosky,项目名称:ProjectPier-Core,代码行数:101,代码来源:TaskController.class.php


注:本文中的FPDF::SetCompression方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。