本文整理汇总了PHP中PDF::SetCreator方法的典型用法代码示例。如果您正苦于以下问题:PHP PDF::SetCreator方法的具体用法?PHP PDF::SetCreator怎么用?PHP PDF::SetCreator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDF
的用法示例。
在下文中一共展示了PDF::SetCreator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateCodes
public function generateCodes(array $data)
{
$count = (int) $data['count'];
$teacherId = $data['teacher_id'];
$message = $data['message'];
if (is_null($count) || is_null($teacherId)) {
return false;
} else {
try {
\DB::beginTransaction();
$teacher = Authenticator::user($teacherId);
\PDF::setPrintHeader(false);
\PDF::setPrintFooter(false);
\PDF::AddPage();
for ($i = 0; $i < $count; $i++) {
$code = $this->codeRepo->generateCode();
$data = array();
$data = array_add($data, 'student_code', $code);
$data = array_add($data, 'teacher_id', $teacherId);
$code = $this->codeRepo->create($data);
$code->message = $message;
$this->codeRepo->clearModel();
$html = View::make('pages.code')->with('code', $code)->render();
if ($i % 5 === 0 && $i !== 0) {
\PDF::AddPage();
\PDF::writeHTML($html, false, false, false, false, 'L');
} else {
\PDF::writeHTML($html, false, false, false, false, 'L');
}
}
\PDF::SetCreator('');
\PDF::SetAuthor('');
$format = '%s/%s.pdf';
$subpath = sprintf($format, 'pdfs', $teacherId);
$format = '/%s/%s';
$fullpath = sprintf($format, public_path(), $subpath);
\PDF::Output($fullpath, 'F');
\DB::commit();
return $subpath;
} catch (\Exception $ex) {
\Log::error($ex);
\DB::rollback();
return false;
}
}
}
示例2: setup
/**
* PDF Setup - WT_Report_PDF
*/
function setup()
{
parent::setup();
// Setup the PDF class with custom size pages because WT supports more page sizes. If WT sends an unknown size name then the default would be A4
$this->pdf = new PDF($this->orientation, parent::unit, array($this->pagew, $this->pageh), self::unicode, "UTF-8", self::diskcache);
// Setup the PDF margins
$this->pdf->setMargins($this->leftmargin, $this->topmargin, $this->rightmargin);
$this->pdf->SetHeaderMargin($this->headermargin);
$this->pdf->SetFooterMargin($this->footermargin);
//Set auto page breaks
$this->pdf->SetAutoPageBreak(true, $this->bottommargin);
// Set font subsetting
$this->pdf->setFontSubsetting(self::subsetting);
// Setup PDF compression
$this->pdf->SetCompression(self::compression);
// Setup RTL support
$this->pdf->setRTL($this->rtl);
// Set the document information
// Only admin should see the version number
$appversion = WT_WEBTREES;
if (Auth::isAdmin()) {
$appversion .= " " . WT_VERSION;
}
$this->pdf->SetCreator($appversion . " (" . parent::wt_url . ")");
// Not implemented yet - WT_Report_Base::setup()
$this->pdf->SetAuthor($this->rauthor);
$this->pdf->SetTitle($this->title);
$this->pdf->SetSubject($this->rsubject);
$this->pdf->SetKeywords($this->rkeywords);
$this->pdf->setReport($this);
if ($this->showGenText) {
// The default style name for Generated by.... is 'genby'
$element = new CellPDF(0, 10, 0, "C", "", "genby", 1, ".", ".", 0, 0, "", "", true);
$element->addText($this->generatedby);
$element->setUrl(parent::wt_url);
$this->pdf->addFooter($element);
}
}
示例3: PDF
$pdf_data['title'] = $clientObj->title();
$pdf_data['subtitle'] = "subtitle...";
$pdf_data['subsubtitle'] = "subsubtitle...";
$pdf_data['date'] = "date...";
$pdf_data['filename'] = "filename...";
//preg_replace("/[^0-9a-z\-_\.]/i",'', $myts->htmlSpecialChars($article->topic_title()).' - '.$article->title());
$pdf_data['content'] = $clientObj->description();
$pdf_data['author'] = "author...";
echo "test";
//Other stuff
$puff = '<br />';
$puffer = '<br /><br /><br />';
//create the A4-PDF...
$pdf_config['slogan'] = $xoopsConfig['sitename'] . ' - ' . $xoopsConfig['slogan'];
$pdf = new PDF();
$pdf->SetCreator($pdf_config['creator']);
$pdf->SetTitle($pdf_data['title']);
$pdf->SetAuthor($pdf_config['url']);
$pdf->SetSubject($pdf_data['author']);
$out = $pdf_config['url'] . ', ' . $pdf_data['author'] . ', ' . $pdf_data['title'] . ', ' . $pdf_data['subtitle'] . ', ' . $pdf_data['subsubtitle'];
$pdf->SetKeywords($out);
$pdf->SetAutoPageBreak(true, 25);
$pdf->SetMargins($pdf_config['margin']['left'], $pdf_config['margin']['top'], $pdf_config['margin']['right']);
$pdf->Open();
//First page
$pdf->AddPage();
$pdf->SetXY(24, 25);
$pdf->SetTextColor(10, 60, 160);
$pdf->SetFont($pdf_config['font']['slogan']['family'], $pdf_config['font']['slogan']['style'], $pdf_config['font']['slogan']['size']);
$pdf->WriteHTML($pdf_config['slogan'], $pdf_config['scale']);
//$pdf->Image($pdf_config['logo']['path'],$pdf_config['logo']['left'],$pdf_config['logo']['top'],$pdf_config['logo']['width'],$pdf_config['logo']['height'],'',$pdf_config['url']);
示例4: Footer
function Footer()
{
//Position at 1.5 cm from bottom
$this->SetY(-15);
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Page number
$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
}
}
$pdf = new PDF('L', $unit = 'mm', $format = 'A4');
$pdf->AliasNbPages();
$pdf->SetAuthor("imranzahid+nexexcel@gmail.com");
$pdf->SetSubject("Daily Sales");
$pdf->SetTitle("Daily Sales");
$pdf->SetCreator("Imran Zahid");
$prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'color3' => array(128, 128, 128), 'padding' => 2, 'font' => array('Arial', '', 10), 'thfont' => array('Arial', 'B', 10));
$pdf->AddPage();
$pdf->AddCol('party_name', "20%", 'Party', 'L');
$pdf->AddCol('vendor', "20%", 'Vendor', 'L');
$pdf->AddCol('cat_name', "20%", 'Category', 'L');
$pdf->AddCol('description', "20%", 'Item', 'L');
$pdf->AddCol("cs", "10%", 'CS', 'R');
$pdf->AddCol("pc", "10%", 'PC', 'R');
$pdf->Table($data, $prop);
$_cMargin = $pdf->cMargin;
$pdf->cMargin = $prop['padding'];
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(221.59806666667, 6, "Total", 1, 0, 'C');
$pdf->Cell(27.69975833333, 6, $totals['cs'], 1, 0, 'R');
$pdf->Cell(27.69975833333, 6, $totals['pc'], 1, 0, 'R');
示例5: basket
public function basket()
{
$this->start = $this->input->get('start');
$this->end = $this->input->get('end');
$this->view = "";
if (isset($_GET['view']) && $_GET['view'] != "") {
$this->view = pnp::clean($_GET['view']);
}
$this->data->getTimeRange($this->start, $this->end, $this->view);
$basket = $this->session->get("basket");
if (is_array($basket) && sizeof($basket) > 0) {
foreach ($basket as $item) {
# explode host::service::source
$slices = explode("::", $item);
if (sizeof($slices) == 2) {
$this->data->buildDataStruct($slices[0], $slices[1], $this->view);
}
if (sizeof($slices) == 3) {
$this->data->buildDataStruct($slices[0], $slices[1], $this->view, $slices[2]);
}
}
}
//echo Kohana::debug($this->data->STRUCT);
/*
* PDF Output
*/
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->SetAutoPageBreak('off');
$pdf->SetMargins(17.5, 30, 10);
$pdf->AddPage();
if ($this->use_bg) {
$pdf->setSourceFile($this->config->conf['background_pdf']);
$tplIdx = $pdf->importPage(1, '/MediaBox');
$pdf->useTemplate($tplIdx);
}
$pdf->SetCreator('Created with PNP');
$pdf->SetFont('Arial', '', 10);
// Title
foreach ($this->data->STRUCT as $data) {
if ($pdf->GetY() > 200) {
$pdf->AddPage();
if ($this->use_bg) {
$pdf->useTemplate($tplIdx);
}
}
if ($data['LEVEL'] == 0) {
$pdf->SetFont('Arial', '', 12);
$pdf->CELL(120, 10, $data['MACRO']['DISP_HOSTNAME'] . " -- " . $data['MACRO']['DISP_SERVICEDESC'], 0, 1);
$pdf->SetFont('Arial', '', 10);
$pdf->CELL(120, 5, $data['TIMERANGE']['title'] . " (" . $data['TIMERANGE']['f_start'] . " - " . $data['TIMERANGE']['f_end'] . ")", 0, 1);
$pdf->SetFont('Arial', '', 8);
$pdf->CELL(120, 5, "Datasource " . $data["ds_name"], 0, 1);
} else {
$pdf->SetFont('Arial', '', 8);
$pdf->CELL(120, 5, "Datasource " . $data["ds_name"], 0, 1);
}
$image = $this->rrdtool->doImage($data['RRD_CALL'], $out = 'PDF');
$img = $this->rrdtool->saveImage($image);
$Y = $pdf->GetY();
$cell_height = $img['height'] * 0.23;
$cell_width = $img['width'] * 0.23;
$pdf->Image($img['file'], 17.5, $Y, $cell_width, $cell_height, 'PNG');
$pdf->CELL(120, $cell_height, '', 0, 1);
unlink($img['file']);
}
$pdf->Output("pnp4nagios.pdf", "I");
}
示例6: array
$logger->write('Found ' . $products_total . ' products >1 star');
while ($row = tep_db_fetch_array($result)) {
$row['fmargin'] = number_format($row['margin'], 1) . '%';
$row['weekly'] = array();
$row['total_sold_L4W'] = 0;
foreach ($weekly_name as $wkey => $wn) {
$row['weekly'][$wkey] = getOrderWeekly($row['products_id'], $wkey, $filter_date, $sp_list);
$row['total_sold_L4W'] += $row['weekly'][$wkey]['total_sold'];
}
$products[$row['catid']][$row['products_id']] = $row;
}
$logger->write('Creating PDF File');
$pdf = new PDF('P', 'mm', 'A4');
$pdf->setTitle('Sales Report Weekly Products');
$pdf->SetAuthor('JULIE GRACE');
$pdf->SetCreator('Manobo PDF Generator');
$pdf->SetDisplayMode('real');
$pdf->SetAutoPageBreak(true, 25);
$pdf->AliasNbPages();
$pdf->AddPage('L');
$margin = 30;
$ypos = 10;
$cellstart = $margin;
$cellsize = 48;
$cellsize_half = $cellsize / 2;
$cellsizecollweek = $cellsize + $margin;
$cell_height_col = 55;
$cell_height = 5;
$pdf->setXY($margin, $ypos);
$pdf->setFont('Arial', 'B', '14');
$pdf->cell(240, 5, 'SALES REPORT WEEKLY PRODUCT KW ' . date('W') . ' (' . date('d.m.Y', strtotime($filter_date)) . ')', 0, 0, 'C');
示例7: format
function format($text)
{
include_once 'lib/Template.php';
global $request;
$tokens['page'] = $this->_page;
$tokens['CONTENT'] = $this->_transform($text);
$pagename = $this->_page->getName();
// This is a XmlElement tree, which must be converted to PDF
// We can make use of several pdf extensions. This one - fpdf
// - is pure php and very easy, but looks quite ugly and has a
// terrible interface, as terrible as most of the othes.
// The closest to HTML is htmldoc which needs an external cgi
// binary.
// We use a custom HTML->PDF class converter from PHPWebthings
// to be able to use templates for PDF.
require_once 'lib/fpdf.php';
require_once 'lib/pdf.php';
$pdf = new PDF();
$pdf->SetTitle($pagename);
$pdf->SetAuthor($this->_page->get('author'));
$pdf->SetCreator(WikiURL($pagename, false, 1));
$pdf->AliasNbPages();
$pdf->AddPage();
//TODO: define fonts
$pdf->SetFont('Times', '', 12);
//$pdf->SetFont('Arial','B',16);
// PDF pagelayout from a special template
$template = new Template('pdf', $request, $tokens);
$pdf->ConvertFromHTML($template);
// specify filename, destination
$pdf->Output($pagename . ".pdf", 'I');
// I for stdin or D for download
// Output([string name [, string dest]])
return $pdf;
}
示例8: PDF
$c2x = $c1x + $w;
$c3x = $c2x + $w;
$c4x = $c3x + $w;
$c1h = 170;
$c2h = $c1h / 2;
$c3h = $c2h / 2;
$c4h = $c3h / 2;
$bottom = $top + $c1h;
$pdf = new PDF('L', 'mm', 'Letter');
$pdf->Open();
$pdf->SetTopMargin(13);
$pdf->SetLeftMargin(13);
$pdf->SetRightMargin(10);
$pdf->SetAutoPageBreak(True, 13);
$pdf->AddPage();
$pdf->SetCreator($_SERVER["PHP_SELF"]);
$pdf->SetAuthor("Keith Morrison, keithm@infused.org");
$pdf->SetTitle(sprintf(gtc("Pedigree for %s"), $o->full_name()));
$pdf->SetSubject(gtc("Genealogy"));
# Person 1
$pdf->SetY($top);
$pdf->SetX($c1x);
$pdf->Cell($w, $c1h, '', 1, 0, 'L');
$pdf->SetY($top + $c1h / 2 - 6);
$pdf->SetX($c1x);
$pdf->SetFont($font, 'B', 10);
$pdf->MultiCell($w, 4, isset($g_node_strings[1][0]) ? $g_node_strings[1][0] : '', 0, 'L');
$pdf->SetFont($font, '', 10);
$pdf->Cell($w, 4, isset($g_node_strings[1][1]) ? $g_node_strings[1][1] : '', 0, 2, 'L');
$pdf->Cell($w, 4, isset($g_node_strings[1][2]) ? $g_node_strings[1][2] : '', 0, 0, 'L');
# Person 2
示例9: Booking
*/
include_once "../includes/default.inc.php";
$auth->is_authenticated();
include_once 'bookingclass.inc.php';
$booking = new Booking();
$bookid = $request->GetVar('bookid', 'get');
$bookdata = $booking->getMeldedata($bookid);
define('FPDF_FONTPATH', $fontpath);
include_once 'fpdf.php';
include_once 'pdf.php';
$fonttype = 'times';
$pdf = new PDF();
$pdf->Open();
$pdf->SetTitle('ZVS Meldeschein');
$pdf->SetAuthor($request->GetVar('hotel_name', 'session'));
$pdf->SetCreator('ZVS');
$pdf->AliasNbPages();
$pdf->AddPage(P);
$pdf->ln(5);
$y = $pdf->GetY();
// Address
$pdf->SetFont($fonttype, 'B', 10);
$pdf->Write(5, $request->GetVar('hotel_name', 'session'));
$pdf->ln(4);
$pdf->SetFont($fonttype, '', 10);
$pdf->Write(5, $request->GetVar('hotel_street', 'session'));
$pdf->ln(4);
$pdf->SetFont($fonttype, '', 10);
$pdf->Write(5, $request->GetVar('hotel_zip', 'session') . " " . $request->GetVar('hotel_city', 'session'));
// Headline
$pdf->SetXY(120, $y);
示例10: Footer
//Rodapé do Relatório
function Footer()
{
$usuarioNome = $_GET['UsuarioNome'];
//Posiciona a 1.5 cm do final
$this->SetY(-15);
//Arial italico 8
$this->SetFont('Arial', 'I', 7);
$this->Line(10, 281, 200, 281);
$this->Cell(100, 3, 'Emitido por: ' . $usuarioNome);
}
}
//Instancia a classe gerador de pdf
$pdf = new PDF();
//Define os atributos de propriedade do arquivo PDF
$pdf->SetCreator('work | eventos - CopyRight(c) - Desenvolvido por Work Labs Tecnologia - www.worklabs.com.br');
$pdf->SetAuthor($usuarioNome . ' - ' . $empresaNome);
$pdf->SetTitle('Planilha Controle de Foto e Vídeo do Evento');
$pdf->SetSubject('Relatório gerado automaticamente pelo sistema');
$pdf->AliasNbPages();
//Cria a página do relatório
$pdf->AddPage('L');
//verifica os formandos já cadastrados para este evento
$sql_formando = mysql_query("SELECT \n\t form.id, \n\t form.evento_id,\n\t form.nome,\n\t form.contato,\n\t form.operadora,\n\t form.telefone_comercial,\n\t form.telefone_residencial,\n\t form.endereco,\n\t form.complemento,\n\t form.bairro,\n\t form.cep,\n\t form.cpf,\n\t form.uf,\n\t form.email,\n\t form.observacoes,\n\t cid.nome AS cidade_nome,\n\t cid.uf AS cidade_uf,\n\t eve.nome AS evento_nome\n FROM \n \teventos_formando form\n LEFT OUTER JOIN \n \teventos eve ON eve.id = form.evento_id\n LEFT OUTER JOIN \n \tcidades cid ON cid.id = form.cidade_id\n WHERE \n \tform.status = 2 \n\t {$where_cidade}\n\t {$where_uf}\n\t {$where_datas}\n AND \n \tform.status_fotovideo = 1\n AND\n \teve.foto_video_liberado = 1\n ORDER BY \n \tform.nome");
//Verifica o numero de registros retornados
$registros = mysql_num_rows($sql_formando);
//Verifica a quantidade de registros
if ($registros == 0) {
//Exibe a mensagem que não foram encontrados registros
$pdf->ln(12);
$pdf->SetFont('Arial', 'B', 9);
示例11: PDF
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Page number
//$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
$this->SetX($this->lMargin);
$this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
$this->SetX($this->lMargin);
$this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
}
}
$pdf = new PDF('P');
$pdf->AliasNbPages();
$pdf->SetAuthor("khurramnaseem@gmail.com");
$pdf->SetSubject("Party Contact");
$pdf->SetTitle("Party Contact");
$pdf->SetCreator("Khurram Naseem");
$prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'formatNumberDecimal' => 0, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
$pdf->AddPage();
foreach ($data as $vid => $d) {
//$vehicle = $d['Rank'];
$pdf->AddCol('party_name', '20%', '', 'L');
$pdf->AddCol('party_address', '25%', '', 'L');
$pdf->AddCol('Phone1', '10%', '', 'L');
$pdf->AddCol('Phone2', '10%', '', 'L');
$pdf->AddCol('Cell', '10%', '', 'L');
$pdf->AddCol('contact_person', '12%', '', 'L');
$pdf->AddCol('vehicle_name', '13%', '', 'L');
$pdf->Table($d['data'], $prop, TRUE, FALSE);
}
$pdf->Output("party_contact.pdf", "D");
} else {
示例12: date
//Ajusta a fonte
$this->SetFont('Arial', '', 9);
$this->Cell(0, 4, date('d/m/Y', mktime()), 0, 0, 'R');
$this->Ln();
$this->SetFont('Arial', '', 10);
$this->Cell(0, 4, 'Emissão do Formulário de AR', 0, 0, 'L');
//Imprime o logotipo da empresa
$this->Image('../image/logo_correios.jpg', 9, 70, 40);
//Line break
$this->Ln(6);
}
}
//Instancia a classe gerador de pdf
$pdf = new PDF();
//Define os atributos de propriedade do arquivo PDF
$pdf->SetCreator('work | eventos - CopyRight(c) - Desenvolvido por Work Labs - maycon@worklabs.com.br');
$pdf->SetAuthor($usuarioNome . " - " . $empresaNome);
$pdf->SetTitle('Formulário de AR');
$pdf->SetSubject('Relatório gerado automaticamente pelo sistema');
$pdf->AliasNbPages();
//Cria a página do relatório
$pdf->AddPage();
//Busca os dados da pessoa conforme o tipo de pessoa informado
//Verifica se é formando
if ($TipoPessoa == 1) {
//verifica os formandos já cadastrados para este evento
$sql_formando = mysql_query("SELECT \n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.nome,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.cpf,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.endereco,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.complemento,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.bairro,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.uf,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.cep,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.observacoes,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tcid.nome as cidade_nome\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM eventos_formando form\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT OUTER JOIN cidades cid ON cid.id = form.cidade_id\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE form.id = {$PessoaId}");
//Verifica o numero de registros retornados
$registros = mysql_num_rows($sql_formando);
//Verifica a quantidade de registros
if ($registros == 0) {
示例13: PDF
//Recupera os valores para filtragem
$MusicaId = $_GET["MusicaId"];
//Recupera dos dados da musica
$sql_musica = "SELECT * FROM musicas WHERE id = '{$MusicaId}'";
//Executa a query de consulta
$query_musica = mysql_query($sql_musica);
//Monta a matriz com os dados
$dados_musica = mysql_fetch_array($query_musica);
//Chama a classe para gerar o PDF
class PDF extends FPDF
{
}
//Instancia a classe gerador de pdf
$pdf = new PDF();
//Define os atributos de propriedade do arquivo PDF
$pdf->SetCreator('work | eventos - CopyRight(c) - Desenvolvido por Maycon Edinger - workeventos@gmail.com');
$pdf->SetAuthor($usuarioNome . " - " . $empresaNome);
$pdf->SetTitle('Impressão da Música');
$pdf->SetSubject('Relatório gerado automaticamente pelo sistema');
$pdf->AliasNbPages();
//Cria a página do relatório
$pdf->AddPage();
//Nova linha
//$pdf->ln();
$pdf->SetFont('Arial', 'B', 15);
$pdf->Cell(0, 7, $dados_musica['nome'], 'T', 0, 'L');
//Nova linha
$pdf->ln();
$pdf->SetFont('Arial', 'B', 11);
$pdf->MultiCell(0, 4, $dados_musica['interprete'], 'B');
//Nova linha
示例14: createPDF
function createPDF($ignoreStockStatusDepot = false, $output = 'D', $add_to_daily_statistic = false, $print_per_orders = true)
{
/*
OUTPUT : D -> WILL PRODUCE ONE PDF FOR ALL ORDERS WITH ITEMS IN IT
OUTPUT : F -> WILL PRODUCE MULTI PDF PER ORDER ITEMS
*/
global $class_jo, $class_o, $class_do;
$pi_printed_jg = array();
$pi_printed_sp = array();
$pi_printed_dp = array();
if ($output == 'D') {
//PRODUCE SINGLE PDF FILE
$pdf = new PDF('P', 'mm', 'A4');
$pdf->setTitle('Production Instruction');
$pdf->SetAuthor('JULIE GRACE / Bonofactum');
$pdf->SetCreator('k-Auto Generated PDF');
$pdf->SetDisplayMode('real');
$pdf->SetAutoPageBreak(false);
$pdf->AliasNbPages();
$pdf->SetFillColor(191, 191, 191);
}
$item_printed = 0;
$oiid_last_printed = '';
/* Moved this on function constructPIContent and replace using below $print_per_orders,
* so eventhough we use $output='F' we still could create pi which consists of collection of orders */
//foreach($this->orders as $order) {
// $o = $order['detail'];
// foreach($order['items'] as $oiid=>$i) {
// if($i['status']<8) $this->pi_printed[strtolower($o['type'])][] = $oiid;
// //if($i['status']<8) ${'pi_printed_'.strtolower($o['type'])}[] = $oiid;
// $this->constructPIContent($pdf, $output, $order, $oiid, $ignoreStockStatusDepot, $print_per_orders);
// $item_printed++;
// $oiid_last_printed = $oiid;
// }
//}
if ($print_per_orders) {
foreach ($this->orders as $order) {
$this->constructPIContent($pdf, $output, $order, $ignoreStockStatusDepot, true);
$item_printed++;
}
} else {
$this->constructPIContent($pdf, $output, $this->orders, $ignoreStockStatusDepot, false);
}
#PI Print Counter
if (count($this->pi_printed['sp']) > 0) {
$class_jo->printCountAdd($this->pi_printed['sp']);
}
if (count($this->pi_printed['jg']) > 0) {
$class_o->printCountAdd($this->pi_printed['jg']);
}
if (count($this->pi_printed['dp']) > 0) {
$class_do->printCountAdd($this->pi_printed['dp']);
}
/* D: Download; F: Save File on Server */
if ($output == 'D') {
$infix = '';
//$infix = count($this->orders)>1 ? '' : strtoupper($o['type']).'O'.$o['id'].'-';
//if($item_printed==1) $infix = strtoupper($o['type']).'-'.$oiid_last_printed.'-';
if ($item_printed == 1) {
$infix = array_keys($this->orders);
$infix = $infix[0] . '-';
}
$filename = 'PI-' . $infix . date('YmdHi');
$pdf->Output($filename . '.pdf', $output);
//$pdf->Output($filename.'.pdf','D');
}
if ($add_to_daily_statistic) {
$pt = new production_target();
$timestamp = date('Y-m-d H:i:s');
if ($this->qty_total_first_printed > 0) {
$pt->addDataToField($timestamp, 'start', $this->qty_total_first_printed);
}
}
}
示例15: Footer
//Rodapé do Relatório
function Footer()
{
$usuarioNome = $_GET["UsuarioNome"];
//Posiciona a 1.5 cm do final
$this->SetY(-15);
//Arial italico 8
$this->SetFont("Arial", "I", 7);
$this->Line(10, 281, 200, 281);
$this->Cell(0, 3, "Emitido por: " . $usuarioNome);
}
}
//Instancia a classe gerador de pdf
$pdf = new PDF();
//Define os atributos de propriedade do arquivo PDF
$pdf->SetCreator("mayconedinger@gmail.com");
$pdf->SetAuthor($usuarioNome . " - " . $empresaNome);
$pdf->SetTitle("Detalhamento do colaborador");
$pdf->SetSubject("Relatório gerado automaticamente pelo sistema");
$pdf->AliasNbPages();
$pdf->AddPage();
//Verifica se há uma foto definida para o colaborador
if ($dados_conta["foto"] != "") {
$caminho_foto = "../imagem_colaborador/{$dados_conta['foto']}";
//Imprime a foto do colaborador
$pdf->Image($caminho_foto, 167, 30, 32, 43);
}
$pdf->SetY(25);
$pdf->SetFont("Arial", "B", 10);
$pdf->SetFillColor(178, 178, 178);
$pdf->Cell(0, 6, "Detalhamento do Colaborador", 1, 0, "C", 1);