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


PHP FPDF::SetKeywords方法代码示例

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


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

示例1: save


//.........这里部分代码省略.........
						$borders .= 'T';
						$pdf->SetDrawColor(
							hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 0, 2)),
							hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 2, 2)),
							hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 4, 2))
						);
					}
	    			if ($style->getBorders()->getBottom()->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
						$borders .= 'B';
						$pdf->SetDrawColor(
							hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 0, 2)),
							hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 2, 2)),
							hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 4, 2))
						);
					}
					if ($borders == '') {
						$borders = 0;
					}
					if ($sheet->getShowGridlines()) {
						$borders = 'LTRB';
					}

	    			// Image?
			    	$iterator = $sheet->getDrawingCollection()->getIterator();
			    	while ($iterator->valid()) {
			    		if ($iterator->current()->getCoordinates() == PHPExcel_Cell::stringFromColumnIndex($column) . ($row + 1)) {
			    			try {
				    			$pdf->Image(
				    				$iterator->current()->getPath(),
				    				$pdf->GetX(),
				    				$pdf->GetY(),
				    				$iterator->current()->getWidth(),
				    				$iterator->current()->getHeight(),
				    				'',
				    				$this->_tempDir
				    			);
			    			} catch (Exception $ex) { }
			    		}

			    		$iterator->next();
			    	}

	    			// Print cell
	    			$pdf->MultiCell(
	    				$cellWidth,
	    				$cellHeight,
	    				$cellData,
	    				$borders,
	    				$alignment,
	    				($style->getFill()->getFillType() == PHPExcel_Style_Fill::FILL_NONE ? 0 : 1)
	    			);

			    	// Coordinates
			    	$endX = $pdf->GetX();
			    	$endY = $pdf->GetY();

			    	// Revert to original Y location
			    	if ($endY > $startY) {
			    		$pdf->SetY($startY);
			    		if ($lineHeight < $lineHeight + ($endY - $startY)) {
			    			$lineHeight = $lineHeight + ($endY - $startY);
			    		}
			    	}
			    	$pdf->SetX($startX + $singleCellWidth);

			    	// Hyperlink?
			    	if ($sheet->getCellByColumnAndRow($column, $row)->hasHyperlink()) {
			    		if (!$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->isInternal()) {
			    			$pdf->Link(
			    				$startX,
			    				$startY,
			    				$endX - $startX,
			    				$endY - $startY,
			    				$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->getUrl()
			    			);
			    		}
			    	}
				}

				// Garbage collect!
				$sheet->garbageCollect();

				// Next line...
				$pdf->Ln($lineHeight);
	    	}
		}

		// Document info
		$pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
		$pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
		$pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
		$pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
		$pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());

		// Write to file
		fwrite($fileHandle, $pdf->output($pFilename, 'S'));

		// Close file
		fclose($fileHandle);
	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:101,代码来源:PDF.php

示例2:

	$nb_eleve_aff = 1;

	// si la variable $gepiSchoolName est vide alors on cherche les informations dans la base
	if ( empty($gepiSchoolName) )
	{

		$gepiSchoolName=getSettingValue('gepiSchoolName');

	}

	// 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 */
开发者ID:rhertzog,项目名称:lcs,代码行数:30,代码来源:bilan_absences_quotidien_pdf.php

示例3: pdf_create

/**
 * @brief Create PDF for a reference
 *
 * We create a simple cover page for the PDF. This page contains basic bibliographic metadata
 * for the PDF, in order for Mendeley to process the PDF correctly. In response to my discovery
 * that Mendeley doesn't accept all XMP (Ticket#2010040110000015) support@mendeley.com replied that
 * they have some heuristic tests to see if the metadata is valid, such as whether the information 
 * about the title and authors occurs on the first of the PDF.
 *
 *
 * @param reference_id Reference id
 * @param pdf_filename Full path of PDF file to create
 *
 */
function pdf_create($reference_id, $pdf_filename)
{
    global $config;
    // Get reference
    $reference = db_retrieve_reference($reference_id);
    // Get tags
    $tags = pdf_tags($reference->reference_id, 10);
    // Paper size
    // A4 = 210 x 297
    $paper_width = 210;
    // mm
    $paper_height = 297;
    // mm
    $margin = 10;
    //----------------------------------------------------------------------------------------------
    // PDF
    $pdf = new FPDF('P', 'mm', 'A4');
    //$pdf = PDF_Rotate('P', 'mm', 'A4');
    //----------------------------------------------------------------------------------------------
    // Basic metadata (e.g., that displayed by Mac OS X Preview)
    $pdf->SetTitle($reference->title, true);
    // true means use UTF-8
    $pdf->SetAuthor(reference_authors_to_text_string($reference), true);
    // true means use UTF-8
    if (count($tags) > 0) {
        $pdf->SetKeywords(join(", ", $tags), true);
    }
    //----------------------------------------------------------------------------------------------
    // Cover page (partly to ensure Mendeley accepts XMP metadata)
    $pdf->AddPage();
    // Title
    $pdf->SetFont('Arial', '', 24);
    $pdf->SetXY($margin, $margin);
    $pdf->Write(10, utf8_decode($reference->title));
    // Authors
    $y = $pdf->GetY();
    $pdf->SetXY($margin, $y + 16);
    $pdf->SetFont('Arial', 'B', 16);
    $pdf->Write(6, utf8_decode(reference_authors_to_text_string($reference)));
    // Citation
    $y = $pdf->GetY();
    $pdf->SetXY($margin, $y + 10);
    $pdf->SetFont('Arial', 'I', 12);
    $pdf->Write(6, utf8_decode($reference->secondary_title));
    $pdf->SetFont('Arial', '', 12);
    $pdf->Write(6, ' ' . $reference->volume);
    if (isset($reference->issue)) {
        $pdf->Write(6, '(' . $reference->issue . ')');
    }
    $pdf->Write(6, ':' . $reference->spage);
    if (isset($reference->epage)) {
        $pdf->Write(6, '-' . $reference->epage);
    }
    $pdf->Write(6, ' (' . $reference->year . ')');
    // URL
    $url = $config['web_root'] . 'reference/' . $reference->reference_id;
    $pdf->Write(6, ' ');
    $pdf->SetTextColor(0, 0, 255);
    $pdf->SetFont('', 'U');
    $pdf->Write(6, $url, $url);
    $pdf->SetFont('', '');
    $pdf->SetTextColor(0, 0, 0);
    //----------------------------------------------------------------------------------------------
    // If we add taxon names as keywords
    if (count($tags) > 0) {
        $keywords = "Keywords: " . join("; ", $tags);
        $y = $pdf->GetY();
        $pdf->SetXY($margin, $y + 10);
        $pdf->Write(6, $keywords);
    }
    //----------------------------------------------------------------------------------------------
    // Footer giving credit to BHL
    $y = $paper_height;
    $y -= $margin;
    $y -= 40;
    $pdf->Image($config['web_dir'] . '/images/cc/cc.png', 10, $y, 10);
    $pdf->Image($config['web_dir'] . '/images/cc/by.png', 20, $y, 10);
    $pdf->Image($config['web_dir'] . '/images/cc/nc.png', 30, $y, 10);
    $pdf->SetXY(10, $y + 10);
    $pdf->SetFont('Arial', '', 10);
    $pdf->SetTextColor(0, 0, 0);
    $pdf->Write(6, 'Page images from the Biodiversity Heritage Library, ');
    //Then put a blue underlined link
    $pdf->SetTextColor(0, 0, 255);
    $pdf->SetFont('', 'U');
    $pdf->Write(6, 'http://www.biodiversitylibrary.org/', 'http://www.biodiversitylibrary.org/');
//.........这里部分代码省略.........
开发者ID:rdmpage,项目名称:bioguid,代码行数:101,代码来源:display_pdf.php

示例4: SetKeywords

 /**
  *
  * Wrapper to solve utf-8 issues.
  *
  * @param string $keywords
  *
  * @param bool $isUTF8 Defaults to TRUE.
  *
  * @return void
  *
  */
 public function SetKeywords($keywords, $isUTF8 = TRUE)
 {
     parent::SetKeywords($keywords, $isUTF8);
 }
开发者ID:CodeSomethingMX,项目名称:barney,代码行数:15,代码来源:EXTENDED.php


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