nikookherad / pdf
for create pdf file from html
dev-master
2023-10-11 14:58 UTC
Requires
- php: >=7.4
- guzzlehttp/guzzle: ~5.0
- laravel/framework: ^9.19
Requires (Dev)
- phpunit/phpunit: ~6.0 || ~7.0 || ~9.0
This package is auto-updated.
Last update: 2024-09-11 17:05:12 UTC
README
This service use for convert html to pdf
This service needs athena pdf service(https://github.com/arachnys/athenapdf)
For initialize this service make sure you set environment's variables
PDF_SERVICE_URL=172.19.0.5:8080 PDF_SERVICE_AUTH=arachnys-weaver
this service has three methods
- set html method:
$html=view("athenaTemplate.test.index"); PDF\PDF::setHtml($html);
- render method:
$html=view("athenaTemplate.test.index"); return response()->make(PDF\PDF:: setHtml($html) ->render(),200, [ 'content-type' => 'application/pdf' ]);
- download method:
$html=view("athenaTemplate.test.index"); $pdfName="test"; PDF\PDF::setHtml($html) ->download(public_path(sprintf( 'temp/%s.pdf', $pdfName )));