2017 © Pedro Peláez
 

library tcpdf-warper

Create PDF documents using TCPDF fluent interface

image

majkel.org/tcpdf-warper

Create PDF documents using TCPDF fluent interface

  • Wednesday, January 27, 2016
  • by majkel
  • Repository
  • 1 Watchers
  • 2 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

TCPDF Warper

Build Status SensioLabsInsight Code Climate Test Coverage Latest Stable Version Latest Unstable Version PHP Version License, (*1)

Installation

 composer require tecnick.com/tcpdf       ### or any TCPDF library
 composer require org.majkel/tcpdfwarper

About

Provides fluent statement builders for TCPDF library., (*2)

Mine intention was to make calls to methods, with many arguments, clearer and more maintainable., (*3)

// 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., (*4)

Following methods are supported, (*5)

  • 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., (*6)

 $image = new \org\majkel\tcpdfwarper\ImageOp($tcpdf);
 $image->setFile($file)
     ->setPos(20, 20)->setSize(64, 64)
     ->render();

Features

  • 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)

License

The MIT License (MIT), (*7)

Copyright (c) 2015 Michał (majkel) Kowalik, (*8)

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:, (*9)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*10)

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., (*11)

Bitdeli Badge, (*12)

The Versions

27/01 2016

dev-master

9999999-dev

Create PDF documents using TCPDF fluent interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf warper

27/01 2016

v0.2.4

0.2.4.0

Create PDF documents using TCPDF fluent interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf warper

28/12 2015

v0.2.3

0.2.3.0

Create PDF documents using TCPDF fluent interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf warper

11/11 2015

v0.2.2

0.2.2.0

Create PDF documents using TCPDF fluent interface

  Sources   Download

Freeware

The Requires

  • php >=5.4.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf warper

21/06 2015

v0.2.1

0.2.1.0

Create PDF documents using TCPDF fluent interface

  Sources   Download

Freeware

The Requires

  • php >=5.4.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf warper

19/01 2015

v0.2.0

0.2.0.0

Create PDF documents using TCPDF fluent interface

  Sources   Download

Freeware

The Requires

  • php >=5.4.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf warper

09/01 2015

v0.1.3

0.1.3.0

TCPDF warper. Shortcuts library calls.

  Sources   Download

Freeware

The Requires

  • php >=5.3.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf warper

08/01 2015

v0.1.2

0.1.2.0

TCPDF warper. Shortcuts library calls.

  Sources   Download

Freeware

The Requires

  • php >=5.3.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf warper

30/12 2014

v0.1.1

0.1.1.0

TCPDF warper. Shortcuts library calls.

  Sources   Download

Freeware

The Requires

  • php >=5.3.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf warper

28/12 2014

v0.1.0

0.1.0.0

TCPDF warper. Shortcuts library calls.

  Sources   Download

Freeware

The Requires

  • php >=5.3.0

 

The Development Requires

by Michal Kowalik

pdf tcpdf wartper