breezy pdf lite php
1.0 !
ไคลเอนต์ PHP สำหรับ Breezy-PDF-Lite, HTML-> บริการ PDF ขับเคลื่อนโดย Google Chrome
Breezy-pdf-lite
Breezypdf Lite: HTML ถึง PDF Generation เป็นบริการ
composer require jitendra/breezy-pdf-lite-php use BreezyPdfLite BreezyPdfLite ;
$ breezy = new BreezyPdfLite ( ' http://localhost:5000 ' , ' VERY_RANDOM_SECRET ' );
// Gets pdf string for given html content
$ breezy -> readHtml ( ' <h1>Hello, world!</h1> ' )
-> getPdfAsString ();
// Saves converted pdf file locally for given html content
$ breezy -> readHtml ( ' <h1>Hello, world!</h1> ' )
-> getPdfSavedAs ( ' /home/ubuntu/hello.pdf ' );
// Saves converted pdf file locally for given local html/view file
$ breezy -> readHtmlFromFile ( ' /home/ubuntu/hello.html ' )
-> getPdfSavedAs ( ' /home/ubuntu/hello.pdf ' );
// Saves converted pdf file locally for given remote html page/view
$ breezy -> readHtmlFromRemote ( ' https://example.com ' )
-> getPdfSavedAs ( ' /home/ubuntu/example.pdf ' );
// Saves converted pdf file locally for given local html page/view
// Also accepts additional print options, ref https://github.com/jitendra-1217/breezy-pdf-lite-php/blob/master/src/Options.php for all available options
// Please note that these options can be provided as part of html meta tags from the html page/view itself (as in /example/2.php file)
// Following options are actually appended in html content as meta tags
$ breezy -> withOptions ([ ' height ' => 5 , ' width ' => 5 ])
-> readHtmlFromFile ( __DIR__ . ' /input/example.html ' )
-> getPdfSavedAs ( __DIR__ . ' /output/example.pdf ' );นอกจากนี้โปรดดู /ตัวอย่าง /* โฟลเดอร์สำหรับการเริ่มต้นอย่างรวดเร็วและทดลองพร้อมตัวเลือก ฯลฯ