# Add PixCut Bridge to your existing web PhotoBooth ## 1. Deploy this ZIP as a self-contained folder Upload this complete ZIP to `public_html/pixcut/` and extract it there. URLs: - `https://your-domain.com/pixcut/` → printer dashboard - `https://your-domain.com/pixcut/demo-photobooth.html` → full test demo - `https://your-domain.com/pixcut/INSTALL.html` → setup instructions - `https://your-domain.com/pixcut/DIAGNOSTICS.html` → quick file/browser checks The plugin must use the **same origin** (scheme, hostname, port) as your existing booth's page. If your booth runs on a different subdomain, copy/deploy the plugin on that same subdomain or implement a separate secure server transport. ## 2. Embed one script in your existing PhotoBooth page ```html ``` ## 3. Submit the completed photo ```js // finalCanvas is your web PhotoBooth app's finished canvas. async function sendFinishedPhotoToPixCut(finalCanvas, sessionId) { const receipt = await window.PixCutPlugin.sendPhoto({ image: finalCanvas, name: `Guest session ${sessionId}`, externalId: `guest-${sessionId}` }); console.log('Accepted into local PixCut browser queue:', receipt.jobId); } ``` Input may be an HTMLCanvasElement, a File or Blob, or a PNG/JPEG/WebP data URL. `sendPhoto()` opens the printer panel so booth operators can connect USB printers. Its resolved receipt is **queue acceptance**, not completion of a hardware print. For a clickable printer panel button: ```js document.querySelector('#printerSettingsButton').addEventListener('click', () => PixCutPlugin.open()); ``` For status messages: ```js PixCutPlugin.on('printer-status', e => console.log('Fleet status', e.printers)); PixCutPlugin.on('job-routed', e => console.log('Assigned', e.jobId, e.printerLabel)); PixCutPlugin.on('print-status', e => console.log('Printing', e.jobId, e.phase)); PixCutPlugin.on('print-complete', e => console.log('Completed', e.jobId)); PixCutPlugin.on('print-error', e => console.warn('Inspect hardware before retrying', e)); ``` ## 4. Printing and routing Connect each S1 by USB to **one local desktop**, not to the Hostinger server. Open the web booth in desktop Chrome/Edge over HTTPS, grant each printer WebUSB access, and start with auto-routing **OFF**. Send one photo and use the dashboard's manual print button. Then turn on **Auto route & print incoming photos** after a supervised hardware test. The routing engine skips busy units and uses the first reported-ready unit. A job whose physical submission may have started goes to **REVIEW**, never an automatic retry on another device. This prevents duplicate stickers from uncertain hardware errors. ## 5. Limitations - This release does not provide remote queues across different computers, a distributed print agent, or print jobs stored on Hostinger. - Photos and printer queue are browser-memory only; refreshing or closing the page clears the queue. - A supported desktop browser and secure HTTPS URL are required for USB access; iPad Safari cannot do direct WebUSB. - This integration is unofficial and based on an independent reverse-engineered protocol. Physical print/cut with your printer and firmware remains unverified. ## 6. Easy rollback Keep the previous ZIP in Hostinger's file manager. Between events, when no jobs are printing, rename the `/pixcut` folder to `/pixcut-backup` and upload/extract the earlier ZIP into a new `/pixcut` folder. Never switch scripts or reload the dashboard while active jobs may be in progress. ## Visual Print Floor (v1.4) The new read-only `print-floor.html` shows the printer panel's live queue, print/cut stages and thumbnails through same-origin `BroadcastChannel` messaging. Launch it in a second tab on the same computer/browser profile. Leave `pixcut-panel.html` (or your in-booth panel iframe) open, because it is the USB owner. Use Sample view to preview without hardware. No extra integration JavaScript is required for an existing booth that calls `PixCutPlugin.sendPhoto()` through the supplied plugin.