[PHP] HTML -> PDF 변환 라이브러리 리스트

[PHP] HTML -> PDF 변환 라이브러리 리스트

- php 용 , html to pdf converter library list 정리

//------------------------

* dompdf /dompdf

https://github.com/dompdf/dompdf - 7.4k

- v0.8.6 , 2020/09

- 복잡한 html에서 에러 발생

Box property calculation requires containing block width", exception: Dompdf

- 라라벨 용

barryvdh /laravel-dompdf

https://github.com/barryvdh/laravel-dompdf - 4.2k

- A DOMPDF Wrapper for Laravel

- v0.8.7 , 2020/09

//------------------------

* KnpLabs /snappy

https://github.com/KnpLabs/snappy - 3.7k

- v1.2.1 , 20/01

wkhtmltopdf , wkhtmltoimage 이용(멀티 칼럼 안됨)

- 라라벨 용

barryvdh /laravel-snappy

https://github.com/barryvdh/laravel-snappy - 1.8k

- Snappy PDF/Image Wrapper for Laravel and Lumen

- v0.4.8 , 2020/09

//--------------------------

* mpdf /mpdf

https://github.com/mpdf/mpdf - 2.9k

- v8.0.0 , 2019/03

- 설치

composer require mpdf/mpdf

- 사용

$mpdf = new \Mpdf\Mpdf();

$mpdf->WriteHTML('Test');

return $mpdf->Output();

- 복잡한 html에서 에러 발생

file: \vendor\mpdf\mpdf\src\Mpdf.php"

message: "Undefined offset: 0"

//------------------

- 라라벨 용

niklasravnsborg /laravel-pdf

https://github.com/niklasravnsborg/laravel-pdf - 515

- v4.0.0 , 2020/02

- mPDF wrapper for Laravel

//--------------------------

* tecnickcom /TCPDF

https://github.com/tecnickcom/TCPDF - 2.7k

- v6.3.5 , 2020/02

https://tcpdf.org/

- html 일괄 변환 안되는듯

- 매뉴얼 부실

//-------------

- 라라벨 용

elibyy /tcpdf-laravel

https://github.com/elibyy/tcpdf-laravel - 163

- v6.0.4 , 2019/10 , v8.0.0 , 2020/09

//------------------------

* spipu /html2pdf

https://github.com/spipu/html2pdf - 1.2k

- v5.2.2 , 2020/03

- 매뉴얼

https://github.com/spipu/html2pdf/blob/master/doc/install.md

- 설치

composer require spipu/html2pdf

- 사용예

$html2pdf = new \Spipu\Html2Pdf\Html2Pdf();

$html2pdf->writeHTML('HelloWorldThis is my first test');

$html2pdf->output();

- 복잡한 html 에서 에러

spipu\html2pdf\src\Parsing\Html.php"

message: "Tags are closed in a wrong order for [1body]"

//----------------------------------

// 참고

* wkhtmltopdf /wkhtmltopdf

https://github.com/wkhtmltopdf/wkhtmltopdf - 10.3k

- 0.12.6 , 2020/01

- Convert HTML to PDF using Webkit (QtWebKit)

- 커맨드 라인 명령어

- 멀티 칼럼 안됨(column-count)

https://wkhtmltopdf.org/

- 사용법

wkhtmltopdf http://google.com google.pdf

//---------------------

* pandoc

https://pandoc.org/

- pdf 변환에 별도의 프로그램 필요

from http://blog.codens.info/2080 by ccl(A) rewrite - 2021-01-05 20:26:39