Download the PHP package bolongo/phppdfcrop without Composer
On this page you can find all versions of the php package bolongo/phppdfcrop. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phppdfcrop
PHP PDFcrop
PHP PDFcrop is a PHP wrapper for pdfcrop based on
PHP WkhtmlToPdf by Michael Härtl.
The pdfcrop
command must be installed in the system.
Installation
Install the package through composer:
Make sure you include the composer autoloader somewhere in your codebase.
Example
Options
Command options
These are used as options for the pdfcrop
shell command. For a better explanation of these options, please see
pdfcrop --help
.
Description
- verbose: Makes the command do a verbose printing.
- debug: Makes the command print debug information.
- gscmd: Specifies the path to the ghostscript command to be used by the command.
- tex-extension: Specifies the tex extension to be used by the command. Value must be
pdftex
,xetex
orluatex
. This option is the union of--pdftex
,--xetex
and--luatex
options present in thepdfcrop
shell command, in which only one of these must be specified. - pdftexcmd: Specifies the path to the pdftex command to be used by the command.
- xetexcmd: Specifies the path to the xetex command to be used by the command.
- luatexcmd: Specifies the path to the luatex command to be used by the command.
- margins: Specifies extra margins to the command, unit is bp. If only one number is given, then it is used for all margins, in the case of two numbers they are used for right and bottom.
- clip: Specifies clip support to the command if margins are set.
- hires: Specifies the use of
%%HiResBoundingBox
instead of%%BoundingBox
. - ini: Specifies the use of iniTeX variant of the TeX compiler to the command.
- original: File to be cropped by the command.
How to set options to a PDFCrop instance:
The original option is special, as it can be specified as a member of the array set on the constructor or the
setOptions($options)
method, as a replacement of the array set on the constructor or directly on the attribute
original
.
Wrapper options
These options are specific to the wrapper. These options can be passed to the
wrapper in the constructor or via the setOptions($options)
method, mixed with the Command Options.
Description
- binary: path to the
pdfcrop
command. - tmpDir: path to the tmp directory. Defaults to the PHP temp dir.
- ignoreWarnings: prevents the process from throwing exceptions.
- ignoreOptionValidationErrors: prevents the option validation from throwing exceptions (malformed options will be ignored).
Error Handling
new PDFCrop($options)
and setOptions($options)
will throw exceptions if an option is malformed and the option
ignoreOptionValidationErrors
is set to false
.
new saveAs($options)
and toString()
will throw exceptions if an error presents itself in the command or the saving
of the generated file if ignoreWarnings
is set to false
.
saveAs($options)
and toString()
with the option ignoreWarnings
set to true
will prevent exceptions from
showing, but if an error presents itself in the process or saving of the generated file, the method getError()
will return a string with the detailed error message.
Changelog
Check this library's changelog in here.
All versions of phppdfcrop with dependencies
mikehaertl/php-tmpfile Version ^1.1.0
mikehaertl/php-shellcommand Version ^1.5.0