PHP Generate PDF file Code (1/12) _php Tutorial

Source: Internet
Author: User
PHP generated PDF file code generated PDF file If it is really good, it is very complex, let's take a look at a complete set of PHP generated PDF file code, he can be a text file generated PDF files can also be used to create a PDF file image file Oh.

PHP Tutorial generates PDF file code
/*
Generate PDF file If it's really good, it's complicated, let's take a look at a compiled PHP generated PDF file code, he can create a PDF file of the text file can also be used to create a PDF file image file Oh.

This generates a PDF file with the file
fpdf.php
chinese.php
picpdf.php

*/
fpdf.php Code

Define (' fpdf_version ', ' 1.6 ');

Class Fpdf
{
var $page; Current page number
var $n; Current object number
var $offsets; Array of object offsets
var $buffer; Buffer Holding in-memory PDF
var $pages; Array containing pages
var $state; Current document state
var $compress; Compression flag
var $k; Scale factor (number of points in user unit)
var $deforientation; Default Orientation
var $curorientation; Current orientation
var $pageformats; Available page formats
var $defpageformat; Default page format
var $curpageformat; Current page format
var $pagesizes; Array storing Non-default page sizes
var $wpt, $hpt; Dimensions of current page in points
var $w, $h; Dimensions of current page in user unit
var $lmargin; Left margin
var $tmargin; Top margin
var $rmargin; Right margin
var $bmargin; Page Break margin
var $cmargin; Cell margin
var $x, $y; Current position in User unit
var $lasth; Height of last printed cell
var $linewidth; Line width in user unit
var $corefonts; Array of standard font names
var $fonts; Array of used fonts
var $fontfiles; Array of font files
var $diffs; Array of encoding differences
var $fontfamily; Current font family
var $fontstyle; Current font style
var $underline; Underlining flag
var $currentfont; Current Font Info
var $fontsizept; Current font size in points
var $fontsize; Current font size in user unit
var $drawcolor; Commands for drawing color
var $fillcolor; Commands for filling color
var $textcolor; Commands for text color
var $colorflag; Indicates whether fill and text colors are different
var $ws; Word spacing
var $images; Array of used images
var $pagelinks; Array of links in pages
var $links; Array of internal links
var $autopagebreak; Automatic page breaking
var $pagebreaktrigger; Threshold used to trigger page breaks
var $inheader; Flag set when processing header
var $infooter; Flag set when processing footer
var $zoommode; Zoom display Mode
var $layoutmode; Layout display Mode
var $title; Title
var $subject; Subject
var $author; Author
var $keywords; Keywords
var $creator; Creator
var $aliasnbpages; Alias for total number of pages
var $pdfversion; PDF version Number

/*******************************************************************************
* *
* Public Methods *
* *
*******************************************************************************/
function fpdf ($orientation = ' P ', $unit = ' mm ', $format = ' A4 ')
{
Some checks
$this->_dochecks ();
Initialization of properties
$this->page=0;
$this->n=2;
$this->buffer= ';
$this->pages=array ();
$this->pagesizes=array ();
$this->state=0;
$this->fonts=array ();
$this->fontfiles=array ();
$this->diffs=array ();
$this->images=array ();
$this->links=array ();
$this->inheader=false;
$this->infooter=false;
$this->lasth=0;
$this->fontfamily= ';
$this->fontstyle= ';
$this->fontsizept=12;
$this->underline=false;
$this->drawcolor= ' 0 g ';
$this->fillcolor= ' 0 g ';
$this->textcolor= ' 0 g ';
$this->colorflag=false;
$this->ws=0;
Standard fonts
$this->corefonts=array (' courier ' = ' courier ', ' courierb ' = ' courier-bold ', ' courieri ' = ' Courier-oblique ', ' courierbi ' = ' courier-boldoblique ',
' Helvetica ' = ' Helvetica ', ' helveticab ' = ' helvetica-bold ', ' Helveticai ' and ' helvetica-oblique ', ' Helveticabi ' = ' helvetica-boldoblique ',
' Times ' = ' times-roman ', ' timesb ' = ' times-bold ', ' timesi ' = ' times-italic ', ' timesbi ' and ' = ' Times-bolditalic ',
' symbol ' = ' symbol ', ' zapfdingbats ' = ' zapfdingbats ');
Scale factor
if ($unit = = ' pt ') 1 2 3 4 5 6 7 8 9 10 11 12

http://www.bkjia.com/PHPjc/444878.html www.bkjia.com true http://www.bkjia.com/PHPjc/444878.html techarticle PHP generated PDF file code generated PDF file If it is really good, it is very complex, let's take a look at a complete set of PHP generated PDF file code, he can be the text file generation ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.