diff --git a/CHANGELOG.md b/CHANGELOG.md index ded9b80..7547f1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Change log -## 2.0.0 - 2024-08-08 +## 2.0.1 - 2024-08-09 + +- Updated `README.md` file. +- Updated PHP documentation and tutorials. + +## 2.0.0.0 - 2024-08-08 - Updated FPDF version and producer of `PdfDocument`. - **BC Break!**: Modified source structure by adding Enums, Interfaces diff --git a/README.md b/README.md index 163d1b8..0a8049d 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,34 @@ # FPDF2 -This repository is clone of [fpdf.org](http://www.fpdf.org) with typed -variables, enumerations and PHP 8.2 dependencies. +This repository is clone of [fpdf.org](http://www.fpdf.org) with typed variables, +enumerations and PHP 8.2 dependencies. `PdfDocument` is a PHP class, which allows to generate PDF files with pure PHP. **F** from FPDF2 stands for **Free**: you may use it for any kind of usage and modify it to suit your needs. -## Installation with [Composer](https://packagist.org/packages/laurentmuller/fpdf2) +## Installation -If you're using Composer to manage dependencies, you can use +If you're using [Composer](https://getcomposer.org/) to manage dependencies, +you can use: -```powershell -composer require laurentmuller/fpdf2:^1.9 +```bash +composer require laurentmuller/fpdf2 ``` -Or you can include the following in your `composer.json` file: +Alternatively, you can add the requirement `"laurentmuller/fpdf2":"^2.0"` to +your `composer.json` file and run `composer update`. This could be useful when +the installation of FPDF2 is not compatible with some currently installed +dependencies. Anyway, the previous option is the preferred way, since composer +can pick the best requirement constraint for you. -```json -{ - "require": { - "laurentmuller/fpdf2": "^1.9" - } -} -``` - -**Usage:** +## Basic Usage ```php +use fpdf\Enums\PdfFontName; +use fpdf\Enums\PdfFontStyle; +use fpdf\PdfDocument; + $pdf = new PdfDocument(); $pdf->addPage(); $pdf->setFont(PdfFontName::ARIAL, PdfFontStyle::BOLD, 16); @@ -35,7 +36,7 @@ $pdf->cell(40, 10, 'Hello World!'); $pdf->output(); ``` -**Tutorials:** +## Tutorials - [Minimal example](doc/tuto_1.md) - [Header, footer, page break and image](doc/tuto_2.md) diff --git a/doc/tuto_1.md b/doc/tuto_1.md index a9b233e..f46e358 100644 --- a/doc/tuto_1.md +++ b/doc/tuto_1.md @@ -3,9 +3,9 @@ Let's start with the classic example: ```php +use fpdf\Enums\PdfFontName; +use fpdf\Enums\PdfFontStyle; use fpdf\PdfDocument; -use fpdf\PdfFontName; -use fpdf\PdfFontStyle; $pdf = new PdfDocument(); $pdf->addPage(); diff --git a/doc/tuto_2.md b/doc/tuto_2.md index 3f0b379..0343a06 100644 --- a/doc/tuto_2.md +++ b/doc/tuto_2.md @@ -3,11 +3,11 @@ Here's a two-page example with a header, a footer and a logo: ```php +use fpdf\Enums\PdfFontName; +use fpdf\Enums\PdfFontStyle; +use fpdf\Enums\PdfMove; use fpdf\PdfBorder; use fpdf\PdfDocument; -use fpdf\PdfFontName; -use fpdf\PdfFontStyle; -use fpdf\PdfMove; class CustomDocument extends PdfDocument { diff --git a/doc/tuto_3.md b/doc/tuto_3.md index ecf53c2..afb6f58 100644 --- a/doc/tuto_3.md +++ b/doc/tuto_3.md @@ -4,13 +4,12 @@ Let's continue with an example, which prints justified paragraphs. It also illustrates the use of colors. ```php - +use fpdf\Enums\PdfFontName; +use fpdf\Enums\PdfFontStyle; +use fpdf\Enums\PdfMove; +use fpdf\Enums\PdfTextAlignment; use fpdf\PdfBorder; use fpdf\PdfDocument; -use fpdf\PdfFontName; -use fpdf\PdfFontStyle; -use fpdf\PdfMove; -use fpdf\PdfTextAlignment; class CustomDocument extends PdfDocument { diff --git a/doc/tuto_4.md b/doc/tuto_4.md index 8e7111b..8bc0464 100644 --- a/doc/tuto_4.md +++ b/doc/tuto_4.md @@ -4,12 +4,12 @@ This example is a variant of the previous one showing how to lay the text across multiple columns. ```php +use fpdf\Enums\PdfFontName; +use fpdf\Enums\PdfFontStyle; +use fpdf\Enums\PdfMove; +use fpdf\Enums\PdfTextAlignment; use fpdf\PdfBorder; use fpdf\PdfDocument; -use fpdf\PdfFontName; -use fpdf\PdfFontStyle; -use fpdf\PdfMove; -use fpdf\PdfTextAlignment; class CustomDocument extends PdfDocument { diff --git a/doc/tuto_5.md b/doc/tuto_5.md index afff670..2793e58 100644 --- a/doc/tuto_5.md +++ b/doc/tuto_5.md @@ -4,12 +4,12 @@ This tutorial shows different ways to make tables. ```php +use fpdf\Enums\PdfFontName; +use fpdf\Enums\PdfFontStyle; +use fpdf\Enums\PdfMove; +use fpdf\Enums\PdfTextAlignment; use fpdf\PdfBorder; use fpdf\PdfDocument; -use fpdf\PdfFontName; -use fpdf\PdfFontStyle; -use fpdf\PdfMove; -use fpdf\PdfTextAlignment; class CustomDocument extends PdfDocument { diff --git a/src/Enums/PdfDirection.php b/src/Enums/PdfDirection.php index 06883bb..de2f09b 100644 --- a/src/Enums/PdfDirection.php +++ b/src/Enums/PdfDirection.php @@ -17,6 +17,8 @@ use fpdf\Traits\PdfEnumDefaultTrait; /** + * The PDF direction enumeration. + * * The predominant reading order for text. * * @implements PdfEnumDefaultInterface diff --git a/src/Enums/PdfDuplex.php b/src/Enums/PdfDuplex.php index 0ca0fac..6937815 100644 --- a/src/Enums/PdfDuplex.php +++ b/src/Enums/PdfDuplex.php @@ -17,6 +17,8 @@ use fpdf\Traits\PdfEnumDefaultTrait; /** + * The PDF duplex enumeration. + * * The paper handling option that shall be used when printing the file from the print dialog. * * @implements PdfEnumDefaultInterface diff --git a/src/Enums/PdfLineCap.php b/src/Enums/PdfLineCap.php index fe6c06a..5ed26d5 100644 --- a/src/Enums/PdfLineCap.php +++ b/src/Enums/PdfLineCap.php @@ -13,6 +13,8 @@ namespace fpdf\Enums; /** + * The PDF line cap enumeration. + * * The line cap style specifies the shape to be used at the ends of open sub-paths (and dashes, if any) when they * are stroked. */ diff --git a/src/Enums/PdfLineJoin.php b/src/Enums/PdfLineJoin.php index 83c41d4..ef2359c 100644 --- a/src/Enums/PdfLineJoin.php +++ b/src/Enums/PdfLineJoin.php @@ -13,6 +13,8 @@ namespace fpdf\Enums; /** + * The PDF line join enumeration. + * * The line join style specifies the shape to be used at the corners of paths that are stroked. * * Join styles are significant only at points where consecutive segments of a path connect at an angle; segments that diff --git a/src/Enums/PdfMove.php b/src/Enums/PdfMove.php index 32cf2e0..78ac485 100644 --- a/src/Enums/PdfMove.php +++ b/src/Enums/PdfMove.php @@ -15,8 +15,9 @@ /** * PDF move enumeration. * + * Indicates where the current position should go after a cell is printed. + * * @see PdfDocument::cell() - * @see PdfDocument::multiCell() */ enum PdfMove { diff --git a/src/Enums/PdfNonFullScreenPageMode.php b/src/Enums/PdfNonFullScreenPageMode.php index a0ceba4..f5d7b26 100644 --- a/src/Enums/PdfNonFullScreenPageMode.php +++ b/src/Enums/PdfNonFullScreenPageMode.php @@ -17,6 +17,8 @@ use fpdf\Traits\PdfEnumDefaultTrait; /** + * The PDF exiting non-full-screen mode enumeration. + * * Specifying how to display the document on exiting full-screen mode. * * @implements PdfEnumDefaultInterface diff --git a/src/Enums/PdfPageSize.php b/src/Enums/PdfPageSize.php index 78429eb..e6140ea 100644 --- a/src/Enums/PdfPageSize.php +++ b/src/Enums/PdfPageSize.php @@ -18,6 +18,8 @@ /** * The PDF document page size enumeration. + * + * Each enumeration defines the page size and the unit used. */ enum PdfPageSize: string { diff --git a/src/Enums/PdfRectangleStyle.php b/src/Enums/PdfRectangleStyle.php index aed823f..7524d93 100644 --- a/src/Enums/PdfRectangleStyle.php +++ b/src/Enums/PdfRectangleStyle.php @@ -13,7 +13,9 @@ namespace fpdf\Enums; /** - * The PDF style to draw and/or fill rectangle. + * The PDF rectangle style enumeration. + * + * Define the style used to draw and/or to fill rectangle. * * @see PdfDocument::rect() */ diff --git a/src/Enums/PdfScaling.php b/src/Enums/PdfScaling.php index 5a76164..c0d2bf1 100644 --- a/src/Enums/PdfScaling.php +++ b/src/Enums/PdfScaling.php @@ -17,6 +17,8 @@ use fpdf\Traits\PdfEnumDefaultTrait; /** + * The PDF scaling enumeration. + * * The page scaling option that shall be selected when a print dialog is displayed for this document. * * @implements PdfEnumDefaultInterface diff --git a/src/Enums/PdfTextAlignment.php b/src/Enums/PdfTextAlignment.php index d5d24b8..c51f921 100644 --- a/src/Enums/PdfTextAlignment.php +++ b/src/Enums/PdfTextAlignment.php @@ -13,7 +13,7 @@ namespace fpdf\Enums; /** - * The cell text alignment enumeration. + * The PDF cell text alignment enumeration. * * @see PdfDocument::cell() * @see PdfDocument::multiCell()