How vermilion10/printylan works
Printylan is an Android USB-printing app and print service. Its principal workflow discovers an attached printer, obtains USB access, reads the printer’s Device ID to select a language driver, then accepts a system print job, renders pages, encodes them for that printer, and sends the result over USB. The app also lets users select a PDF or image and override the detected driver per model. Major capabilities are documented in the README; wiring for unsampled UI and job-processing code is represented conservatively.
Main entry points: PrintJobProcessor.kt Job processor · UsbDiscoverySession.kt Printer discovery · DriverSelector.kt Driver selection · PrinterProbe.kt Printer probe
Components 24
App interface
- Main activity
app/src/main/kotlin/com/printylan/ui/MainActivity.kt - Printers screen
app/src/main/kotlin/com/printylan/ui/PrintersScreen.kt - Printer view model
app/src/main/kotlin/com/printylan/ui/MainViewModel.kt - File printing
app/src/main/kotlin/com/printylan/ui/FilePrinter.kt - Driver overrides
app/src/main/kotlin/com/printylan/data/DriverPreferences.kt
Printer discovery
- Print service
app/src/main/kotlin/com/printylan/service/PrintylanPrintService.kt - Printer discovery
app/src/main/kotlin/com/printylan/service/UsbDiscoverySession.kt - USB scanner
app/src/main/kotlin/com/printylan/usb/UsbPrinterScanner.kt - USB permissions
app/src/main/kotlin/com/printylan/usb/UsbPermissions.kt - Printer probe
app/src/main/kotlin/com/printylan/usb/PrinterProbe.kt - USB connection
app/src/main/kotlin/com/printylan/usb/UsbPrinterConnection.kt - Print mapping
app/src/main/kotlin/com/printylan/service/AndroidPrintMapping.kt
Print jobs
- Job processor
app/src/main/kotlin/com/printylan/service/PrintJobProcessor.kt - Banded PDF rendering
app/src/main/kotlin/com/printylan/render/BandedPdfPage.kt
Drivers and formats
- Driver selection
core/driver/src/main/kotlin/com/printylan/driver/DriverSelector.kt - Driver interface
core/driver/src/main/kotlin/com/printylan/driver/PrinterDriver.kt - PWG Raster
core/driver/src/main/kotlin/com/printylan/driver/PwgRasterDriver.kt - PCL raster
core/driver/src/main/kotlin/com/printylan/driver/PclRasterDriver.kt - PDF passthrough
core/driver/src/main/kotlin/com/printylan/driver/PdfPassthroughDriver.kt - Canon IVEC
core/driver/src/main/kotlin/com/printylan/driver/CanonIvecDriver.kt - Print domain types
core/model/src/main/kotlin/com/printylan/model/PrinterCapabilities.kt
Other components
- User
- Android print framework
- USB printer
Connections 34
- User → Main activity: opens and selects
- Main activity → Printers screen: displays
- Printers screen → Printer view model: requests printer actions
- Main activity → File printing: starts file print
- Printer view model → Driver overrides: saves override
- Printer view model → USB scanner: refreshes printers
- Android print framework → Print service: binds and queues jobs
- Print service → Printer discovery: creates session
- Printer discovery → USB scanner: refreshes and observes
- Printer discovery → USB permissions: requests access
- Printer discovery → Printer probe: inspects printer
- Printer discovery → Print mapping: maps capabilities
- USB scanner → USB printer: detects attached device
- USB permissions → USB printer: requests device access
- Printer probe → USB connection: opens for probing
- USB connection → USB printer: reads ID and status
- Printer probe → Driver selection: selects language
- Printer probe → Driver overrides: checks override
- Print mapping → Print domain types: maps capabilities
- Print service → Job processor: queues or cancels
- Job processor → USB permissions: obtains printer access
- Job processor → Printer probe: gets printer driver
- Job processor → Banded PDF rendering: renders PDF bands
- Job processor → Driver interface: encodes rendered pages
- Driver selection → PWG Raster: selects by ID
- Driver selection → PCL raster: selects by ID
- Driver selection → PDF passthrough: selects by ID
- Driver selection → Canon IVEC: selects by ID
- PWG Raster → Driver interface: implements
- PCL raster → Driver interface: implements
- PDF passthrough → Driver interface: implements
- Canon IVEC → Driver interface: implements
- Job processor → USB connection: writes print stream
- USB connection → USB printer: sends print data