for create pdf file from html

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/nikookherad/pdf

dev-master 2023-10-11 14:58 UTC

This package is auto-updated.

Last update: 2025-09-11 19:13:46 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
        )));