PHP Class Spatie\PdfToImage\Pdf

Afficher le fichier Open project: spatie/pdf-to-image Class Usage Examples

Protected Properties

Свойство Type Description
$outputFormat
$page
$pdfFile
$resolution
$validOutputFormats

Méthodes publiques

Méthode 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.

Méthodes protégées

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

Method Details

__construct() public méthode

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

determineOutputFormat() protected méthode

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

getImageData() public méthode

Return raw image data.
public getImageData ( string $pathToImage ) : Imagick
$pathToImage string
Résultat Imagick

getNumberOfPages() public méthode

Get the number of pages in the pdf file.
public getNumberOfPages ( ) : integer
Résultat integer

isValidOutputFormat() public méthode

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

saveAllPagesAsImages() public méthode

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

saveImage() public méthode

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

setOutputFormat() public méthode

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

setPage() public méthode

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

setResolution() public méthode

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