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
Alt Text for shapes?
Re: Alt Text for shapes?
Support · Jul 18, 2016Hello,
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.
Re: Alt Text for shapes?
Forum member · Jul 18, 2016Sample code and specifications requested have been emailed.
Thanks,
-Scott
Re: Alt Text for shapes?
Support · Jul 28, 2016Hello 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.