Skip to main content
April 25, 2019
Answered

Alternate text based on a table.

  • April 25, 2019
  • 1 reply
  • 542 views

I couldn't find a way to automate the alternate text of images with javascript based on a list.

I would like to have javascript reference an attachment or text file that has figure # (1 through 20+) and it's description. This would then automatically be applied to the alternate text of an image as it would find them in the accessibility feature.

I can explain more if needed, but establishing code that references a list of text would be a good place to start.

This topic has been closed for replies.
Correct answer Thom Parker

To set the alternate text on an image something is needed that can edit the internals of the PDF. This would be either an Acrobat plug-in or a tool build with a PDF SDK/Library. There are such libraries that you can use with Python.

1 reply

try67
Community Expert
Community Expert
April 25, 2019

This is not possible with a script.

April 26, 2019

I appreciate the confirmation because I've been trying to find various ways to do it with no luck. Do you think it could be possible with python? If the file is in Word I can do it easily with a macro, but I just wondered if there's any tool I could use for pdfs in case I don't have the source file.

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
April 26, 2019

To set the alternate text on an image something is needed that can edit the internals of the PDF. This would be either an Acrobat plug-in or a tool build with a PDF SDK/Library. There are such libraries that you can use with Python.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often