PHP Class Spatie\PdfToImage\Pdf

Mostrar archivo Open project: spatie/pdf-to-image Class Usage Examples

Protected Properties

Property Type Description
$outputFormat
$page
$pdfFile
$resolution
$validOutputFormats

Public Methods

Method Description
__construct ( string $pdfFile )
getImageData ( string $pathToImage ) : Imagick Return raw image data.
getNumberOfPages ( ) : integer Get the number of pages in the pdf file.
isValidOutputFormat ( $outputFormat ) : boolean Determine if the given format is a valid output format.
saveAllPagesAsImages ( string $directory, string $prefix = '' ) : array Save the file as images to the given directory.
saveImage ( string $pathToImage ) : boolean Save the image to the given path.
setOutputFormat ( string $outputFormat ) Set the output format.
setPage ( integer $page ) Set the page number that should be rendered.
setResolution ( integer $resolution ) Set the raster resolution.

Protected Methods

Method Description
determineOutputFormat ( $pathToImage ) : string Determine in which format the image must be rendered.

Method Details

__construct() public method

public __construct ( string $pdfFile )
$pdfFile string The path to the pdffile.

determineOutputFormat() protected method

Determine in which format the image must be rendered.
protected determineOutputFormat ( $pathToImage ) : string
$pathToImage
return string

getImageData() public method

Return raw image data.
public getImageData ( string $pathToImage ) : Imagick
$pathToImage string
return Imagick

getNumberOfPages() public method

Get the number of pages in the pdf file.
public getNumberOfPages ( ) : integer
return integer

isValidOutputFormat() public method

Determine if the given format is a valid output format.
public isValidOutputFormat ( $outputFormat ) : boolean
$outputFormat
return boolean

saveAllPagesAsImages() public method

Save the file as images to the given directory.
public saveAllPagesAsImages ( string $directory, string $prefix = '' ) : array
$directory string
$prefix string
return array $files the paths to the created images

saveImage() public method

Save the image to the given path.
public saveImage ( string $pathToImage ) : boolean
$pathToImage string
return boolean

setOutputFormat() public method

Set the output format.
public setOutputFormat ( string $outputFormat )
$outputFormat string

setPage() public method

Set the page number that should be rendered.
public setPage ( integer $page )
$page integer

setResolution() public method

Set the raster resolution.
public setResolution ( integer $resolution )
$resolution integer

Property Details

$outputFormat protected_oe property

protected $outputFormat

$page protected_oe property

protected $page

$pdfFile protected_oe property

protected $pdfFile

$resolution protected_oe property

protected $resolution

$validOutputFormats protected_oe property

protected $validOutputFormats