mbattyani / cl-pdf

CL-PDF is a cross-platform Common Lisp library for generating PDF files.
Other
115 stars 41 forks source link

CL-PDF and accessibility via screen readers #29

Open phmarek opened 3 years ago

phmarek commented 3 years ago

To be readable by screen readers, PDFs need to include a few tags.

CL-PDF should support these tags; if they could be inserted automatically by a flag in WITH-DOCUMENT or so it would be great.

Thanks!

mbattyani commented 3 years ago

Looks like a useful one. Which tags?

phmarek commented 3 years ago

The PDF Reference has "9.8 Accessibility Support", which lists

  • Specifying the natural language used for text in a PDF document [...]
  • Providing textual descriptions for images or other items [...]
  • Specifying the expansion of abbreviations or acronyms

Then there's "9.8.2 Alternate Descriptions"; here's an excerpt:

For annotation types that normally display text, that text (specified in the Contents entry of the annotation dictionary) is the natural source for vocaliza- tion purposes. For annotation types that do not display text, a Contents entry (PDF 1.4) may optionally be included to specify an alternate description.

And there's an Alt tag as well - and some more details.

Basically, I guess that the language needs to be specified (default per file, and then if different per sentence or paragraph - we might be able to use hyphenation-language for that?); and images (and QR codes and links) may need an &key (or &optional) alt argument.