Skip to content

Conversation

Copy link

Copilot AI commented Aug 29, 2025

This PR adds printing functionality to ScanBridge using Android's Print Framework, enabling users to print scanned documents directly to AirPrint and IPP Everywhere compatible printers.

Changes

UI Enhancement

  • Added a print button (🖨️) to the export options popup alongside the existing PDF and Archive export buttons
  • The print option appears when users tap the share/export button in the scanning screen

Core Implementation

  • doPrint() function: Integrates with Android's PrintManager to handle print jobs
  • ScanDocumentPrintAdapter class: Custom PrintDocumentAdapter that converts scanned images to PDF format for printing
  • Error handling: Same validation as existing export functions (checks for empty scans, running jobs, etc.)

Internationalization

  • Added "Print" string resources in both English and German translations

Technical Details

The implementation leverages Android's Print Framework which automatically discovers and supports:

  • AirPrint printers (Apple ecosystem)
  • IPP Everywhere printers
  • Any printer with Android print service support

User Experience

When printing, users get the full Android system print dialog with options to:

  • Select from available printers
  • Choose page ranges
  • Adjust print settings (paper size, orientation, etc.)
  • Preview before printing

Key Features

  • Multi-page support: Prints all scanned pages as a single job
  • Page range selection: Users can print specific pages through the system dialog
  • Automatic scaling: Images are scaled to fit A4 pages with proper margins
  • Cancellation support: Users can cancel print jobs in progress

Compatibility

  • Maintains backward compatibility with existing export functionality
  • Works with Android 28+ (existing app requirement)
  • No additional permissions required
  • Uses existing iText PDF library for document generation

The implementation follows existing app patterns and provides a seamless printing experience for scanned documents without modifying any core scanning functionality.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits August 29, 2025 11:53
Co-authored-by: Chrisimx <54219305+Chrisimx@users.noreply.github.com>
Co-authored-by: Chrisimx <54219305+Chrisimx@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement a printing feature using AirPrint/IPP Everywhere Implement AirPrint/IPP Everywhere printing feature Aug 29, 2025
Copilot AI requested a review from Chrisimx August 29, 2025 11:56
Copilot finished work on behalf of Chrisimx August 29, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants