cointavia / html-to-pdf-converter
Convert HTML code into PDF File
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/cointavia/html-to-pdf-converter
Requires
- php: ^7.3 || ^8.0
- illuminate/support: ^7.0 || ^8.0
README
Please visit Cointavia PDF Generator for more information:
Support
Getting Started
Installation
The CointaviaPDF Service Provider can be installed via Composer by requiring the
cointavia/html-to-pdf-converter package.
composer require cointavia/html-to-pdf-converter
Then run a composer update
composer update
To use the CointaviaPDF Service Provider, you must register the provider when bootstrapping your application.
⭐Purchase Api Token
You can purchase api token through pdf.cointavia.com
Configuration
To customize the configuration file, publish the package configuration using Artisan.
php artisan vendor:publish --provider="Cointavia\PDF\CointaviaPDFServiceProvider"
The settings can be found in the generated config/cointavia-pdf.php configuration file.
return [ 'auth_token' => '**********', 'user_token' => '**********' ];
Usage
You can create a new CointaviaPDF instance and load a HTML string, file or view name. You can save it to a file, or stream (show in browser) or download.
Use the facade in Controller or Service:
use CointaviaPDF;
then
$fileName = "Sample File"; $htmlData = "<h1>Hello</h1><p>World</p>"; $pdfFile = CointaviaPDF::generatePDF($fileName,$htmlData);
With successfull request Cointavia Api will return
{
"status": 200,
"success": {
"filePath": "Path-To-Download-PDF"
}
}
Disclaimer
All rights reserved @cointavia