How to prevent the HTML renderer from converting email text to Images?

Posted by: andrew.williams on 18 August 2025, 6:48 pm EST

  • Posted 18 August 2025, 6:48 pm EST

    I am attempting to use a PageReport to render HTML that will eventually be used in emails like a password reset or auth code. However, no matter what I change in the export settings, all of the text content is converted to SVGs and images. This makes copying text from the email impossible. How can I modify this code so that raw html is returned? I am using Active Reports 17.3.0 and C#.

    [code]var htmlRenderingExtension = new GrapeCity.ActiveReports.Export.Html.Page.HtmlRenderingExtension();

    var htmlOutputProvider = new GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider();

    var htmlPageSettings = new GrapeCity.ActiveReports.Export.Html.Page.Settings

    {

    EmbedImages = true,

    Fragment = true,

    StyleStream = false,

    MhtOutput = false,

    Mode = GrapeCity.ActiveReports.Core.Export.Html.Page.RenderMode.Galley,

    RenderingEngine = GrapeCity.ActiveReports.Core.Export.Html.Page.RenderingEngine.Html

    };

    pageDocument.Render(htmlRenderingExtension, htmlOutputProvider, htmlPageSettings);

    var text = string.Empty;

    using (var documentStream = (MemoryStream)htmlOutputProvider.GetPrimaryStream().OpenStream())

    {

    using (var reader = new StreamReader(documentStream, Encoding.UTF8, true, 1024, leaveOpen: false))

    {

    text = reader.ReadToEnd();

    returnArray = Encoding.Default.GetBytes(text);

    }

    }[/code]

  • Posted 19 August 2025, 1:26 am EST

    Hi Andrew,

    Please try to change the rendering engine from HTML to Mixed.

    I hope this fixes this issue:

    RenderingEngine = GrapeCity.ActiveReports.Core.Export.Html.Page.RenderingEngine.Mixed
    

    If the issue persists, please share a sample report file reproducing this issue. So we can look into this issue and get back to you accordingly.

  • Posted 19 August 2025, 12:59 pm EST

    Unfortunately that only made it worse, none of the content appears in the emails after setting the rendering engine to mixed. I’ve attached a simplified report that exhibits the issue. Please let me know if you need any more details.

    Test Email.zip

  • Posted 20 August 2025, 1:31 am EST

    Hi Andrew,

    I tested again at my end with your report and was able to reproduce this behavior.

    It seems that when using a Table Control, the Formatted Text Control is rendered as an SVG file.

    As a workaround, I would suggest not using a Table for formatting the context if possible. Also, when exporting to HTML, make sure the following export properties are set:

    RenderingEngine = Mixed

    EmbededImages = True

    I have attached a sample report with your HTML and another sample HTML, which does not use the Table control.

    Regards,

    Akshay

    Test.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels