Skip to content

Commit

Permalink
Version 2.0.1.
Browse files Browse the repository at this point in the history
- Updated "README.md" file.
- Updated PHP documentation and tutorials.
  • Loading branch information
laurentmuller committed Aug 9, 2024
1 parent 4700a4d commit 2418e31
Show file tree
Hide file tree
Showing 17 changed files with 61 additions and 39 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
# 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);
$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)
Expand Down
4 changes: 2 additions & 2 deletions doc/tuto_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions doc/tuto_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
9 changes: 4 additions & 5 deletions doc/tuto_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions doc/tuto_4.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions doc/tuto_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 2 additions & 0 deletions src/Enums/PdfDirection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use fpdf\Traits\PdfEnumDefaultTrait;

/**
* The PDF direction enumeration.
*
* The predominant reading order for text.
*
* @implements PdfEnumDefaultInterface<PdfDirection>
Expand Down
2 changes: 2 additions & 0 deletions src/Enums/PdfDuplex.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<PdfDuplex>
Expand Down
2 changes: 2 additions & 0 deletions src/Enums/PdfLineCap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Enums/PdfLineJoin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Enums/PdfMove.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 2 additions & 0 deletions src/Enums/PdfNonFullScreenPageMode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<PdfNonFullScreenPageMode>
Expand Down
2 changes: 2 additions & 0 deletions src/Enums/PdfPageSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

/**
* The PDF document page size enumeration.
*
* Each enumeration defines the page size and the unit used.
*/
enum PdfPageSize: string
{
Expand Down
4 changes: 3 additions & 1 deletion src/Enums/PdfRectangleStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Enums/PdfScaling.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<PdfScaling>
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/PdfTextAlignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace fpdf\Enums;

/**
* The cell text alignment enumeration.
* The PDF cell text alignment enumeration.
*
* @see PdfDocument::cell()
* @see PdfDocument::multiCell()
Expand Down

0 comments on commit 2418e31

Please sign in to comment.