We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Tagging html images with alternativetext

Thread ID:

Created:

Updated:

Platform:

Replies:

147495 Sep 12,2019 02:52 PM UTC Sep 16,2019 11:38 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: PDF
Atari Elen
Asked On September 12, 2019 02:52 PM UTC

Is there a way to add Alternative Text to an image after converting to an auto tagged pdf from an html string? The html for my image has alt text but that doesn't seem to carry over so I was wondering if there's a way to do it after the ConvertToTaggedPDF step, by searching the img id/class/src or something like that. Or if there's some alteration I need to make to the html string to make the autotagger read the alt text as alternative text.

            string bufferString = docHelper.Get_HTML_For_TaggedDocument(print);
            PdfDocument doc = new PdfDocument();

            string baseUrl = "";
            doc.DocumentInformation.Title = document.Name;
            doc.AutoTag = true;
            //using (HtmlConverter html = new HtmlConverter())

            //{
            Thread t = new Thread(() =>
            {
                HtmlConverter html = new HtmlConverter();
                    //Enable JavaScript

                html.EnableJavaScript = true;
                html.ConvertToTaggedPDF(doc, bufferString, baseUrl);
               //Tag images with alt text???
                doc.Save("c:\\temp\\htmlfiles\\" + fileName);
                doc.Close(true);
            });

            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            t.Join();

The AlternativeText reference was here: https://help.syncfusion.com/file-formats/pdf/working-with-tagged-pdf#adding-tag-to-image but I didn't find anything on adding it in other ways.

Gowthamraj Kumar [Syncfusion]
Replied On September 16, 2019 11:38 AM UTC

Hi Atari, 

Thank you for using Syncfusion products. 

IE rendering engine make use of MSHTML (IE rendering engine) to convert HTML to vector images. From the images, we will render the PDF document. The alternate text information is not added in meta file, so we could not extract the alternative text details of the image inside the meta file. IE rendering engine does not supports adding alternate text for images inside the HTML string. Also, currently we do not have support for adding alternate in the converted/existing PDF documents. 

Please let us know if you need any further assistance on this.  

Regards, 
Gowthamraj K 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon