PHP Класс Spatie\PdfToImage\Pdf

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$outputFormat
$page
$pdfFile
$resolution
$validOutputFormats

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
determineOutputFormat ( $pathToImage ) : string Determine in which format the image must be rendered.

Описание методов

__construct() публичный Метод

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

determineOutputFormat() защищенный Метод

Determine in which format the image must be rendered.
protected determineOutputFormat ( $pathToImage ) : string
$pathToImage
Результат string

getImageData() публичный Метод

Return raw image data.
public getImageData ( string $pathToImage ) : Imagick
$pathToImage string
Результат Imagick

getNumberOfPages() публичный Метод

Get the number of pages in the pdf file.
public getNumberOfPages ( ) : integer
Результат integer

isValidOutputFormat() публичный Метод

Determine if the given format is a valid output format.
public isValidOutputFormat ( $outputFormat ) : boolean
$outputFormat
Результат boolean

saveAllPagesAsImages() публичный Метод

Save the file as images to the given directory.
public saveAllPagesAsImages ( string $directory, string $prefix = '' ) : array
$directory string
$prefix string
Результат array $files the paths to the created images

saveImage() публичный Метод

Save the image to the given path.
public saveImage ( string $pathToImage ) : boolean
$pathToImage string
Результат boolean

setOutputFormat() публичный Метод

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

setPage() публичный Метод

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

setResolution() публичный Метод

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

Описание свойств

$outputFormat защищенное свойство

protected $outputFormat

$page защищенное свойство

protected $page

$pdfFile защищенное свойство

protected $pdfFile

$resolution защищенное свойство

protected $resolution

$validOutputFormats защищенное свойство

protected $validOutputFormats