daisy / ebraille

Repository for developing use cases and standard for digital braille
16 stars 4 forks source link

Cannot link to PDFs without fallbacks #172

Open mattgarrish opened 2 months ago

mattgarrish commented 2 months ago

I noticed for PDF graphics that the tagging recommendation is currently to use a hyperlink with a download attribute:

<a href="/images/butterfly.pdf" download>⠠⠛⠗⠁⠏⠓⠊⠉⠀⠷⠀⠁⠀⠃⠥⠞⠞⠻⠋⠇⠽</a>

Unfortunately, since we're following epub's file rules, this isn't valid without a manifest fallback. Using a hyperlink requires the PDF to be listed a non-linear document in the package document spine, which in turn requires the fallback (the download attribute has no meaning in epub).

Making this valid epub is going to require a lot of work for publishers, or else we have to superset epub to allow PDFs without fallbacks, in which case ebraille file sets won't always be conforming epub file sets (and ebraille publications may not always open in epub reading systems). There's also no guarantee the file will be downloadable out of the container - it will depend on system security restrictions.

A simpler solution would be to use the object element to embed the PDF graphics. For example:

<object type="application/pdf" data="images/tactile.pdf" width="100" height="100">
            <p>Alt text description.</p>
</object>

This doesn't run afoul of epub's core media type requirements as the body of the object tag serves as the fallback.

avneeshsingh commented 1 month ago

We should test accessibility for using object for pdf.