fix(food): remplace le parseur PDF maison par smalot/pdfparser
Deploy HouseHub / deploy (push) Successful in 2s
Deploy HouseHub / deploy (push) Successful in 2s
Le parseur regex fait maison ne décodait pas les polices Type0/CID avec table ToUnicode (courant sur les menus générés par des outils pro), donc les mots-clés "PLAT CHAUD"/"GARNITURE" n'étaient jamais reconnus et l'import échouait systématiquement sur ce type de PDF. Ajoute aussi une correction de la reconnaissance de label insensible aux accents (strtoupper ne gère pas les accents) et élargit la tolérance verticale de la grille pour capter les plats sur plusieurs lignes sans capter la ligne "Déclinaison" (alternative végé). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4201adb571
commit
3a64934eb5
76 files changed
+15467
-64
No files matched your search
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
# PDF parser
|
||||
|
||||
[](//packagist.org/packages/smalot/pdfparser)
|
||||

|
||||

|
||||
[](https://scrutinizer-ci.com/g/smalot/pdfparser/?branch=master)
|
||||
[](//packagist.org/packages/smalot/pdfparser)
|
||||
|
||||
The `smalot/pdfparser` is a standalone PHP package that provides various tools to extract data from PDF files.
|
||||
|
||||
This library is under **active maintenance**.
|
||||
There is no active development by the author of this library (at the moment), but we welcome any pull request adding/extending functionality!
|
||||
See [CONTRIBUTING.md](./CONTRIBUTING.md) for further information about how to contribute.
|
||||
|
||||
## Features
|
||||
|
||||
- Load/parse objects and headers
|
||||
- Extract metadata (author, description, ...)
|
||||
- Extract text from ordered pages
|
||||
- Support of compressed PDFs
|
||||
- Support of MAC OS Roman charset encoding
|
||||
- Handling of hexa and octal encoding in text sections
|
||||
- Create custom configurations (see [CustomConfig.md](/doc/CustomConfig.md)).
|
||||
|
||||
Currently, secured documents and extracting form data are not supported.
|
||||
|
||||
## License
|
||||
|
||||
This library is under the [LGPLv3 license](https://github.com/smalot/pdfparser/blob/master/LICENSE.txt).
|
||||
|
||||
## Install
|
||||
|
||||
This library requires PHP 7.1+ since [v1](https://github.com/smalot/pdfparser/releases/tag/v1.0.0).
|
||||
You can install it via [Composer](https://getcomposer.org/):
|
||||
|
||||
```bash
|
||||
composer require smalot/pdfparser
|
||||
```
|
||||
|
||||
In case you can't use Composer, you can include `alt_autoload.php-dist`. It will include all required files automatically.
|
||||
|
||||
## Quick example
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
// Parse PDF file and build necessary objects.
|
||||
$parser = new \Smalot\PdfParser\Parser();
|
||||
$pdf = $parser->parseFile('/path/to/document.pdf');
|
||||
|
||||
$text = $pdf->getText();
|
||||
echo $text;
|
||||
```
|
||||
|
||||
Further usage information can be found [here](/doc/Usage.md).
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation can be found in the [doc](/doc) folder.
|
||||
Reference in new issue
Block a user