• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

FDK Question - Programmatic Alt Image Text Description Insertion

Community Beginner ,
Nov 22, 2021 Nov 22, 2021

Copy link to clipboard

Copied

We need to be able to include Alt Text for images to enable customers to comply with accessibility requirements. We acquire the text from a database and/or spreadsheet using our software and need to place it in the FrameMaker/PDF file using the FDK. In reviewing the FDK documentation, it is not apparent what the function might be. Could you please let us know how we may use the FDK to insert Alt Text content for images?

Views

292

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2021 Nov 22, 2021

Copy link to clipboard

Copied

Hi Ben, It should be this property on the AFrame object:

FP_ObjectAttributes

 

This is how it is defined in the fapidefs.h FDK header file:

#define FP_ObjectAttributes 23 /* R/W Stringlist */

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 22, 2021 Nov 22, 2021

Copy link to clipboard

Copied

Thank you kind sir. We'll give it a shot...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 01, 2022 Apr 01, 2022

Copy link to clipboard

Copied

Rick,

 

We need to dive a little deeper, if we may. There appears to be multiple strings that may be used for the differing types of images in the stringlist. Are you familar with them and their syntax?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 03, 2023 Apr 03, 2023

Copy link to clipboard

Copied

LATEST

post removed â–º own topic

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 01, 2022 Apr 01, 2022

Copy link to clipboard

Copied

Rick,

I'm with Ben. Let me give you a little more detail. I can create a string list containing a single string and set the FP_ObjectAttributes for the anchored frame. No error is indicated and when I perform a F_ApiGetStrings I get the same string that I input using F_ApiSetStrings. However, when I select the anchored frame in FrameMaker, and click on the Object Attributes button, the text doesn't seem to be there. The dialog has mulitple text boxes with different labels, so I'm wondering if FrameMaker is expecting something a little more involved than just an arbitrary list of strings.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 01, 2022 Apr 01, 2022

Copy link to clipboard

Copied

The majority of my programming is done with ExtendScript. I think I figured this out once by reverse engineering it. I set some values manually on an anchored frame and then queried the properties. Here is some code that I know works on a selected anchored frame. Hopefully, you can adapt this to the FDK syntax.

#target framemaker

var doc = app.ActiveDoc;
var aframe = doc.FirstSelectedGraphicInDoc;

var objectAttributes = aframe.ObjectAttributes;
while (objectAttributes.length) {
    objectAttributes.pop ();
}

objectAttributes[0] = "<Alt>Fantastic and outstanding!</Alt>";
aframe.ObjectAttributes = objectAttributes;

alert (aframe.ObjectAttributes);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 02, 2022 Apr 02, 2022

Copy link to clipboard

Copied

Rick,

Once again, thank you for educating us. We sincerely appreciate it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 02, 2022 Apr 02, 2022

Copy link to clipboard

Copied

To get this on an anchored frame:

 

image.png

 

I used this:

 

#target framemaker

var doc, aframe, objectAttributes;

doc = app.ActiveDoc;
aframe = doc.FirstSelectedGraphicInDoc;

objectAttributes = new Strings ();
objectAttributes.push ("<Alt>Alternate</Alt>");
objectAttributes.push ("<ActualText>Actual</ActualText>");
objectAttributes.push ("<Name>Definition</Name>");
objectAttributes.push ("<Name2>Definition2</Name2>");

aframe.ObjectAttributes = objectAttributes;

 

I think you have to use the XML syntax for it to work. You should be able to adapt this using FDK coding.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines