Fix table border width not applying DPI conversion when printing#254
Draft
Fix table border width not applying DPI conversion when printing#254
Conversation
Co-authored-by: majorsilence <[email protected]>
Copilot
AI
changed the title
[WIP] Fix table borders not printing correctly
Fix table border width not applying DPI conversion when printing
Oct 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Table borders were not printing at the correct width. When users set a border width in the designer (e.g., changing from 1pt to 5pt via right-click Table → Properties → Border), the borders would display correctly on screen but would always print at 1pt regardless of the specified size.
Root Cause
The issue was in
RdlEngine/PageDrawing.cswhere two methods (DrawLineandDrawCurve) were responsible for drawing borders during printing. Both had bugs related to DPI conversion:tmpW) but then created the Pen with the original, unconverted width (w)When printing, graphics operations use pixels as the unit (
GraphicsUnit.Pixel), so border widths specified in points need to be converted using the formula:(width_in_points × DpiX) / 72Changes
Fixed both methods to properly use DPI-converted widths:
The same fix was applied to
DrawCurve, which previously had no DPI conversion at all.Impact
Testing
Fixes #[issue_number]
Original prompt
Fixes #26
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.