Custom Return Form Generator ============================= This tool generates PDF return forms by overlaying data from the supplier_returns_details table onto the teledyne_form.png background image. Files: ------ - customform.php: Main PDF generation script - test_tcpdf.php: TCPDF installation and image dimension tester - test_query.php: Tests the database connection and shows table structure - teledyne_form.png: Background form image - README.txt: This file How it Works: ------------- 1. The script receives cid (company id) and returnid (returns id) parameters from the URL 2. It fetches all details from supplier_returns_details where headerid = returnid 3. For each row, it creates a new PDF page with the teledyne_form.png as background 4. It overlays the data fields onto the image according to the coordinates in $fieldConfig 5. The resulting PDF is downloaded to the browser Configuration: -------------- The $fieldConfig array in customform.php defines the fields to overlay: $fieldConfig = array( 'stock_ref' => array(100, 100, 12, '', 80), // Stock reference 'serialnumber' => array(100, 120, 12, '', 80), // Serial number 'fault' => array(100, 140, 12, '', 80) // Fault description ); Each field is configured with: - x: X-coordinate in millimeters (0 = left, 216 = right edge of letter page) - y: Y-coordinate in millimeters (0 = top, 279 = bottom edge of letter page) - font_size: Font size in points - font_weight: Font weight ('' = normal, 'B' = bold, 'I' = italic, 'BI' = bold italic) - max_width: Maximum width in millimeters (for text wrapping, 0 = no limit) Testing: -------- 1. To test the TCPDF installation: visit test_tcpdf.php 2. To test the database connection and view data: visit test_query.php 3. To test the actual form generation: click "Print Return Form" from shipmentlist.php Note: The initial coordinates are approximate. You will need to adjust them based on the actual layout of teledyne_form.png. TCPDF Documentation: --------------------- For more information on TCPDF, visit: http://www.tcpdf.org