- What is tecnickcom/tc-lib-pdf-graph used for?
- It is a low-level primitive layer that emits PDF graphics operators such as paths, Bézier curves, clipping, stroke and fill styles, transformation matrices, and gradient or shading dictionaries into a content stream. It is not a PDF generator and does not manage pages, object tables, or output. In practice it arrives as a transitive dependency of tecnickcom/tc-lib-pdf and is used directly only when you need custom vector drawing, chart rendering, or a bespoke layout engine.
- How do I install tc-lib-pdf-graph in a Laravel application?
- Run composer require tecnickcom/tc-lib-pdf-graph on PHP 8.2 or later with the zlib extension available. The package autoloads PSR-4 classes under the Com\Tecnick\Pdf\Graph namespace and has no framework coupling. Most Laravel applications get it indirectly through tc-lib-pdf rather than requiring it directly.
- Does tc-lib-pdf-graph work with Laravel 9 or Laravel 10?
- The package requires PHP 8.2 or later, which effectively limits direct use to Laravel 11 and 12 host applications. Laravel 9 and 10 projects typically run on PHP 8.0 or 8.1, so they are precluded until the runtime is upgraded. Check legacy queue workers and CI images for the same PHP version floor.
- Do I need a service provider to use tc-lib-pdf-graph in Laravel?
- No service provider is required because the package is framework-agnostic and ships no Laravel integration. The idiomatic approach is a thin wrapper: bind a configured Draw instance through your own provider, resolve it in a dedicated service class, and keep vendor namespace imports confined there. Queued jobs and Artisan commands should consume the wrapper rather than the vendor classes directly.
- Why does the Draw constructor require Color\Pdf and Encrypt objects?
- The Draw constructor expects a Com\Tecnick\Color\Pdf instance and a Com\Tecnick\Pdf\Encrypt\Encrypt instance as collaborators. The encryption object matters because its mode affects PDF/A behavior and output semantics. You must supply correctly configured instances rather than relying on defaults.
- Should I use tc-lib-pdf-graph or tc-lib-pdf to generate PDFs?
- If the requirement is simply to generate PDFs, evaluate tecnickcom/tc-lib-pdf, which owns document structure, pages, object and xref tables, and output. This package only writes graphics operators into an existing content stream. Choose it directly only when you need vector geometry that the higher-level facade does not expose.
- Why are my shapes in the wrong position or invisible with tc-lib-pdf-graph?
- PDF coordinates originate at the bottom-left, while most UI and canvas systems use a top-left origin, so unadjusted coordinates place shapes in unexpected positions. Graphics state must be balanced with matching q and Q operators, otherwise styles and clipping leak between drawing operations. Colors and gradients referenced by name must also be registered in the page resource dictionary or they will not render.
- Can tc-lib-pdf-graph produce PDF/A compliant output?
- Yes, the package includes PDF/A-aware behavior and a pdfa constructor flag, but conformance depends on how you configure the drawing, color, and encryption collaborators. You should validate output against a specific target profile rather than assuming the flag is sufficient. Encryption mode in particular changes output semantics and can conflict with PDF/A requirements.
- What license is tc-lib-pdf-graph released under?
- The README declares GNU LGPL v3, while the Composer metadata reports NOASSERTION, which is a scanner detection gap rather than a confirmed conflict. LGPL in a distributed or white-label PHP product usually needs a legal opinion, especially for on-premise shipping. Confirm the license position before adopting it in a commercial distribution.
- Is tc-lib-pdf-graph actively maintained and safe for production?
- It is maintained by a single author, Nicola Asuni, with a small number of direct dependents, so direct adoption carries bus-factor risk. The offsetting factor is that it sits inside the tc-lib-pdf and TCPDF ecosystem with a claimed 100M+ install base, so the code path is exercised heavily through the parent package. Note that the supplied release metadata lists a future date, so verify recency on Packagist rather than treating it as a maturity signal.