Unplanned
Last Updated: 05 May 2025 12:24 by ADMIN
Svitlana
Created on: 29 Apr 2025 15:55
Category: PdfViewer
Type: Bug Report
1
RadPdfViewer: Multiple graphic state objects are lost on import

Overview

This repository documents a bug found in the Telerik PDF Viewer control for Windows Forms. The issue specifically affects the rendering of SVG graphics embedded in PDF files, where the stroke-width attribute is ignored by the viewer.

Affected Component

  • Product: Telerik UI for WinForms
  • Control: `RadPdfViewer'
  • Version: 2025.01
  • Platform: Windows Forms (.NET Framework)

Description of the Issue

When a PDF file contains an embedded SVG graphic that utilizes the stroke-width CSS property (or SVG attribute), the stroke width is not rendered correctly in Telerik's PDF preview control. Regardless of:

  • Unit used (e.g., px, pt, em, %, etc.)
  • Value assigned (e.g., stroke-width: 5stroke-width: 30, etc.)

…the resulting line always appears thin, as if the stroke width were ignored entirely. This makes the SVG appear incorrectly and inconsistent with its rendering in other PDF viewers (e.g., Adobe Acrobat, Chrome's built-in viewer).

Steps to Reproduce

  1. Run the application from provided MCVE
  2. Observe the SVG lines in PDF preview: all strokes appear thin, regardless of defined stroke width.

Expected Behavior

The Telerik PDF viewer should correctly honor and render the stroke-width property defined within SVG elements embedded in the PDF file.

Actual Behavior

All strokes in SVGs appear very thin, with no visual difference despite varying stroke widths in the source SVG.

Sample Files

  • βœ… _PdfExample.pdf: A PDF with SVG lines that render correctly in Microsoft Edge.
  • βœ… _PdfExample.pdf: Screenshot of how the PDF file looks in Microsoft Edge.
  • ❌ _ScreenshotFromTelerik.png: Screenshot of how the same file looks in the Telerik PDF Viewer (note the thin lines).
  • πŸ” _LargeStroke.svg_SmallStroke.svg: The original SVGs used in the PDF file.

Environment

ComponentVersion
Telerik UI2025.1.211.48
.NET Framework.NET Framework 4.8
OSWindows 11

Suggested Fix

Ensure that the rendering engine used by RadPdfViewer fully supports the SVG stroke-width attribute when parsing and rendering embedded SVG content.

Attached Files:
1 comment
ADMIN
Yoan
Posted on: 05 May 2025 12:24

Hello Svitlana,

Thank you for the provided resources and detailed description of the case. My name is Yoan, and I am part of the Document Processing team. The RadPdfViewer functionality highly depends on the features of our PdfProcessing library, as the library is used to import the documents before rendering them with the viewer.

I was able to reproduce the same results on my end and managed to identify the cause. It appears that the issue originates from the PdfProcessing library, where multiple graphic state objects are being lost when the document is imported. In the original file, each SVG has its own graphic state object that specifies its visual properties. However, the PdfProcessing issue causes all graphic state objects to be removed, and the SVG elements resort to a "default" graphic state, with the same line thickness.

Because this is the first time we are encountering this issue, I allowed myself to report it on your behalf by logging it as a task in our Document Processing Feedback Portal - PdfProcessing: Multiple graphic state objects are lost on import.

I have also approved this thread as a public bug report, which will serve as a task specifically for the viewer - RadPdfViewer: Multiple graphic state objects are lost on import.

Please accept my apologies for the inconvenience and setbacks this might be causing you, however, there is no workaround I can offer you in this scenario. If you are interested in any of these tasks, please know that you can subscribe to them in order to track their progress and receive notifications about potential status updates in the future. Once any task is resolved, we immediately update its public page to notify our users.

As a sign of appreciation for bringing this to our attention, I have also updated your Telerik Points.

If you happen to have any additional questions or feedback, do not hesitate to write back.

Regards,
Yoan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.