Recommend this page to a friend! |
Download |
Info | Example | Screenshots | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-01-10 (9 months ago) | Not enough user ratings | Total: 563 | All time: 5,424 This week: 36 |
Version | License | PHP version | Categories | |||
tcpdf-warper 0.2.13 | Custom (specified... | 5.4 | PHP 5, Files and Folders, Printing, L..., T... |
Description | Author | |
This class can create PDF documents using fluent interface around the TCPDF library. |
What is the best PHP pdf creation class?
CREATE PDF
Extract database table data
Get database content into a PDF file
<?php |
composer require tecnick.com/tcpdf ### or any TCPDF library
composer require org.majkel/tcpdfwarper
Provides fluent statement builders for TCPDF library.
Mine intention was to make calls to methods, with many arguments, clearer and more maintainable.
// instead of
$pdf = new \TCPDF();
$pdf->Image($file, $x, $y, $w, $h, '', '', '', true, 300, '',
true, false, 10, true, false, false, true, $altimgs);
// you can use this
$pdf = new \org\majkel\tcpdfwarper\TCPDFWarper();
$pdf->buildImage()->setFile($file)
->setPos(20, 20)->setSize(64, 64)
->setAlt(true)->setAltImgs($altimgs)
->render();
No more hassle with remembering which argument is which or hardcodeing long list of parameters just to change last one of them.
Following methods are supported
* Cell (buildCell) * Multicell (buildMulticell) * Image (buildImage) * ImageSvg (buildImageSvg) * ImageEps (buildImageEps) * Text (buildText) * writeHTML (buildHtml) * writeHTMLCell (buildHtmlCell) * write1DBarcode (buildBarcode1d) * write2DBarcode (buildBarcode2d) * Write (buildWrite)
If you are using some kind of fork of TCPDF, you can write your own warper. Every statement builder allows you to inject $tcpdf object.
$image = new \org\majkel\tcpdfwarper\ImageOp($tcpdf);
$image->setFile($file)
->setPos(20, 20)->setSize(64, 64)
->render();
- Fully unit tested - Full code coverage - Code completion friendly (including documentation) - Tested against multiple php versions (5.4 - 7.0, hhvm) - Tested against multiple TCPDF libraries (see travis)
The MIT License (MIT)
Copyright (c) 2015 Micha? (majkel) Kowalik
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Screenshots (1) | ||
Files (75) |
File | Role | Description | ||
---|---|---|---|---|
build (7 files) | ||||
examples (2 files) | ||||
src (1 directory) | ||||
style (1 file) | ||||
tests (1 file, 2 directories) | ||||
.codeclimate.yml | Data | Code Climate confguration | ||
.travis.yml | Data | travis config | ||
composer.json | Data | composer config | ||
composer.lock | Data | composer lock | ||
LICENSE.md | Lic. | LICENSE | ||
phpunit.xml | Data | phpunit conf | ||
README.md | Doc. | readme |
Files (75) | / | build |
File | Role | Description |
---|---|---|
generator.class.template.php | Aux. | generator class template |
generator.config.php | Aux. | generator config |
generator.php | Aux. | generator |
generator.trait.template.php | Aux. | generator trait template |
run_phpcs.sh | Data | phpcs command |
travis.composer.json | Data | travis composer |
travis.phpunit.xml | Data | travis phpunit |
Files (75) | / | examples |
File | Role | Description |
---|---|---|
example-01.php | Example | Example script 01 |
image-01.jpg | Data | image for example 01 |
Files (75) | / | src | / | org | / | majkel | / | tcpdfwarper |
File | Role | Description | ||
---|---|---|---|---|
generator (7 files) | ||||
AbstractException.php | Class | Exception base class | ||
AbstractOp.php | Class | Call base class | ||
Barcode1dOp.php | Class | write1DBarcode | ||
Barcode2dOp.php | Class | write2DBarcode | ||
CellOp.php | Class | Cell call class | ||
HtmlCellOp.php | Class | writeHTMLCell | ||
HtmlOp.php | Class | writeHTML | ||
ImageEpsOp.php | Class | ImageEps | ||
ImageOp.php | Class | Image call class | ||
ImageSvgOp.php | Class | ImageSvg | ||
MissingArgException.php | Class | Missing argument exception | ||
MissingMethodException.php | Class | Missing method exception | ||
MultiCellOp.php | Class | Multicell call class | ||
TCPDFWarper.php | Class | The warper | ||
TCPDFWarperTrait.php | Class | Warper trait | ||
TextOp.php | Class | Text call class | ||
Utils.php | Class | Utility functions | ||
WriteOp.php | Class | Write |
Files (75) | / | src | / | org | / | majkel | / | tcpdfwarper | / | generator |
File | Role | Description |
---|---|---|
Argument.php | Aux. | generator |
ClassDefinition.php | Aux. | generator |
ClassMetaMethod.php | Aux. | generator |
ConfigItem.php | Aux. | generator |
ConfigMetaMethod.php | Aux. | generator |
Generator.php | Aux. | generator |
GeneratorException.php | Aux. | generator |
Files (75) | / | tests | / | org | / | majkel | / | tcpdfwarper |
File | Role | Description | ||
---|---|---|---|---|
generator (7 files, 1 directory) | ||||
AbstractOpTest.php | Test | tests | ||
AbstractTestCase.php | Test | tests | ||
Barcode1dOpTest.php | Test | test write1DBarcode | ||
Barcode2dOpTest.php | Test | test write2DBarcode | ||
CellOpTest.php | Test | tests | ||
DummyTcpdf.php | Test | dummy test tcpdf | ||
HtmlCellOpTest.php | Test | test writeHTMLCell | ||
HtmlOpTest.php | Test | test writeHTML | ||
ImageEpsOpTest.php | Test | test ImageEps | ||
ImageOpTest.php | Test | tests | ||
ImageSvgOpTest.php | Test | test ImageSvg | ||
MissingArgExceptionTest.php | Test | tests | ||
MissingMethodExceptionTest.php | Test | tests | ||
MulticellOpTest.php | Test | tests | ||
OpTestAbstract.php | Test | tests | ||
TCPDFWarperTest.php | Test | tests | ||
TextOpTest.php | Test | tests | ||
UtilsTest.php | Test | Utility functions tests | ||
WriteOpTest.php | Test | test Write |
Files (75) | / | tests | / | org | / | majkel | / | tcpdfwarper | / | generator |
File | Role | Description | ||
---|---|---|---|---|
data (4 files) | ||||
ClassDefinitionMock.php | Aux. | test generator | ||
ClassDefinitionSampleClass.php | Aux. | test generator | ||
ClassDefinitionTest.php | Test | test generator | ||
ConfigItemTest.php | Test | test generator | ||
ConfigMetaMethodTest.php | Test | test generator | ||
FuncMock.php | Aux. | test generator | ||
GeneratorTest.php | Test | test generator |
Files (75) | / | tests | / | org | / | majkel | / | tcpdfwarper | / | generator | / | data |
File | Role | Description |
---|---|---|
class.template.php | Aux. | test generator |
config.invalid.php | Aux. | test generator |
config.test.php | Aux. | test generator |
trait.template.php | Aux. | test generator |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
98% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
Composer package |
Github package repository |