WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Looking for info. for adding alert message on PDF on the fly

for

From: Olaf Drümmer
Date: Jun 10, 2014 6:58AM


Hi Rabab,

a good friend of mine just reminded me that the way I replied to your question totally ignored what you were actually asking for…

So let me try again with your actual question in mind:

- PDF does support the concept of an action that is carried out when a document is opened.
- such action could be a JavaScript script, which in turn could display an alert message with some text in it

There are some good aspects about this options, and some not so good aspects:

The good aspects:
- the JavaScript message would leave everything else in the PDF alone, including possibly present tags that make the PDF accessible
- if the PDF is a tagged, accessible PDF, there would be no need to integrate the information about / the URL to the HTML version into the tagging structure of the PDF

The not so good aspects:
- not all PDF viewers support open actions or JavaScript (one large user group impacted by this are Mac / iPhone / iPad users using Apple's PDF viewer; not sure about Adobe's mobile PDF reader or other readers on mobile devices when it comes to executing a JaaaScript on opening a PDF)
- some users may have JavaScript disabled (or their administrators may have disable it for them, e.g. in corporate environments)
- the alert would be displayed each time the PDF document is opened
- the URL provided in the alert message might not be clickable
- it seems there is no obvious way in Acrobat Pro to create an open action triggering a JavaScript; probably there are tools that could help (Google might be your friend here)

Additional thoughts:
- it is possible to refine the JavaScript and display a dialog with an additional button (besides the OK button that just closes the message) that launches the URL where the accessible content exists.

I have hand coded a simple example file, which you can download from here:
https://www.dropbox.com/s/d5rf0v3tbvcywxp/PDF%20with%20document%20open%20action%20showing%20alert%20message.pdf

Olaf


On 10 Jun 2014, at 00:46, Rabab Gomaa < <EMAIL REMOVED> > wrote:

> Hello,
>
> I am wondering if anybody has information on adding an alert message on PDF on the fly (e.g. the message shows on the PDF when it is opened without being part of the PDF content).
>
> We have web pages that have PDF versions (e.g.brochures offered in HTML and PDF ). The primary accessible version is the webpage coded in HTML. We need to have a link on the brochure in PDF that goes to the HTML without adding it in the brochure content so that for example, when Google finds the PDF, the user gets this alert in order to go to the accessible version.
>
> Thank you,
> Rabab
> > >