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


PHP pdf::Write方法代码示例

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


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

示例1: datenbank

		function ma2_pdf($id){
		$return="";
		$db=new datenbank();
		$query="select * from rechnungen,mahnungen  where rechnungen.renr=mahnungen.renr and mahnungen.manr='$id'";
		$result=$db->query($query);
		$rechnung=$db->get_object($result);
		$result_kunde=$db->query("select * from kunden where kdnr=$rechnung->kunde");
		$kunde=$db->get_object($result_kunde);
		$pdf=new pdf('P', 'mm', 'A4');
		$pdf->Open();
		$pdf->AddPage();
		$pdf->empfaenger($kunde->firma, $kunde->strasse." ".$kunde->hausnummer, $kunde->plz." ".$kunde->ort, $rechnung->manr, $rechnung->datum);
		$pdf->SetFont('Arial','B',12);
		$pdf->Cell(80,5,"Mahnung");
		$pdf->Ln(10);
		$pdf->SetFont("Arial", "", 10);
		$pdf->Write(5, "Sehr geehrte Damen und Herren,\nleider konnte ich noch keinen Zahlungseingang zur Rechnung $rechnung->renr feststellen. Hier die Auflistung der aufgrund dieser Rechnung unbezahlten Posten::\n\n");
		$query="select posten.datum as Datum, posten.kommentar as Beschreibung, posten.anzahl as Anzahl, produkte.name as Artikel, produkte.preis as Preis, (produkte.preis*posten.anzahl) as Summe from posten, produkte where posten.rechnung='$rechnung->renr' and produkte.id=posten.produkt";
		$result=$db->query($query);
		$header=array("Datum", "Beschreibung", "Anzahl", "Artikel", "Preis", "Summe");
		while($data[]=$db->get_row($result))
		{
		}
		$gammel=array_pop($data);
		$pdf->table($header, $data);
		$pdf->Ln();
		$result=$db->query("SELECT Sum( posten.anzahl * produkte.preis )  AS Gesamt, Sum( posten.anzahl * produkte.preis * mwst.satz / 100  ) AS MWST, mwst.satz FROM posten, produkte, mwst WHERE produkte.id = posten.produkt AND mwst.id = produkte.mwst AND posten.rechnung =  '$rechnung->renr' AND produkte.id!='3' AND produkte.id!='4' GROUP BY mwst.satz");
		$betrag=$db->get_object($result);
		$result=$db->query("SELECT Sum( posten.anzahl * produkte.preis )  AS Gesamt, Sum( posten.anzahl * produkte.preis * mwst.satz / 100  ) AS MWST, mwst.satz FROM posten, produkte, mwst WHERE produkte.id = posten.produkt AND mwst.id = produkte.mwst AND posten.rechnung =  '$rechnung->renr' AND produkte.id ='3' GROUP BY mwst.satz");
		$betrag2=$db->get_object($result);
		$result=$db->query("SELECT Sum( posten.anzahl * produkte.preis )  AS Gesamt, Sum( posten.anzahl * produkte.preis * mwst.satz / 100  ) AS MWST, mwst.satz FROM posten, produkte, mwst WHERE produkte.id = posten.produkt AND mwst.id = produkte.mwst AND posten.rechnung =  '$rechnung->renr' AND produkte.id ='4' GROUP BY mwst.satz");
		$betrag3=$db->get_object($result);
		$pdf->Cell(100,5,"", 0, 0, 'L');
		$pdf->Cell(35,5,"Gesamt:",0,0,'L');
		$pdf->Cell(20,5,number_format(($betrag->Gesamt+$betrag2->Gesamt+$betrag3->Gesamt),2,",",".").EURO, 0, 1, 'R');
		$pdf->Cell(100,5,"", 0, 0, 'L');
		$pdf->Cell(35,5,"Mehrwertsteuer (".number_format($betrag->satz)."%):", 0, 0, 'L');
		$pdf->Cell(20,5,number_format($betrag->MWST,2,",",".").EURO, 0, 1, 'R');
		$pdf->Ln();
		$pdf->Cell(100,5,"", 0, 0, 'L');
		$pdf->Cell(35,5,"Mahnbetrag:", 0, 0, 'L');
		$pdf->Cell(20,5,number_format($betrag2->Gesamt+$betrag->Gesamt+$betrag3->Gesamt+$betrag->MWST,2,",",".").EURO, 0, 1, 'R');
		$pdf->Ln();
		$pdf->Write(5, "Bitte überweisen Sie den oben genannten Betrag bis spätestens zum $rechnung->faellig auf das unten aufgeführte Konto.\nÜber eine weitere Zusammenarbeit mit Ihnen würde ich mich sehr freuen und verbleibe mit freundlichen Grüßen\n");
		$pdf->Ln(15);
		$pdf->Write(5, $GLOBALS["conf"]["rechnung"]["adresse"]["name"]);
		$pdf->Image($GLOBALS["conf"]["rechnung"]["unterschrift"],25,$pdf->GetY()-10,50);
		$this->output=0;
		$pdf->Output();
		return $return;
	}
开发者ID:BackupTheBerlios,项目名称:webfaktura,代码行数:51,代码来源:class.kunden.inc.php

示例2: elang_pluginfile

/**
 * Serves the files from the elang file areas
 *
 * @param   stdClass  $course         the course object
 * @param   stdClass  $cm             the course module object
 * @param   stdClass  $context        the elang's context
 * @param   string    $filearea       the name of the file area
 * @param   array     $args           extra arguments (itemid, path)
 * @param   boolean   $forcedownload  whether or not force download
 * @param   array     $options        additional options affecting the file serving
 *
 * @return  void
 *
 * @category  files
 *
 * @since   0.0.1
 */
function elang_pluginfile($course, $cm, $context, $filearea, array $args, $forcedownload, array $options = array())
{
    global $DB, $CFG, $USER;
    require_once dirname(__FILE__) . '/locallib.php';
    if ($context->contextlevel != CONTEXT_MODULE) {
        send_file_not_found();
    }
    require_login($course, true, $cm);
    if (!has_capability('mod/elang:view', $context)) {
        send_file_not_found();
    }
    if ($filearea == 'subtitle') {
        $vtt = new \Captioning\Format\WebvttFile();
        $idlang = $cm->instance;
        $records = $DB->get_records('elang_cues', array('id_elang' => $idlang), 'begin ASC');
        $elang = $DB->get_record('elang', array('id' => $idlang));
        $options = json_decode($elang->options, true);
        $repeatedunderscore = isset($options['repeatedunderscore']) ? $options['repeatedunderscore'] : 10;
        $i = 0;
        $users = $DB->get_records('elang_users', array('id_elang' => $idlang, 'id_user' => $USER->id), '', 'id_cue,json');
        foreach ($records as $id => $record) {
            if (isset($users[$id])) {
                $data = json_decode($users[$id]->json, true);
            } else {
                $data = array();
            }
            $cue = new \Captioning\Format\WebvttCue(\Captioning\Format\WebvttCue::ms2tc($record->begin), \Captioning\Format\WebvttCue::ms2tc($record->end), Elang\generateCueText(json_decode($record->json, true), $data, '-', $repeatedunderscore));
            $i++;
            $cue->setIdentifier($i);
            $vtt->addCue($cue);
        }
        send_file($vtt->build()->getFileContent(), end($args), 0, 0, true, false, 'text/vtt');
    } elseif ($filearea == 'pdf') {
        $idlang = $cm->instance;
        $records = $DB->get_records('elang_cues', array('id_elang' => $idlang), 'begin ASC');
        $elang = $DB->get_record('elang', array('id' => $idlang));
        $options = json_decode($elang->options, true);
        $repeatedunderscore = isset($options['repeatedunderscore']) ? $options['repeatedunderscore'] : 10;
        require_once $CFG->libdir . '/pdflib.php';
        $doc = new pdf();
        $doc->SetMargins(isset($options['left']) ? $options['left'] : 20, isset($options['top']) ? $options['top'] : 20);
        $doc->SetFont('', '', isset($options['size']) ? $options['size'] : 16);
        $doc->setPrintHeader(false);
        $doc->setPrintFooter(false);
        $doc->AddPage();
        $doc->WriteHtml('<h1>' . sprintf(get_string('pdftitle', 'elang'), $course->fullname) . '</h1>');
        $doc->WriteHtml('<h2>' . sprintf(get_string('pdfsubtitle', 'elang'), Elang\generateTitle($elang, $options), userdate($elang->timecreated, get_string('strftimedaydate'))) . '</h2>');
        $doc->WriteHtml($elang->intro);
        $i = 1;
        foreach ($records as $id => $record) {
            $doc->Write(5, '', '', false, '', true);
            $doc->WriteHtml('<h3>' . sprintf(get_string('pdfcue', 'elang'), $i++, \Captioning\Format\WebvttCue::ms2tc($record->begin), \Captioning\Format\WebvttCue::ms2tc($record->end)) . '</h3>');
            $doc->Write(5, Elang\generateCueText(json_decode($record->json, true), array(), '_', $repeatedunderscore), '', false, '', true);
        }
        send_file($doc->Output('', 'S'), end($args), 0, 0, true, false, 'application/pdf');
    } else {
        $fs = get_file_storage();
        $relativepath = implode('/', $args);
        $fullpath = rtrim('/' . $context->id . '/mod_elang/' . $filearea . '/0/' . $relativepath, '/');
        $file = $fs->get_file_by_hash(sha1($fullpath));
        if (!$file) {
            send_file_not_found();
        }
        send_stored_file($file, 86400, 0, $forcedownload, $options);
    }
}
开发者ID:e-lang,项目名称:moodle-mod_elang,代码行数:83,代码来源:lib.php

示例3: array

require_once($CFG->dirroot.'/local/lib.php'); 
$curid = optional_param ('curid', 0, PARAM_INT);
$userid = optional_param ('userid', 0, PARAM_INT);
$prgid = optional_param ('prgid', 0, PARAM_INT);
$year = optional_param ('year', 0, PARAM_INT);
ob_clean() ;
require_once($CFG->dirroot.'/lib/pdflib.php');

$doc = new pdf;
$doc->setPrintHeader(false);
$doc->setPrintFooter(false);
$doc->AddPage();
$doc->SetFont('times', 'B', 25, '', 'false');
$gradst = $DB->get_record('local_graduation', array('userid'=>$userid, 'curriculumid'=>$curid, 'programid'=>$prgid));
$txt = $DB->get_field('local_school', 'fullname', array('id'=>$gradst->schoolid));
$doc->Write(0, $txt, '', 0, 'C', true, 0, false, false, 20);
$linestyle = array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2', 'phase' => 0, 'color' => array(0, 0, 0));
$doc->Line(10, 22, 200, 22, $linestyle);
$doc->SetFont('times', 'BI', 14, '', 'false');
$txt = get_string('memo', 'local_graduation');
$doc->Write(12, $txt, '', 0, 'C', true, 0, false, false, 20);
$linestyle = array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2', 'phase' => 0, 'color' => array(0, 0, 0));
$doc->Line(80, 30, 130, 30, $linestyle);
$doc->SetFont('times', '', 12, '', 'false');
$gradst = $DB->get_record('local_graduation', array('userid'=>$userid, 'curriculumid'=>$curid, 'programid'=>$prgid));
$gradst->userid;$gradst->programid;$gradst->curriculumid;
$table = '<table>
<tr><td style="width:100px;" align="right"><b>Student Name</b></td><td style="width:170px;"> : ' .''.$DB->get_field('user', 'firstname', array('id'=>$gradst->userid)). ' ' . $DB->get_field('user', 'lastname', array('id'=>$gradst->userid)) . '</td>
<td align="right"><b>'.get_string('studentid', 'local_graduation').'</b></td><td> : ' .''.$DB->get_field('local_userdata', 'serviceid', array('userid'=>$gradst->userid)).'</td></tr>
<tr><td align="right"><b>'.get_string('program', 'local_programs').'</b></td><td> : ' .''.$DB->get_field('local_program', 'fullname', array('id'=>$gradst->programid)).'</td>
<td align="right"><b>'.get_string('curriculum', 'local_curriculum').'</b></td><td> : ' .''.$DB->get_field('local_curriculum', 'fullname', array('id'=>$gradst->curriculumid)).'</td></tr>
开发者ID:anilch,项目名称:Personel,代码行数:31,代码来源:memo_pdf.php


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