for create pdf file from html

Maintainers

Package info

github.com/a-nikookherad/pdf

Homepage

pkg:composer/nikookherad/pdf

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

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

This package is auto-updated.

Last update: 2026-04-11 20:26:38 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
        )));