WhiteOctoberTCPDFBundle
This bundle facilitates easy use of the TCPDF PDF generation library in
Symfony2 applications.
Installation
Step 1: Add both the bundle and TCPDF to your deps file
[WhiteOctoberTCPDFBundle]
git=http://github.com/whiteoctober/WhiteOctoberTCPDFBundle.git
target=/bundles/WhiteOctober/TCPDFBundle
[TCPDF]
git=git://tcpdf.git.sourceforge.net/gitroot/tcpdf/tcpdf
target=/tecnick.com/tcpdf
Now run the vendors script to download the bundle and library:
$ php bin/vendors install
Step 2: Configure the autoloader
Add the WhiteOctober namespace to your autoloader:
<?php
// app/autoload.php
$loader->registerNamespaces(array(
// ...
'WhiteOctober' => __DIR__.'/../vendor/bundles',
));
Step 3: Enable the bundle in the kernel
Add the bundle to the registerBundles() method in your kernel:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new WhiteOctober\TCPDFBundle\WhiteOctoberTCPDFBundle(),
);
}
Using TCPDF
You can obtain the white_october.tcpdf service from the container,
and then create a new TCPDF object via the service:
$pdfObj = $container->get("white_october.tcpdf")->create();
From hereon in, you are using a TCPDF object to work with as normal.
Using a custom class
If you want to use your own custom TCPDF-based class, you can use
the class parameter in your configuration eg in config.yml:
white_october_tcpdf:
class: 'Acme\MyBundle\MyTCPDFClass'
The class must extend from the TCPDF class; an exception will be
thrown if this is not the case.
License
This bundle is under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSE
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.
white_october_tcpdf:
file: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/tcpdf.php
class: TCPDF
tcpdf:
k_path_url: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/
k_path_main: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/
k_path_fonts: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/fonts/
k_path_cache: %kernel.cache_dir%/tcpdf
k_path_url_cache: %kernel.cache_dir%/tcpdf
k_path_images: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/images/
k_blank_image: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/images/_blank.png
k_cell_height_ratio: 1.25
k_title_magnification: 1.3
k_small_ratio: 0.66666666666667
k_thai_topchars: true
k_tcpdf_calls_in_html: false
k_tcpdf_external_config: true
head_magnification: 1.1
pdf_page_format: A4
pdf_page_orientation: P
pdf_creator: TCPDF
pdf_author: TCPDF
pdf_header_title:
pdf_header_string:
pdf_header_logo:
pdf_header_logo_width:
pdf_unit: mm
pdf_margin_header: 5
pdf_margin_footer: 10
pdf_margin_top: 27
pdf_margin_bottom: 25
pdf_margin_left: 15
pdf_margin_right: 15
pdf_font_name_main: helvetica
pdf_font_size_main: 10
pdf_font_name_data: helvetica
pdf_font_size_data: 8
pdf_font_monospaced: courier
pdf_image_scale_ratio: 1.25
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #13 from Osukaru/master
By richsage, 3 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
Merge pull request #15 from tvlooy/license
By richsage, 6 months ago
-
add license so packagist knows it
By tvlooy, 6 months ago
