Customizing PDF Layouts and Branding
Fixly generates several professional PDF documents for your customers and internal shop use, including Invoices, Intake Labels, and Repair Summaries. This guide explains how these documents are structured and how you can customize their appearance.
1. Types of PDF Documents
The system includes three main PDF templates located in the resources/views/pdfs directory:
- Invoice PDF: The official billing document sent to customers after a repair is completed.
- File: resources/views/pdfs/invoice.blade.php
- Intake Label: A small, barcode-ready label designed to be printed and attached to the customer's device for identification on your shop floor.
- File: resources/views/pdfs/intake-label.blade.php
- Repair Summary: A document provided at the time of intake that lists the estimated costs, device details, and your shop's terms and conditions.
- File: resources/views/pdfs/repair-summary.blade.php
2. Customizing Your Logo and Header
You do not need to edit code to change your basic branding. The PDFs automatically pull information from your System Configuration.
- Logo: Upload your business logo in /public/images/logo.png. This logo will appear at the top of all Invoices and Summaries.
- Shop Details: Your business name, physical address, and phone number are pulled from the General tab. Use \r\n in the address field to create new lines on the PDF.
3. Modifying PDF Layouts (Advanced)
If you want to change the actual structure of the documents (such as moving the address block or adding custom legal text), you must edit the Blade files.
- Styling: These templates use standard CSS. Because they are processed by a PDF engine, it is best to use simple table-based layouts or inline CSS styles (e.g., <div style="color: #333; font-size: 12px;">).
- Barcodes: The Intake Label uses a barcode generator. Do not modify the {{ $barcode }} variable if you wish to continue using barcode scanners for repair tracking.
- Dynamic Fields: You can add any field from the booking or user models to the PDF using standard Blade syntax:
- {{ $booking->device_model }} for the device name.
- {{ $invoice->total_amount }} for the final billing total.
4. Tax Information on Invoices
The Invoice PDF is designed to be tax-compliant. It will automatically display:
- Your VAT or Sales Tax Registration Number (if configured).
- A breakdown of the tax charged per line item (Parts vs. Labor).
- The currency symbol you selected in your global settings.
5. Printing Labels
Intake labels are optimized for small thermal label printers (like Dymo or Brother).
- Dimensions: The default template is set to a standard 60cm x 30cm label size. If your printer uses different dimensions, you may need to adjust the @page size and margins in the <style> section of intake-label.blade.php.
- Action: You can trigger a label print directly from the Bookings table in the admin panel by clicking the "Print Label" action.
6. Troubleshooting PDF Generation
- Missing Images: If your logo does not appear on the PDF, ensure your APP_URL in the .env file is set correctly (including https://) and that you have run php artisan storage:link.
- Formatting Errors: If the PDF looks "broken" after an edit, check for unclosed HTML tags in your Blade file.
- Clear Cache: After making changes to a PDF template, run php artisan view:clear to ensure the system generates the new version.