Simple Chrome-based desktop wrapper for HMIS web application with optimized print settings for zero-margin, header-free printing.
✅ Independent Sessions - Each launch creates a new session with separate logins
✅ Template-Based Print Settings - Configure once, use forever (no margins, no headers/footers)
✅ Configurable Print Modes - Preview, Direct, or Silent printing
✅ Cache Control - Enable/disable for fresh data
✅ No Framework Overhead - Pure Chrome, no Electron/Tauri
✅ Multi-Instance Support - Run unlimited simultaneous sessions
✅ Clean Interface - App mode (no address bar)
✅ Lightweight - Just batch files and a print extension
- config.bat - Configuration file (URL, session mode, print settings)
- Launch-HMIS.bat - Normal window mode launcher
- Launch-HMIS-Fullscreen.bat - Fullscreen/kiosk mode launcher
- Setup-Print-Settings.bat - One-time print configuration wizard
- Test-Print-Settings.bat - Verify current print settings
- Cleanup-Sessions.bat - Remove old session data
- print-extension/ - Chrome extension for print CSS optimization
- Copy the entire HMIS folder to the new computer
- Ensure all files are present (config.bat, Launch-HMIS.bat, print-extension folder, etc.)
Edit config.bat and set your HMIS server URL:
set HMIS_URL=https://stg.carecode.org/coopprod/This is crucial for zero-margin, header-free printing:
- Close all Chrome windows
- Run Cleanup-Sessions.bat (clears any old data)
- Run Launch-HMIS.bat
- First launch will show: "First launch - creating template profile..."
- Press Ctrl+P to open print dialog
- Configure print settings:
- Click "More settings" to expand all options
- Margins: Select "None" from dropdown
- Headers and footers: UNCHECK this checkbox
- Background graphics: Check if needed
- Click "Cancel" to close print dialog (settings are saved)
- Close Chrome completely
- Run Launch-HMIS.bat again to verify settings are preserved
Note: These settings are saved in the template and will be copied to every new session automatically.
- Launch the app
- Press Ctrl+P
- Verify: Margins = "None", Headers/footers = unchecked
- Each new session will inherit these settings
Edit config.bat to customize:
set HMIS_URL=https://your-server.com/path # Your HMIS server URL
set SESSION_MODE=TEMPLATE # UNIQUE, PERSISTENT, or TEMPLATE
set PRINT_MODE=PREVIEW # PREVIEW, DIRECT, or SILENT
set PRINT_MARGINS=0 # 0=none, 1=default, 2=minimum
set PRINT_HEADERS=DISABLED # ENABLED or DISABLED
set CACHE_MODE=DISABLED # DISABLED or ENABLED
set WINDOW_SIZE=1400,1000 # Width,Height in pixels
set ZOOM_LEVEL=0.8 # 0.8=80%, 1.0=100%, empty=defaultTEMPLATE (Recommended for multi-user with print settings)
- Each launch creates a NEW session (separate logins)
- Printer settings are PRESERVED from template
- Best for: Multiple users, kiosks, shared computers
- Print settings configured once in template, used by all sessions
PERSISTENT (Single-user mode)
- Same session every launch
- All windows share the same login
- Settings preserved between launches
- Best for: Single-user dedicated workstation
UNIQUE (Clean slate every time)
- New session each launch
- NO settings preserved (including print settings)
- Best for: Testing, development
- Not recommended if you need consistent print settings
PREVIEW (Recommended)
- Shows print dialog before printing
- User can verify settings and choose printer
- Best for most scenarios
DIRECT
- Skips preview dialog
- Uses last printer and settings
- Best for: Receipt printers, label printers
SILENT
- Automatic printing to default printer
- No user interaction required
- Best for: Kiosk mode with dedicated printer
- Requires TEMPLATE or PERSISTENT mode for settings to work
- Double-click Launch-HMIS.bat
- Each click creates a new window with:
- Fresh login session (enter credentials)
- Saved printer settings (margins, headers/footers)
- Multiple users can run simultaneously with separate logins
Normal Printing:
- Trigger print from HMIS application (or Ctrl+P)
- Print dialog appears (if PRINT_MODE=PREVIEW)
- Verify settings: Margins=None, Headers/footers=unchecked
- Click "Print"
Auto-Printing (Kiosk Mode):
- Set
PRINT_MODE=SILENTin config.bat - Prints automatically to default printer
- No user interaction required
- Use Launch-HMIS-Fullscreen.bat for fullscreen kiosk mode
- Press
Alt+F4to close (F11 doesn't work in --kiosk mode)
Weekly Cleanup (Recommended):
- Run Cleanup-Sessions.bat to remove old session data
- Clears cached files from:
%TEMP%\HMIS-Chrome\ - Frees up disk space
- Does NOT delete your template or print settings
-
First Launch (Template Creation):
- Creates template profile at:
%TEMP%\HMIS-Chrome\TemplateProfile\ - You configure print settings in this template
- Template is saved permanently
- Creates template profile at:
-
Subsequent Launches:
- Copies template to new session:
%TEMP%\HMIS-Chrome\Session_[TIMESTAMP]\ - Each window gets:
- Fresh login (separate cookies)
- Same printer settings (from template)
- Complete session isolation between windows
- Copies template to new session:
-
Print Extension:
- Chrome extension loaded via
--load-extensionflag - Injects CSS to hide webpage headers/footers
- Sets
@page { margin: 0 }for zero-margin printing - Located in:
print-extension/folder
- Chrome extension loaded via
- Right-click
Launch-HMIS.bat→ Send to → Desktop (create shortcut) - Rename to "HMIS Desktop"
- Place these files on a network share
- Create shortcuts on user desktops pointing to the .bat file
- Create a shortcut to
Launch-HMIS.bat - Right-click shortcut → Properties
- Click "Change Icon"
- Browse to your icon file
The print-extension/ folder contains a Chrome extension that optimizes printing:
Files:
manifest.json- Extension metadata and permissionsprint.css- CSS rules for print media (hides headers/footers)content.js- JavaScript to inject print styles
What it does:
- Sets
@page { margin: 0 }to remove page margins - Hides common header/footer HTML elements
- Prevents unwanted page breaks
- Ensures background graphics print correctly
Customization:
Edit print.css to add custom print rules:
@media print {
.your-custom-class {
display: none !important;
}
}Different HMIS URL:
If your HMIS is on a different domain, update manifest.json:
"host_permissions": [
"https://your-domain.com/*"
]F11- Toggle fullscreenCtrl+W- Close current windowCtrl+Shift+I- Open DevTools
Problem: Margins revert to "Default" and Headers/footers get re-enabled after closing Chrome.
Solution:
- Check
config.bat- ensureSESSION_MODE=TEMPLATE(not UNIQUE) - Close ALL Chrome windows completely
- Run Cleanup-Sessions.bat
- Follow the print setup steps again (see "Step 3: Configure Print Settings" above)
- Verify template exists:
%TEMP%\HMIS-Chrome\TemplateProfile\
Why this happens:
- UNIQUE mode doesn't save any settings
- Template must be configured on first launch
- Running Cleanup-Sessions.bat deletes the template (requires reconfiguration)
Problem: Prints still have margins and show URL/date at top/bottom.
Diagnosis:
- Press Ctrl+P and check:
- Margins dropdown - should show "None"
- Headers/footers checkbox - should be UNCHECKED
- If settings show correctly but print still has margins:
- These are Chrome's print headers (not webpage headers)
- Browser settings override CSS
Solution:
- Run Setup-Print-Settings.bat for guided configuration
- Manually set in print dialog:
- More settings → Margins → None
- More settings → Headers and footers → UNCHECK
- Close Chrome to save template
- Test with next launch
Problem: Two pages print when content fits on one page.
Causes:
- Margins pushing content to second page
- Page breaks in HTML/CSS
- Hidden content extending beyond page
Solution:
- Set margins to "None" (see above)
- The print-extension should prevent page breaks
- Check if webpage has explicit page-break CSS
- Verify print-extension is loaded (check Chrome extensions)
Problem: Batch file says Chrome is not found.
Solution:
Edit Launch-HMIS.bat and update Chrome path:
set CHROME_CMD="C:\Program Files\Google\Chrome\Application\chrome.exe"Common alternative paths:
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe
Problem: All windows share the same login.
Diagnosis:
- Check if SESSION_MODE=PERSISTENT (this is normal behavior)
- Look at batch window - each launch should show different SESSION_ID
Solution:
- Use SESSION_MODE=TEMPLATE for isolated sessions
- Each launch creates new Session_[TIMESTAMP] folder
Problem: Extension warnings or print CSS not working.
Solution:
- Verify
print-extension/folder exists in HMIS directory - Check folder contains:
- manifest.json
- print.css
- content.js
- Chrome may show extension warnings - this is normal for development extensions
- Extension must match your HMIS URL in manifest.json
Problem: App becomes slow over time.
Solution:
- Run Cleanup-Sessions.bat weekly
- This removes old session data from
%TEMP%\HMIS-Chrome\ - Keep 5-10 sessions max, delete older ones
- Template profile is preserved automatically
Problem: Print settings lost after Windows updates or restarts.
Cause: Template profile stored in %TEMP% folder may be cleared.
Solution:
- Change template location in both launcher scripts
- Edit
Launch-HMIS.batline 37:set SESSION_DIR=%APPDATA%\HMIS-Chrome
- This moves template to permanent location
- Reconfigure print settings (one time)
✅ Native performance - Uses system Chrome
✅ Auto-updates - Chrome updates automatically
✅ Smaller size - Just KB instead of hundreds of MB
✅ No build process - Deploy immediately
✅ Better compatibility - Full Chrome feature set
Default URL: https://your-hmis-server.com/application
To change, edit the HMIS_URL parameter in config.bat.
- Copy entire HMIS folder to new computer
- Edit
config.bat- setHMIS_URL - Close all Chrome windows
- Run
Cleanup-Sessions.bat - Run
Launch-HMIS.bat(creates template) - Press Ctrl+P → Set Margins=None, uncheck Headers/footers
- Close Chrome
- Test: Run
Launch-HMIS.batagain, verify Ctrl+P shows correct settings
Launch-HMIS.bat # Normal window mode
Launch-HMIS-Fullscreen.bat # Fullscreen kiosk mode
Setup-Print-Settings.bat # Configure print settings wizard
Test-Print-Settings.bat # Check current settings
Cleanup-Sessions.bat # Remove old session dataSESSION_MODE=TEMPLATE # Multi-user with saved print settings
PRINT_MODE=PREVIEW # Show print dialog
PRINT_MARGINS=0 # No margins
PRINT_HEADERS=DISABLED # No headers/footers
CACHE_MODE=DISABLED # Always fresh data- Template Profile:
%TEMP%\HMIS-Chrome\TemplateProfile\ - Session Data:
%TEMP%\HMIS-Chrome\Session_*\ - Config File:
config.bat - Print Extension:
print-extension\
- Template Mode: First launch creates template → subsequent launches copy it to new sessions
- Print Settings: Configured once in template → inherited by all new sessions
- Session Isolation: Each launch = separate login, but same printer settings
- Extension: Injects CSS for zero-margin printing
For issues or questions:
- Check the Troubleshooting section above
- Review Chrome command-line switches: https://peter.sh/experiments/chromium-command-line-switches/
- Verify print-extension files are present and valid