PHP 클래스 Pop\Pdf\Pdf

저자: Nick Sagona, III ([email protected])
상속: extends Pop\Pdf\AbstractPdf
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$allowed array Array of allowed file types.
$backgroundColor mixed Background color of the document
$bytelength integer PDF bytelength
$compress boolean Compression property
$curPage integer Current PDF page.
$fillColor mixed Fill color of the document
$fonts array Current fonts added to the PDF
$images string Array of images added to the PDF
$info integer PDF info index.
$lastFontName string Last font name
$objects array Array of PDF objects.
$pages array Array of PDF page object indices.
$parent integer PDF parent index.
$root integer PDF root index.
$standardFonts array Standard PDF fonts with their approximate character width and height factors.
$stroke boolean Stroke ON or OFF flag
$strokeColor mixed Stroke color of the document
$strokeDashGap integer Stroke dash gap
$strokeDashLength integer Stroke dash length
$strokeWidth integer Stroke width
$textParams array PDF text parameters.
$trailer string PDF trailer.

공개 메소드들

메소드 설명
__construct ( string $pdf, string $sz = null, integer $w = null, integer $h = null ) : Pdf Constructor
addFont ( string $font, boolean $embedOverride = false ) : Pdf Method to add a font to the PDF.
addImage ( string $image, integer $x, integer $y, mixed $scl = null, boolean $preserveRes = true ) : Pdf Method to add an image to the PDF.
addLink ( integer $x, integer $y, integer $w, integer $h, integer $X, integer $Y, integer $Z, integer $dest = null ) : Pdf Method to add an internal link to the PDF.
addPage ( string $sz = null, integer $w = null, integer $h = null ) : Pdf Method to add a page to the PDF of a determined size.
addText ( integer $x, integer $y, integer $size, string $str, string $font = null ) : Pdf Method to add text to the PDF.
addUrl ( integer $x, integer $y, integer $w, integer $h, string $url ) : Pdf Method to add a URL link to the PDF.
closeLayer ( ) : Pdf Method to close a new graphics state layer within the PDF.
copyPage ( integer $pg ) : Pdf Method to copy a page of the PDF.
curPage ( ) : integer Method to return the current page number of the current page of the PDF.
deletePage ( integer $pg ) : Pdf Method to delete the page of the PDF and its content objects.
drawArc ( integer $x, integer $y, integer $start, integer $end, integer $w, integer $h = null, boolean $fill = true ) : Pdf Method to add an arc to the PDF.
drawCircle ( integer $x, integer $y, integer $w, boolean $fill = true ) : Pdf Method to add a circle to the PDF.
drawClippingCircle ( integer $x, integer $y, integer $w ) : Pdf Method to add a clipping circle to the PDF.
drawClippingEllipse ( integer $x, integer $y, integer $w, integer $h = null ) : Pdf Method to add a clipping ellipse to the PDF.
drawClippingPolygon ( array $points ) : Pdf Method to add a clipping polygon to the PDF.
drawClippingRectangle ( integer $x, integer $y, integer $w, integer $h = null ) : Pdf Method to add a clipping rectangle to the PDF.
drawClippingSquare ( integer $x, integer $y, integer $w ) : Pdf Method to add a clipping square to the PDF.
drawEllipse ( integer $x, integer $y, integer $w, integer $h = null, boolean $fill = true ) : Pdf Method to add an ellipse to the PDF.
drawLine ( integer $x1, integer $y1, integer $x2, integer $y2 ) : Pdf Method to add a line to the PDF.
drawPolygon ( array $points, boolean $fill = true ) : Pdf Method to add a polygon to the image.
drawRectangle ( integer $x, integer $y, integer $w, integer $h = null, boolean $fill = true ) : Pdf Method to add a rectangle to the PDF.
drawSquare ( integer $x, integer $y, integer $w, boolean $fill = true ) : Pdf Method to add a square to the PDF.
finalize ( ) : Pdf Method to finalize the PDF.
getCompression ( ) : boolean Method to get the compression of the PDF.
getFonts ( ) : string Method to return the name of the last font added.
getLastFontName ( ) : string Method to return the name of the last font added.
getStringSize ( string $str, string $font, integer $sz ) : array Method to get the width and height of a string in a certain font. It returns an array with the approximate width, height and offset baseline values.
import ( string $pdf, integer | string | array $pg = null ) : Pdf Method to import either an entire PDF, or a page of a PDF, and the related data.
numPages ( ) : integer Method to return the current number of pages in the PDF.
openLayer ( ) : Pdf Method to open a new graphics state layer within the PDF.
orderPages ( array $pgs ) : Pdf Method to order the pages of the PDF.
output ( boolean $download = false ) : void Output the PDF directly to the browser.
save ( string $to = null, boolean $append = false ) : Pdf Save the PDF directly to the server.
setAuthor ( string $auth ) : Pdf Method to set the PDF info author.
setBackgroundColor ( Pop\Color\Space\ColorInterface $color ) : Pdf Method to set the background of the document.
setCompression ( boolean $comp = false ) : Pdf Method to set the compression of the PDF.
setCreateDate ( string $dt ) : Pdf Method to set the PDF info creation date.
setFillColor ( Pop\Color\Space\ColorInterface $color ) : Pdf Method to set the fill color of objects and text in the PDF.
setModDate ( string $dt ) : Pdf Method to set the PDF info modification date.
setPage ( integer $pg ) : Pdf Method to set the current page of the PDF in which to edit.
setStrokeColor ( Pop\Color\Space\ColorInterface $color ) : Pdf Method to set the stroke color of paths in the PDF.
setStrokeWidth ( integer $w = null, integer $dash_len = null, integer $dash_gap = null ) : Pdf Method to set the width and dash properties of paths in the PDF.
setSubject ( string $subj ) : Pdf Method to set the PDF info subject.
setTextParams ( integer $c, integer $w, integer $h = 100, integer $v = 100, integer $rot, integer $rend ) : Pdf Method to set the text parameters for rendering text content.
setTitle ( string $tle ) : Pdf Method to set the PDF info title.
setVersion ( string $ver ) : Pdf Method to set the PDF version.

보호된 메소드들

메소드 설명
calcByteLength ( string $str ) : integer Method to calculate byte length.
calcTextMatrix ( ) : string Method to calculate text matrix.
convertColor ( integer | string $color ) : float Method to convert color.
formatByteLength ( integer | string $num ) : string Method to format byte length.
getContentObject ( ) : integer Method to return the current page's content object, or create one if necessary.
getQuadrant ( array $point, array $center ) : integer Method to calculate which quadrant a point is in.
lastIndex ( array $arr ) : integer Method to return the last object index.
setStyle ( boolean $fill ) : string Method to set the fill/stroke style.

메소드 상세

__construct() 공개 메소드

Instantiate a PDF file object based on either a pre-existing PDF file on disk, or a new PDF file. Arguments may be passed to add a page upon instantiation. The PDF file exists, it and all of its assets will be imported.
public __construct ( string $pdf, string $sz = null, integer $w = null, integer $h = null ) : Pdf
$pdf string
$sz string
$w integer
$h integer
리턴 Pdf

addFont() 공개 메소드

Method to add a font to the PDF.
public addFont ( string $font, boolean $embedOverride = false ) : Pdf
$font string
$embedOverride boolean
리턴 Pdf

addImage() 공개 메소드

Method to add an image to the PDF.
public addImage ( string $image, integer $x, integer $y, mixed $scl = null, boolean $preserveRes = true ) : Pdf
$image string
$x integer
$y integer
$scl mixed
$preserveRes boolean
리턴 Pdf

addPage() 공개 메소드

Method to add a page to the PDF of a determined size.
public addPage ( string $sz = null, integer $w = null, integer $h = null ) : Pdf
$sz string
$w integer
$h integer
리턴 Pdf

addText() 공개 메소드

Method to add text to the PDF.
public addText ( integer $x, integer $y, integer $size, string $str, string $font = null ) : Pdf
$x integer
$y integer
$size integer
$str string
$font string
리턴 Pdf

addUrl() 공개 메소드

Method to add a URL link to the PDF.
public addUrl ( integer $x, integer $y, integer $w, integer $h, string $url ) : Pdf
$x integer
$y integer
$w integer
$h integer
$url string
리턴 Pdf

calcByteLength() 보호된 메소드

Method to calculate byte length.
protected calcByteLength ( string $str ) : integer
$str string
리턴 integer

calcTextMatrix() 보호된 메소드

Method to calculate text matrix.
protected calcTextMatrix ( ) : string
리턴 string

closeLayer() 공개 메소드

Must be used in conjunction with the openLayer() method.
public closeLayer ( ) : Pdf
리턴 Pdf

convertColor() 보호된 메소드

Method to convert color.
protected convertColor ( integer | string $color ) : float
$color integer | string
리턴 float

copyPage() 공개 메소드

Method to copy a page of the PDF.
public copyPage ( integer $pg ) : Pdf
$pg integer
리턴 Pdf

curPage() 공개 메소드

Method to return the current page number of the current page of the PDF.
public curPage ( ) : integer
리턴 integer

deletePage() 공개 메소드

Method to delete the page of the PDF and its content objects.
public deletePage ( integer $pg ) : Pdf
$pg integer
리턴 Pdf

drawArc() 공개 메소드

Method to add an arc to the PDF.
public drawArc ( integer $x, integer $y, integer $start, integer $end, integer $w, integer $h = null, boolean $fill = true ) : Pdf
$x integer
$y integer
$start integer
$end integer
$w integer
$h integer
$fill boolean
리턴 Pdf

drawCircle() 공개 메소드

Method to add a circle to the PDF.
public drawCircle ( integer $x, integer $y, integer $w, boolean $fill = true ) : Pdf
$x integer
$y integer
$w integer
$fill boolean
리턴 Pdf

drawClippingCircle() 공개 메소드

Method to add a clipping circle to the PDF.
public drawClippingCircle ( integer $x, integer $y, integer $w ) : Pdf
$x integer
$y integer
$w integer
리턴 Pdf

drawClippingEllipse() 공개 메소드

Method to add a clipping ellipse to the PDF.
public drawClippingEllipse ( integer $x, integer $y, integer $w, integer $h = null ) : Pdf
$x integer
$y integer
$w integer
$h integer
리턴 Pdf

drawClippingPolygon() 공개 메소드

Method to add a clipping polygon to the PDF.
public drawClippingPolygon ( array $points ) : Pdf
$points array
리턴 Pdf

drawClippingRectangle() 공개 메소드

Method to add a clipping rectangle to the PDF.
public drawClippingRectangle ( integer $x, integer $y, integer $w, integer $h = null ) : Pdf
$x integer
$y integer
$w integer
$h integer
리턴 Pdf

drawClippingSquare() 공개 메소드

Method to add a clipping square to the PDF.
public drawClippingSquare ( integer $x, integer $y, integer $w ) : Pdf
$x integer
$y integer
$w integer
리턴 Pdf

drawEllipse() 공개 메소드

Method to add an ellipse to the PDF.
public drawEllipse ( integer $x, integer $y, integer $w, integer $h = null, boolean $fill = true ) : Pdf
$x integer
$y integer
$w integer
$h integer
$fill boolean
리턴 Pdf

drawLine() 공개 메소드

Method to add a line to the PDF.
public drawLine ( integer $x1, integer $y1, integer $x2, integer $y2 ) : Pdf
$x1 integer
$y1 integer
$x2 integer
$y2 integer
리턴 Pdf

drawPolygon() 공개 메소드

Method to add a polygon to the image.
public drawPolygon ( array $points, boolean $fill = true ) : Pdf
$points array
$fill boolean
리턴 Pdf

drawRectangle() 공개 메소드

Method to add a rectangle to the PDF.
public drawRectangle ( integer $x, integer $y, integer $w, integer $h = null, boolean $fill = true ) : Pdf
$x integer
$y integer
$w integer
$h integer
$fill boolean
리턴 Pdf

drawSquare() 공개 메소드

Method to add a square to the PDF.
public drawSquare ( integer $x, integer $y, integer $w, boolean $fill = true ) : Pdf
$x integer
$y integer
$w integer
$fill boolean
리턴 Pdf

finalize() 공개 메소드

Method to finalize the PDF.
public finalize ( ) : Pdf
리턴 Pdf

formatByteLength() 보호된 메소드

Method to format byte length.
protected formatByteLength ( integer | string $num ) : string
$num integer | string
리턴 string

getCompression() 공개 메소드

Method to get the compression of the PDF.
public getCompression ( ) : boolean
리턴 boolean

getContentObject() 보호된 메소드

Method to return the current page's content object, or create one if necessary.
protected getContentObject ( ) : integer
리턴 integer

getFonts() 공개 메소드

Method to return the name of the last font added.
public getFonts ( ) : string
리턴 string

getLastFontName() 공개 메소드

Method to return the name of the last font added.
public getLastFontName ( ) : string
리턴 string

getQuadrant() 보호된 메소드

Method to calculate which quadrant a point is in.
protected getQuadrant ( array $point, array $center ) : integer
$point array
$center array
리턴 integer

getStringSize() 공개 메소드

Method to get the width and height of a string in a certain font. It returns an array with the approximate width, height and offset baseline values.
public getStringSize ( string $str, string $font, integer $sz ) : array
$str string
$font string
$sz integer
리턴 array

import() 공개 메소드

Method to import either an entire PDF, or a page of a PDF, and the related data.
public import ( string $pdf, integer | string | array $pg = null ) : Pdf
$pdf string
$pg integer | string | array
리턴 Pdf

lastIndex() 보호된 메소드

Method to return the last object index.
protected lastIndex ( array $arr ) : integer
$arr array
리턴 integer

numPages() 공개 메소드

Method to return the current number of pages in the PDF.
public numPages ( ) : integer
리턴 integer

openLayer() 공개 메소드

Must be used in conjunction with the closeLayer() method.
public openLayer ( ) : Pdf
리턴 Pdf

orderPages() 공개 메소드

Method to order the pages of the PDF.
public orderPages ( array $pgs ) : Pdf
$pgs array
리턴 Pdf

output() 공개 메소드

Output the PDF directly to the browser.
public output ( boolean $download = false ) : void
$download boolean
리턴 void

save() 공개 메소드

Save the PDF directly to the server.
public save ( string $to = null, boolean $append = false ) : Pdf
$to string
$append boolean
리턴 Pdf

setAuthor() 공개 메소드

Method to set the PDF info author.
public setAuthor ( string $auth ) : Pdf
$auth string
리턴 Pdf

setBackgroundColor() 공개 메소드

Method to set the background of the document.
public setBackgroundColor ( Pop\Color\Space\ColorInterface $color ) : Pdf
$color Pop\Color\Space\ColorInterface
리턴 Pdf

setCompression() 공개 메소드

Method to set the compression of the PDF.
public setCompression ( boolean $comp = false ) : Pdf
$comp boolean
리턴 Pdf

setCreateDate() 공개 메소드

Method to set the PDF info creation date.
public setCreateDate ( string $dt ) : Pdf
$dt string
리턴 Pdf

setFillColor() 공개 메소드

Method to set the fill color of objects and text in the PDF.
public setFillColor ( Pop\Color\Space\ColorInterface $color ) : Pdf
$color Pop\Color\Space\ColorInterface
리턴 Pdf

setModDate() 공개 메소드

Method to set the PDF info modification date.
public setModDate ( string $dt ) : Pdf
$dt string
리턴 Pdf

setPage() 공개 메소드

Method to set the current page of the PDF in which to edit.
public setPage ( integer $pg ) : Pdf
$pg integer
리턴 Pdf

setStrokeColor() 공개 메소드

Method to set the stroke color of paths in the PDF.
public setStrokeColor ( Pop\Color\Space\ColorInterface $color ) : Pdf
$color Pop\Color\Space\ColorInterface
리턴 Pdf

setStrokeWidth() 공개 메소드

Method to set the width and dash properties of paths in the PDF.
public setStrokeWidth ( integer $w = null, integer $dash_len = null, integer $dash_gap = null ) : Pdf
$w integer
$dash_len integer
$dash_gap integer
리턴 Pdf

setStyle() 보호된 메소드

Method to set the fill/stroke style.
protected setStyle ( boolean $fill ) : string
$fill boolean
리턴 string

setSubject() 공개 메소드

Method to set the PDF info subject.
public setSubject ( string $subj ) : Pdf
$subj string
리턴 Pdf

setTextParams() 공개 메소드

Method to set the text parameters for rendering text content.
public setTextParams ( integer $c, integer $w, integer $h = 100, integer $v = 100, integer $rot, integer $rend ) : Pdf
$c integer (character spacing)
$w integer (word spacing)
$h integer (horz stretch)
$v integer (vert stretch)
$rot integer (rotation)
$rend integer (render flag, 0 - 7)
리턴 Pdf

setTitle() 공개 메소드

Method to set the PDF info title.
public setTitle ( string $tle ) : Pdf
$tle string
리턴 Pdf

setVersion() 공개 메소드

Method to set the PDF version.
public setVersion ( string $ver ) : Pdf
$ver string
리턴 Pdf

프로퍼티 상세

$allowed 보호되어 있는 프로퍼티

Array of allowed file types.
protected array $allowed
리턴 array

$backgroundColor 보호되어 있는 프로퍼티

Background color of the document
protected mixed $backgroundColor
리턴 mixed

$bytelength 보호되어 있는 프로퍼티

PDF bytelength
protected int $bytelength
리턴 integer

$compress 보호되어 있는 프로퍼티

Compression property
protected bool $compress
리턴 boolean

$curPage 보호되어 있는 프로퍼티

Current PDF page.
protected int $curPage
리턴 integer

$fillColor 보호되어 있는 프로퍼티

Fill color of the document
protected mixed $fillColor
리턴 mixed

$fonts 보호되어 있는 프로퍼티

Current fonts added to the PDF
protected array $fonts
리턴 array

$images 보호되어 있는 프로퍼티

Array of images added to the PDF
protected string $images
리턴 string

$info 보호되어 있는 프로퍼티

PDF info index.
protected int $info
리턴 integer

$lastFontName 보호되어 있는 프로퍼티

Last font name
protected string $lastFontName
리턴 string

$objects 보호되어 있는 프로퍼티

Array of PDF objects.
protected array $objects
리턴 array

$pages 보호되어 있는 프로퍼티

Array of PDF page object indices.
protected array $pages
리턴 array

$parent 보호되어 있는 프로퍼티

PDF parent index.
protected int $parent
리턴 integer

$root 보호되어 있는 프로퍼티

PDF root index.
protected int $root
리턴 integer

$standardFonts 보호되어 있는 프로퍼티

Standard PDF fonts with their approximate character width and height factors.
protected array $standardFonts
리턴 array

$stroke 보호되어 있는 프로퍼티

Stroke ON or OFF flag
protected bool $stroke
리턴 boolean

$strokeColor 보호되어 있는 프로퍼티

Stroke color of the document
protected mixed $strokeColor
리턴 mixed

$strokeDashGap 보호되어 있는 프로퍼티

Stroke dash gap
protected int $strokeDashGap
리턴 integer

$strokeDashLength 보호되어 있는 프로퍼티

Stroke dash length
protected int $strokeDashLength
리턴 integer

$strokeWidth 보호되어 있는 프로퍼티

Stroke width
protected int $strokeWidth
리턴 integer

$textParams 보호되어 있는 프로퍼티

PDF text parameters.
protected array $textParams
리턴 array

$trailer 보호되어 있는 프로퍼티

PDF trailer.
protected string $trailer
리턴 string