Alt Text for shapes?

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  Alt Text for shapes?

DynamicPDF CoreSuite for .NET (v7) Forum

 Jul 15 2016 7:57 PM
Is there a way to add alternative text for shapes/figures, such as Rectangle? Our agency is going through accessibility checking and alt text for figures is something we'd like to be able to control.

Thanks,

Scott
 Jul 18 2016 10:05 AM
Posted by a ceTe Software moderator
Hello,

There is no property or method in DynamicPDF API using which you can set the alternative text for shapes (Rectangle, Circle and Line).

Can you please send over the following details so we can look into the issue why the accessibility test is failing for the PDF which is added with shapes like (Rectangle)?

1. Code sample.
2. Exact version and build number of the DynamicPDF DLL file. You can get this information in DLL references properties (Version and Description fields) in Visual Studio.
3. Screenshots of accessibility test results.
4. Version of Acrobat Professional used to perform test on the PDF.
5. Output PDF.

Thanks,
ceTe Software Support Team.
 Jul 18 2016 12:22 PM
Sample code and specifications requested have been emailed.

Thanks,

-Scott
 Jul 28 2016 10:12 AM
Posted by a ceTe Software moderator
Hello Scott,

Thanks for sending all the information. You can set the alternative text for the Rectangle (Circle and Line) using the StructureElement class of DynamicPDF API. Below is the code sample.

            Document doc = null;
            doc = new Document();
            Page pg = new Page(PageSize.Letter, PageOrientation.Portrait, 0);

            doc.Creator = "Oregon Department of Education";
            doc.Author = "Oregon Department of Education";
            doc.Title = "My Title";
            doc.CompressionLevel = 9;
            doc.Tag = new TagOptions();
            doc.ViewerPreferences.DisplayDocTitle = true;
            doc.Language = "ES";
            TransparencyGroup tgBase = null;
            tgBase = new TransparencyGroup(1.0F, BlendMode.Normal);
            //Setting alternative text to the Rectangle using StructureElement
            Rectangle rectObj = new Rectangle(50, 50, 576, 28, new ceTe.DynamicPDF.WebColor("#ecf5e1"), new ceTe.DynamicPDF.WebColor("#ecf5e1"), 0, LineStyle.None);
            StructureElement structElement = new StructureElement(TagType.Figure);
            structElement.AlternateText = "MyRectangle";
            rectObj.Tag = structElement;
            tgBase.Add(rectObj);
            pg.Elements.Add(tgBase);
            doc.Pages.Add(pg);
            doc.Draw(@"E:\Temp\V7StructureElement.pdf");

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 5:14 PM.