- How do I install evosys21/pdflib in a Laravel project?
- Run `composer require evosys21/pdflib` in your project root. Ensure your Laravel version is 9.x+ (PHP 8.1+) for full Pint compatibility. No additional dependencies are required beyond FPDF/TCPDF/tFPDF, which pdlib wraps.
- Does this package support underlined text in PDFs?
- Yes, pdlib adds TEXT_TYPE underline support via `$pdf->Text('text', 'underline')`. This works with TCPDF’s core and is backward-compatible. Test with `assert` in PHPUnit to verify rendering.
- Can I use this for dynamic Laravel Blade templates?
- Absolutely. Extend Blade with a directive like `@underline('text')` in your `BladeServiceProvider`. This integrates seamlessly with pdlib’s text methods for inline styling in PDFs.
- What Laravel versions does evosys21/pdflib support?
- The package works with Laravel 9.x+ (PHP 8.1+). For older Laravel versions, use `^1.1` to avoid Pint-related issues. Check the [GitHub actions](https://github.com/evosys21/pdflib/actions) for compatibility.
- How do I handle large PDFs with many underlined terms?
- Benchmark with your worst-case scenario (e.g., 1000 underlined terms). Underline rendering adds ~5–10% overhead per text element. Monitor CPU/memory usage and consider chunking PDF generation for very large documents.
- Is there a way to customize underline styles (color, thickness)?
- Currently, underlines use TCPDF’s defaults. For customization, override TCPDF’s core methods or document limitations in `PDF_STYLES.md`. Advanced styling may require TCPDF Enterprise.
- Can I use this package in a microservices architecture?
- Yes, but underline support may require client-side adjustments if using headless PDF services. Expose styling via JSON payloads (e.g., `{'text': 'term', 'style': 'underline'}`) for API-based generation.
- What alternatives exist for rich-text PDFs in Laravel?
- Consider Dompdf for CSS-based underlines if you’re already using HTML templates. For advanced styling, TCPDF Enterprise offers custom underline colors. SnappyPDF is another option but requires HTML-to-PDF conversion.
- How do I test underline rendering in PHPUnit?
- Use assertions to validate PDF output. For example, check if the generated PDF contains TCPDF’s underline syntax: `assertStringContainsString('underline', $pdf->Output());`. For visual checks, use tools like PixelPerfect.
- Is evosys21/pdflib actively maintained?
- The package has low GitHub activity but includes recent Laravel Pint adoption (PR #17), suggesting ongoing maintenance. The MIT license allows forks if needed. Monitor for updates or contribute to the project.