mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-05-18 04:08:48 -05:00
35e3694cc1
Admin menu: - PDF Templates is now a top-level submenu under Admin (same level as System Settings) so it opens without opening System Settings first. - Remove PDF routes from admin_settings_open so only PDF Templates expands on invoice/quote PDF pages. - Set pdfDropdown parent to adminDropdown in nested dropdown click handler. PDF layout (invoice & quote): - Preserve table groups (Items, Expenses) on save by skipping Groups in cleanup and ensuring table names are set and restored from design_json. - Add test for saving and reloading layout with tables. Docs: - Update PDF layout access path to Admin → PDF Templates → Invoice PDF (and Quote PDF) in PDF_LAYOUT_CUSTOMIZATION.md, PDF_EDITOR_ENHANCED_FEATURES.md, PDF_EDITOR_QUICK_START.md, INVOICE_EXTRA_GOODS_PDF_EXPORT.md.
6.9 KiB
6.9 KiB
PDF Invoice Editor - Quick Start Guide
Getting Started in 5 Minutes
This guide will help you create your first custom invoice layout using the enhanced Konva.js-based PDF editor.
Step 1: Access the Editor
- Log in as an admin user
- Navigate to Admin → PDF Templates → Invoice PDF
- You'll see three main sections:
- Left: Element library
- Center: Canvas workspace
- Right: Properties panel
Step 2: Understanding the Interface
Element Library (Left Sidebar)
Elements are organized into groups:
- Basic Elements: Text, headings, shapes
- Company Info: Logo, name, address, contact details
- Invoice Data: Numbers, dates, client info, totals
- Advanced: QR codes, watermarks, page numbers
Canvas (Center)
- The white canvas represents your invoice page (A4 size)
- Elements can be clicked, dragged, and resized
- Use toolbar buttons for zoom and alignment
Properties Panel (Right)
- Shows properties of selected element
- Edit text, colors, fonts, positions
- Control layer order (z-index)
Step 3: Add Your First Element
- Click "Heading" from Basic Elements
- The element appears on the canvas
- Click it to select (you'll see resize handles)
- In the properties panel (right):
- Change text to "INVOICE"
- Set font size to 32
- Choose a color
Step 4: Build Your Layout
Add Company Header
- Click "Company Logo" (if you've uploaded one)
- Position it in the top-left (drag or use X/Y properties)
- Click "Company Name" and position below logo
- Add "Company Details" for contact info
Add Invoice Details
- Click "Invoice Number" - place top-right
- Click "Invoice Date" - place below number
- Click "Due Date" - place below date
Add Client Information
- Click "Client Info" - place left side, below company info
- Adjust position to your liking
Add Items Table
- Click "Items Table"
- Position in the middle of the page
- Resize if needed using handles
Add Totals
- Click "Subtotal" - place below items table
- Click "Tax" - place below subtotal
- Click "Total Amount" - place below tax
Step 5: Customize with Shapes
Add a Header Background
- Click "Rectangle" from Basic Elements
- Position at the very top
- In properties:
- Set Fill Color to a light color (e.g., #f3f4f6)
- Set Stroke Width to 0
- Adjust width to full page (595px)
- Set height to 100px
- Click the down arrow in Layer Order to send behind text
Add Divider Lines
- Click "Line" from Basic Elements
- Position where you want a separator
- Adjust stroke width and color in properties
- Resize by dragging endpoints
Step 6: Use Keyboard Shortcuts
Speed up your workflow:
- Arrow Keys: Move selected element (1px)
- Shift+Arrows: Move selected element (10px)
- Ctrl+D: Duplicate selected element
- Delete: Remove selected element
Step 7: Align Elements
- Select an element
- Use toolbar alignment buttons:
- Left/Center/Right for horizontal
- Top/Middle/Bottom for vertical
Step 8: Preview Your Design
- Click "Generate Preview" button (top)
- Preview appears in the right panel (below properties)
- Review how it looks with actual data
- Make adjustments as needed
Step 9: Save Your Design
- Click "Save Design" button (top)
- Your layout is saved and will be used for all invoices
- You can come back anytime to edit
Step 10: Test with Real Invoice
- Go to Invoices → Create a new invoice
- Fill in details and add items
- Click "Preview" or "Generate PDF"
- See your custom layout in action!
Common Tasks
Changing Text Content
- Select text element
- In properties panel, find "Text Content"
- Edit the text directly
- Note: Keep Jinja2 variables (e.g.,
{{ invoice.invoice_number }})
Changing Colors
- Select element
- Find color picker in properties
- Click to open color selector
- Choose your color
Resizing Elements
Method 1: Visual
- Click element to select
- Drag corner handles
Method 2: Precise
- Select element
- Use Width/Height fields in properties
Moving Elements Precisely
- Select element
- In properties panel:
- Set exact X position (horizontal)
- Set exact Y position (vertical)
Creating a Watermark
- Click "Watermark" from Advanced
- Position in center of page
- In properties:
- Set large font size (60-80)
- Set opacity to 0.1-0.2
- Choose light gray color
- Send to back using Layer Order buttons
Duplicating Sections
- Select element (e.g., a line)
- Press Ctrl+D to duplicate
- Move to new position
- Repeat as needed
Tips & Tricks
Tip 1: Use Alignment Tools
- Select multiple elements
- Use alignment buttons to line them up perfectly
Tip 2: Work in Layers
- Background elements (shapes, watermarks) go to back
- Text and important info stay on top
- Use Layer Order buttons frequently
Tip 3: Keep It Simple
- Don't overcrowd the layout
- Use whitespace effectively
- Test with real data before finalizing
Tip 4: Font Consistency
- Stick to 2-3 fonts maximum
- Use font sizes consistently:
- Heading: 24-32px
- Subheading: 16-20px
- Body: 12-14px
- Fine print: 10-11px
Tip 5: Color Harmony
- Use your brand colors
- Keep contrast high for readability
- Avoid too many colors (3-4 max)
Troubleshooting
Element Won't Move
- Make sure it's selected (should see handles)
- Try clicking it again
- Use X/Y properties for precise positioning
Can't See Element
- Check if it's hidden behind another element
- Use Layer Order to bring to front
- Check if opacity is too low
Text is Cut Off
- Increase width in properties
- Reduce font size
- Enable text wrapping
Preview Shows Wrong Data
- Preview uses last invoice in database
- Create a test invoice with realistic data
- Generate preview again
Keyboard Shortcuts Reference
| Shortcut | Action |
|---|---|
| Delete/Backspace | Remove selected element |
| Ctrl+C | Copy element |
| Ctrl+V | Paste element |
| Ctrl+D | Duplicate element |
| Arrow Keys | Move 1px |
| Shift+Arrows | Move 10px |
| Click Background | Deselect |
Next Steps
Once comfortable with the basics:
- Explore all element types
- Create multiple layout variations
- Use shapes for creative designs
- Add QR codes for payment links
- Experiment with opacity and layers
Getting Help
- See Full Feature Documentation
- Check PDF Layout Customization
- Review Invoice System Guide
Example Layout Ideas
Minimal Layout
- Simple text elements only
- Clean lines
- Lots of whitespace
Professional Layout
- Company logo in header
- Colored header background
- Clear sections with dividers
Creative Layout
- Circular logo frame
- Angled divider lines
- Watermark in background
Modern Layout
- Bold typography
- Minimal colors
- QR code for payments
Happy designing! 🎨