1. Go to this page and download the library: Download veoksha/pdfit library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
veoksha / pdfit example snippets
use Veoksha\LaravelUniversalConverter\Converter;
$pdfPath = Converter::toPdf('path/to/document.docx');
use Veoksha\LaravelUniversalConverter\Converter;
// Convert any file to PDF (output: same directory, .pdf extension)
$pdfPath = Converter::toPdf('path/to/document.docx');
// Specify output path
Converter::toPdf('input.pptx', 'storage/app/output/report.pdf');
use Veoksha\LaravelUniversalConverter\Converter;
class ExportController extends Controller
{
public function export(Converter $converter)
{
$pdf = $converter->toPdf(storage_path('uploads/report.xlsx'));
return response()->download($pdf);
}
}