Skip to content

eSCL parsing fails on ADF‑only scanners: missing <scan:Platen> causes exception #112

@rw-django-fan-2020

Description

@rw-django-fan-2020

Describe the bug
When connecting to an ADF-only eSCL/AirScan scanner, ScanBridge fails to fetch scanner capabilities and throws an exception:

IllegalArgumentException: Required element not found: scan:Platen

This happens because the parser expects a <scan:Platen> element, which is absent on ADF-only devices. According to the eSCL specification, a scanner may expose only <scan:Adf> if it has no flatbed/platen.


To Reproduce
Steps to reproduce the behavior:

  1. Open ScanBridge
  2. Connect to an ADF-only eSCL/AirScan scanner (e.g., Brother DS‑940DW)
  3. Attempt to fetch scanner capabilities
  4. Observe the exception during parsing

Expected behavior
ScanBridge should:

  • Accept scanners that expose only <scan:Adf>
  • Handle the absence of <scan:Platen> gracefully
  • Allow scanning via the ADF

Screenshots
Not applicable (the failure occurs during capability fetch, no UI screenshot available)


Smartphone (please complete the following information):

  • Device: [Redacted / Your device, e.g., Pixel 7]
  • Android version: [e.g., 14]
  • ScanBridge version: [e.g., 22]

Additional context
Redacted eSCL ScannerCapabilities XML (identifiers anonymized):

<?xml version="1.0" encoding="UTF-8"?>
<scan:ScannerCapabilities
  xmlns:scan="http://schemas.hp.com/imaging/escl/2011/05/03"
  xmlns:pwg="http://www.pwg.org/schemas/2010/12/sm"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <pwg:Version>2.63</pwg:Version>
  <pwg:MakeAndModel>DS-940DW</pwg:MakeAndModel>
  <pwg:SerialNumber>REDACTED</pwg:SerialNumber>
  <scan:UUID>REDACTED</scan:UUID>
  <scan:AdminURI>http://scanner.local/</scan:AdminURI>

  <scan:Adf>
    <scan:AdfSimplexInputCaps>
      <!-- capabilities omitted for brevity -->
    </scan:AdfSimplexInputCaps>

    <scan:AdfDuplexInputCaps>
      <!-- capabilities omitted for brevity -->
    </scan:AdfDuplexInputCaps>
  </scan:Adf>

  <!-- Note: No <scan:Platen> element is present, as this is an ADF-only device -->

</scan:ScannerCapabilities>

Suggested fix:

  • Treat <scan:Platen> as optional
  • Accept scanners that expose only <scan:Adf>
  • Avoid failing capability parsing when platen support is absent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions