Skip to content

Commit

Permalink
Update (#7)
Browse files Browse the repository at this point in the history
* Tag regex doesn't match some valid tags

tags like
<div key=
"value">
While valid html do not get matched by the regex because of the newline between the = and the "value"

* Update basic.md

* fix param list to call write2DBarcode()

* Update CHANGELOG.md

* Update README.md

I like to update

* Create ja.csv (with english content for now)

* Add ja locale

* added LT locale support

* Update Path.php

Fixes issue spipu#618

* Adapt path preparation for e notation

* Update dependency version of tecnickcom/tcpdf

* Update Html2Pdf.php

add support for BASE64 encoded images also for backimg tag in page

* Use multibyte aware substr when setting newline position

* update chanlog from last merged MR

* Update install.md

* Spell Correction

Spell Correction Exemple => Example for english document version.

* prepare the next release

* Update CHANGELOG.md

Prepare the next release

* prepare the next release

* Update .travis.yml

* Update README.md

* revert fix multibyte aware substr when setting newline position - it causes pbs on some specific cases

* better code quality

* add security on scheme of css and image paths

* add security on scheme of css and image paths

* prepare release 5.2.4

* add cve id on changelog

Co-authored-by: Adrien Foulon <6115458+Tofandel@users.noreply.github.com>
Co-authored-by: Antoine Makdessi <amakdessi@me.com>
Co-authored-by: Francois RAOULT <fra.raoult@gmail.com>
Co-authored-by: Laurent MINGUET <spipu@users.noreply.github.com>
Co-authored-by: Anas Raza Khan <70201063+codeanas@users.noreply.github.com>
Co-authored-by: Alexis <alexis.urien@free.fr>
Co-authored-by: pionell <skypeon@gmail.com>
Co-authored-by: Christian Budde <Christian@savioursofsoul.de>
Co-authored-by: humancopy <147451+humancopy@users.noreply.github.com>
Co-authored-by: berengan <berengan@users.noreply.github.com>
Co-authored-by: Andy Ford <andrew.ford@mayden.co.uk>
Co-authored-by: Punit Patel <pintupatel05@gmail.com>
Co-authored-by: Interduo <jkl@interduo.pl>
Co-authored-by: Laurent Minguet <laurent@spareka.com>
  • Loading branch information
15 people authored Feb 2, 2022
1 parent 9a8c20d commit b54015f
Show file tree
Hide file tree
Showing 17 changed files with 4,352 additions and 4,127 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ php:
- 7.2
- 7.3
- 7.4
- 8.0

before_script:
- composer selfupdate
Expand Down
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

All notable changes to this project will be documented in this file.

## [5.2.3](https://github.com/spipu/html2pdf/compare/v5.2.2...master) - unreleased
## [5.2.4](https://github.com/spipu/html2pdf/compare/v5.2.3...v5.2.4) - 2021-12-16

* nothing yet
* revert fix multibyte aware substr when setting newline position - it causes pbs on some specific cases
* security #CVE-2021-45394 - add security on scheme of css and image paths - thanks to Clément Amic and Antoine Gicquel from [Synacktiv](https://www.synacktiv.com/)

## [5.2.3](https://github.com/spipu/html2pdf/compare/v5.2.2...v5.2.3) - 2021-10-19

* add support for BASE64 encoded images also for backimg tag in page - thanks to @berengan
* fix issue on write2DBarcode parameters - thanks to @Sarigue
* fix svg path parser - thanks to @CWBudde - issue #618
* fix html attribute parser - thanks to @Tofandel
* fix multibyte aware substr when setting newline position - thanks to @AndyTWF
* add php8 compatibility and fix tcpdf compatibilty - thanks to @humancopy

## [5.2.2](https://github.com/spipu/html2pdf/compare/v5.2.1...v5.2.2) - 2020-03-22

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Html2Pdf

Html2Pdf is a HTML to PDF converter written in PHP, and compatible with PHP **5.6** to **7.4**.
Html2Pdf is a HTML to PDF converter written in PHP, and compatible with PHP **5.6** to **8.0**.

It allows the conversion of valid HTML in PDF format, to generate documents like invoices, documentation, ...

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
}
],
"require": {
"php": "^5.6 || ^7.0",
"php": "^5.6 || ^7.0 || ^8.0",
"ext-mbstring": "*",
"ext-gd": "*",
"tecnickcom/tcpdf": "^6.2"
"tecnickcom/tcpdf": "^6.3"
},
"require-dev": {
"phpunit/phpunit": "^5.0",
Expand Down
6 changes: 3 additions & 3 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* A DEBUG mode to know the resources used is present. It is activated by adding the following command just after the contructor (see Example 0): `$html2pdf->setModeDebug();`
* Some specific tags have been introduced:

* `<page></page>` (CF Exemple 7)
* `<page></page>` (CF Example 7)

* Determines the orientation, margins left, right, top and bottom, the background image and the background color of a page, its size and position, the footer.
* It is also possible to keep the header and footer of the previous pages, through the attribut `pageset="old"` (see Example 3 & 4)
Expand All @@ -47,8 +47,8 @@

* `<barcode></barcode>` (CF Examples 0 & 9)

* Can insert barcodes in pdfs, CF Examples 0 and 9
* the possible types of codebar are alls of TCPDF
* Can insert barcodes in pdfs, CF Examples 0 and 9.
* the possible types of codebar are alls of TCPDF.

* `<qrcode></qrcode>` (CF Example 13)

Expand Down
2 changes: 1 addition & 1 deletion doc/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The PHP constructor takes the following parameters:
Variable | Default value |Description
---------|---------------|--------------
$orientation | P | The default page orientation, can be P (portrait) or L (landscape)
$format | A4 | The default page format used for pages. The list of the available value are [here](https://github.com/tecnickcom/TCPDF/blob/master/include/tcpdf_static.php#L2097). You can also give a array with 2 values the width and the height in mm.
$format | A4 | The default page format used for pages. The list of the available value are [here](https://github.com/tecnickcom/TCPDF/blob/485956db63b5a225760e80fa2278bdb22eca4650/include/tcpdf_static.php#L2129). You can also give a array with 2 values the width and the height in mm.
$lang | fr | Language to use, for some minor translations. The list of the available languages are [here](https://github.com/spipu/html2pdf/tree/master/src/locale)
$unicode | true | means that the input HTML string is unicode
$encoding |UTF-8 | charset encoding of the input HTML string
Expand Down
43 changes: 14 additions & 29 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@

## Composer and Packagist

You must use Composer to install Html2Pdf.
You have to use Composer to install Html2Pdf.

If you do not know what is Composer, you are a few years late...
If you do not know what is Composer:

It is used by all the modern PHP applications (Magento2, Drupal, EasyPlatform, Symfony, ...).

You can read all the pages on https://getcomposer.org/doc/

You can find all the available packages on https://packagist.org/

For example, you can find Html2Pdf: https://packagist.org/packages/spipu/html2pdf

You have to commit the `composer.json` and `composer.lock` files, but **never** commit the `vendor` folder.

If you do not understand why, it is because you have not read the Composer documentation...
* You can find the documentation on https://getcomposer.org/doc/
* You can find all the available packages on https://packagist.org/
* For example, you can find Html2Pdf: https://packagist.org/packages/spipu/html2pdf

## Install

You have just to launch the following command on the root folder of your project:
You just have to launch the following command on the root folder of your project:

```bash
composer require spipu/html2pdf
```

If you do not want to use composer, you will need to:

* manually clone the html2pdf repository
* manually clone all the repositories of the used dependencies
* manage manually the PS4 autoload

But it is not the recommaned way to instal Html2Pdf. No help will be provided in this case.

### First Test

Here is a HelloWorld example, that you can put on the root folder of your project.
Expand All @@ -46,19 +46,4 @@ Html2Pdf use the PSR-4 autoloader of Composer. You have just to require it. Neve

Then, you have just to use the main class `Spipu\Html2Pdf\Html2Pdf`, with the 2 main methods `writeHTML` and `output`.

### And on production ?

You have **not** to install composer on your production server.

You have to install composer **only** on your dev environement. Composer is a dev tool.

To deliver you app on a server, you have to (on you dev environement) :

* Git clone the tag/branch that you want to deliver
* Launch the command `composer install --no-dev`
* Remove the useless files (like the `.git` folder)
* Zip all

That's all, you have a beautifull package that can be deliver on a server !

[back](./README.md)
2 changes: 1 addition & 1 deletion examples/res/ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<h1>Billet soirée spécial Html2Pdf</h1>
&nbsp;&nbsp;&nbsp;&nbsp;<b>Valable le <?php echo $date; ?> à 20h30</b><br>
<img src="./res/logo.gif" alt="logo" style="margin-top: 3mm; margin-left: 20mm">
<img src="./res/logo.gif" alt="logo" style="width: 213px; margin-top: 3mm; margin-left: 20mm">
</div>
</td>
</tr>
Expand Down
Loading

0 comments on commit b54015f

Please sign in to comment.