Files
PDFcreator/README.md

3.2 KiB

pdfCreator

Projekt na generovanie PDF suborov pomocou tecnickcom/tc-lib-pdf.

Slovensky

Inicializacia po cistom clone

Po novom clone repozitara alebo po zmazani adresara vendor najprv nainstaluj hlavne Composer zavislosti:

composer install

Samotny composer install nevygeneruje PDF font definicie, ktore tc-lib-pdf-font nacitava pri renderovani. Bez nich moze aplikacia spadnut napr. s chybou:

unable to read file: helvetica.json

Fonty vygeneruj cez utilitny balicek v vendor/tecnickcom/tc-lib-pdf-font:

cd vendor\tecnickcom\tc-lib-pdf-font\util
composer install

cd ..
composer install

cd util
php bulk_convert.php

Po uspesnom behu by mal existovat napr. subor:

vendor\tecnickcom\tc-lib-pdf-font\target\fonts\core\helvetica.json

Skripty

Hello world PDF:

php src\hello-world.php

Bodkovany papier pre technicke nacrtky:

php src\dotted.php

Volitelne parametre bodkovaneho papiera:

php src\dotted.php --dot-size=0.4 --space=5

Vystup z CLI sa ulozi do:

output\dotted.pdf

Web spustenie

Hello world PDF:

http://localhost/pdfcreator/src/hello-world.php

Bodkovany papier inline v prehliadaci:

http://localhost/pdfcreator/src/dotted.php?dot-size=0.4&space=5

Overenie

Syntax PHP skriptov:

php -l src\hello-world.php
php -l src\dotted.php

Poznamka k vendor a output

Adresare vendor a output su ignorovane v Gite. Ak sa vendor zmaze alebo sa projekt inicializuje na inom stroji, treba instalaciu zavislosti a generovanie fontov zopakovat.

English

Fresh Repository Setup

After cloning the repository, or after deleting the vendor directory, install the main Composer dependencies first:

composer install

The root composer install does not generate the PDF font definition files used by tc-lib-pdf-font at runtime. Without them, the application may fail with an error such as:

unable to read file: helvetica.json

Generate the fonts through the utility package inside vendor/tecnickcom/tc-lib-pdf-font:

cd vendor\tecnickcom\tc-lib-pdf-font\util
composer install

cd ..
composer install

cd util
php bulk_convert.php

After a successful run, this file should exist:

vendor\tecnickcom\tc-lib-pdf-font\target\fonts\core\helvetica.json

Scripts

Hello world PDF:

php src\hello-world.php

Dotted paper for technical sketches:

php src\dotted.php

Optional dotted paper parameters:

php src\dotted.php --dot-size=0.4 --space=5

CLI output is saved to:

output\dotted.pdf

Web Usage

Hello world PDF:

http://localhost/pdfcreator/src/hello-world.php

Dotted paper rendered inline in the browser:

http://localhost/pdfcreator/src/dotted.php?dot-size=0.4&space=5

Verification

Check PHP syntax:

php -l src\hello-world.php
php -l src\dotted.php

Notes About vendor and output

The vendor and output directories are ignored by Git. If vendor is deleted or the project is initialized on another machine, repeat the dependency installation and font generation steps.