2017 © Pedro Peláez
 

library thinreports-php

An implementation of Thinreports Generator in PHP. It provides easy and simple way for generating a PDF on pure PHP

image

thinreports-php/thinreports-php

An implementation of Thinreports Generator in PHP. It provides easy and simple way for generating a PDF on pure PHP

  • Saturday, February 24, 2018
  • by hidakatsuya
  • Repository
  • 17 Watchers
  • 49 Stars
  • 1,987 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 18 Forks
  • 1 Open issues
  • 6 Versions
  • 26 % Grown

The README.md

Thinreports Generator for PHP

Latest Stable Version Latest Unstable Version Build Status Code Climate, (*1)


Currently, New layout format generated by Thinreports Editor 0.9+ is not supported. You can use Thinreports Editor 0.8 to refer to How to install old version. The support project is in progress., (*2)


About

Thinreports Generator for PHP is an implementation of the Thinreports Generator in PHP. It provides easy and simple way for generating a PDF on pure PHP., (*3)

What is Thinreports

Thinreports is an open source report generation tools. It provides the Thinreports Editor which is a tool for designing a report format, and the Thinreports Generator for Ruby which is a library for generating a PDF., (*4)

Please see the following pages for further details., (*5)

Getting Started

Supported PHP versions

Compatibility with Thinreports

  • Thinreports Editor >= 0.8 and < 0.9

Quick Start

Step1 Install Thinreports Editor

See the Official Installation Guide., (*6)

Step2 Install Thinreports Generator for PHP

$ composer require thinreports-php/thinreports-php

Step3 Create a report format file using the Editor

Follow "Step1 Creating the layout for the report" section in the official doucmentation., (*7)

Step4 Write code for generating a PDF

<?php
// date_default_timezone_set('Asia/Tokyo');

$report = new Thinreports\Report('hello_world.tlf');

// 1st page
$page = $report->addPage();
$page->item('world')->setValue('World');
$page->item('thinreports')->setValue('Thinreports');

// 2nd page
$page = $report->addPage();
$page('world')->setValue('PHP');
$page('thinreports')->setValue('Thinreports PHP');

// 3rd page
$page = $report->addPage();
$page('world')->setValue('World')
              ->setStyle('color', '#ff0000');
$page('hello')->hide();

// 4th page
$page = $report->addPage();
$page->setItemValue('thinreports', 'PDF');
$page->setItemValues(array(
  'world' => 'PHP'
));

// 5th page
$page = $report->addPage();
$page->item('world_image')->setSource('/path/to/world.png');

// 6th page: Using other .tlf file
$page = $report->addPage('hello_php.tlf')
$page->item('world')->setValue('php');

// 7th page: Insert a blank page
$report->addBlankPage();

$report->generate('hello_world.pdf');

// You can get content of the PDF in the following code:
$pdf_data = $report->generate();

NOTE: If you want to render multi-byte characters such as "日本語", you need to configure the IPAFont to font-family property of the Text-block in the Editor., (*8)

Development Community

Gitter, (*9)

Features

Implemented

See Quick Start and Quick Reference for currently available features., (*10)

Not Implemented

  • List
  • Disabling Hyphenation
  • Font Fallback
  • Permission and Security settings of PDF

Other Tasks

  • Memory Usage Optimization - Disposing raw base64-data after generating a image file

License

Thinreports PHP is licensed under the MIT-License. See LICENSE for further details., (*11)

Dependency Library & Resource

TCPDF

LGPLv3 / Copyright (c) Nicola Asuni Tecnick.com LTD, (*12)

IPA Font

IPA Font License Agreement v1.0, (*13)

Copyright (c) 2015 Matsukei Co.,Ltd., (*14)

The Versions

24/02 2018

dev-support-new-schema

dev-support-new-schema https://github.com/thinreports-php

An implementation of Thinreports Generator in PHP. It provides easy and simple way for generating a PDF on pure PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Katsuya HIDAKA

pdf reporting

08/01 2018

dev-master

9999999-dev https://github.com/thinreports-php

An implementation of Thinreports Generator in PHP. It provides easy and simple way for generating a PDF on pure PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Katsuya HIDAKA

pdf reporting

23/11 2016

0.8.1

0.8.1.0 https://github.com/thinreports-php

An implementation of Thinreports Generator in PHP. It provides easy and simple way for generating a PDF on pure PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Katsuya HIDAKA

pdf reporting

22/11 2015

0.8.0

0.8.0.0 https://github.com/thinreports-php

An implementation of Thinreports Generator in PHP. It provides easy and simple way for generating a PDF on pure PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Katsuya HIDAKA

pdf reporting

10/08 2015

0.8.0-alpha2

0.8.0.0-alpha2 https://github.com/thinreports-php

An implementation of Thinreports Generator in PHP. It provides easy and simple way for generating a PDF on pure PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Katsuya HIDAKA

pdf reporting

08/07 2015

0.8.0-alpha1

0.8.0.0-alpha1 https://github.com/thinreports-php

An implementation of Thinreports Generator in PHP. It provides easy and simple way for generating a PDF on pure PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Katsuya HIDAKA

pdf reporting