Image overlaps text (html) in exported PDF

Posted by: alexander.kainz on 3 September 2025, 2:45 am EST

  • Posted 3 September 2025, 2:45 am EST

    Image overlaps text in exported PDF when placed after br inside p (RFT/ SectionReport)

    Hello,

    I am using ActiveReports 19 (SectionReport) with an RTF/HtmlTextBox control to render HTML content.

    When exporting to PDF, I noticed that images overlap the preceding text if they are placed after a line break (br) inside the same paragraph (p).

    Here is a simplified example of the HTML:

    <html>
      <body>
        <p>
          Text with line break and image (SHIFT+Enter)<br>
          I<img src="../../Uploads/.../screenshot.png" width="200">
        </p>
        <p>Next line text</p>
      </body>
    </html>

    Expected behavior:

    The image should appear below the line break, without overlapping the preceding text, just like in a standard web browser.

    Actual behavior:

    In the exported PDF, the image is rendered inline at the text baseline and overlaps the previous line.

    This only happens if the image is placed directly after br within the same paragraph.

    Notes:

    Tested with ActiveReports 19.

    Could you confirm if this is a bug in the HTML rendering engine of AR19, or if it is by design?

    It would be very helpful if img after br did not overlap text in the PDF export.

    Thank you!

    Regards, Alexander

  • Posted 4 September 2025, 4:53 am EST

    Hi Alexander,

    Thank you for sharing your HTML code. We tested it in a RichTextBox control on a section report and observed the overlapping behavior you mentioned. We then updated the HTML by setting the vertical alignment for the image using inline CSS, and this appears to have resolved the behavior. Please see the attached sample project demonstrating the fix.

    Could you check it and confirm if this workaround meets your requirement? If not, could you please update the attached sample project with the HTML code and image from your actual project, so we can investigate further and discuss it with the development team?

    Attachment: RichTextBoxExport.zip

    Best Regards,

    Kartik

  • Posted 9 September 2025, 1:59 am EST - Updated 9 September 2025, 2:04 am EST

    Hi Kartik,

    thank you for the sample project. I tested it in my environment (ActiveReports 19, SectionReport, RichTextBox).

    The overlapping with the text above the image is resolved. However, I am still seeing an issue when there is text immediately after the image in the same paragraph: in the screenshot this text is rendered on top of the image.

    Could you please check this scenario as well?

    Best regards,

    Alexander

  • Posted 10 September 2025, 5:05 am EST

    Hi Alexander,

    Thank you for sharing the screenshot. We were able to see the behavior you described. We have shared both your original HTML and the updated HTML with the development team to gather their insights and will update you as soon as possible.

    [Internal Tracking ID: AR-36243]

    Best Regards,

    Kartik

Need extra support?

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

Learn More

Forum Channels