Skip to content

Conversation

@maikebing
Copy link

No description provided.

Copilot AI review requested due to automatic review settings December 4, 2025 04:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to add support for .NET 10.0 to the PdfSharp library. However, there are critical issues: .NET 10 does not exist as of December 2025 (the latest version is .NET 9), making all references to net10.0 and version 10.0.* packages invalid. Additionally, the PR comments out all non-ISO page size cases in PageSizeConverter.cs while leaving the corresponding enum values intact, which will cause runtime exceptions when these page sizes are used.

Key Changes:

  • Added net10.0 and net472 to target frameworks in both PdfSharp.csproj and PdfSharp.Charting.csproj
  • Commented out all non-ISO page size case statements in PageSizeConverter.cs
  • Changed special characters to "?" in comments (encoding issue corrections)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/PdfSharp/PdfSharp.csproj Added net10.0 and net472 target frameworks with conditional package references for different framework versions
src/PdfSharp.Charting/PdfSharp.Charting.csproj Added net10.0 and net472 target frameworks with framework-specific package references and reformatted project file indentation
src/PdfSharp/root/PageSizeConverter.cs Commented out all non-ISO page size cases (critical bug), added extra slash to comment
src/PdfSharp/Pdf.Security/PdfStandardSecurityHandler.cs Fixed character encoding in documentation comments (bullet points changed from � to ?)
src/PdfSharp.Charting/Charting.Renderers/MarkerRenderer.cs Fixed character encoding in degree symbol comments (° to ?)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +115 to +155
//case PageSize.Quarto: // 8 x 10 inch? return new XSize(576, 720);

case PageSize.Foolscap: // 8 x 13 inch²
return new XSize(576, 936);
//case PageSize.Foolscap: // 8 x 13 inch? return new XSize(576, 936);

case PageSize.Executive: // 7.5 x 10 inch²
return new XSize(540, 720);
//case PageSize.Executive: // 7.5 x 10 inch? return new XSize(540, 720);

case PageSize.GovernmentLetter: // 8 x 10.5 inch²
return new XSize(576, 756);
//case PageSize.GovernmentLetter: // 8 x 10.5 inch? return new XSize(576, 756);

case PageSize.Letter: // 8.5 x 11 inch²
return new XSize(612, 792);
//case PageSize.Letter: // 8.5 x 11 inch? return new XSize(612, 792);

case PageSize.Legal: // 8.5 x 14 inch²
return new XSize(612, 1008);
//case PageSize.Legal: // 8.5 x 14 inch? return new XSize(612, 1008);

case PageSize.Ledger: // 17 x 11 inch²
return new XSize(1224, 792);
//case PageSize.Ledger: // 17 x 11 inch? return new XSize(1224, 792);

case PageSize.Tabloid: // 11 x 17 inch²
return new XSize(792, 1224);
//case PageSize.Tabloid: // 11 x 17 inch? return new XSize(792, 1224);

case PageSize.Post: // 15.5 x 19.25 inch²
return new XSize(1126, 1386);
//case PageSize.Post: // 15.5 x 19.25 inch? return new XSize(1126, 1386);

case PageSize.Crown: // 20 x 15 inch²
return new XSize(1440, 1080);
//case PageSize.Crown: // 20 x 15 inch? return new XSize(1440, 1080);

case PageSize.LargePost: // 16.5 x 21 inch²
return new XSize(1188, 1512);
//case PageSize.LargePost: // 16.5 x 21 inch? return new XSize(1188, 1512);

case PageSize.Demy: // 17.5 x 22 inch²
return new XSize(1260, 1584);
//case PageSize.Demy: // 17.5 x 22 inch? return new XSize(1260, 1584);

case PageSize.Medium: // 18 x 23 inch²
return new XSize(1296, 1656);
//case PageSize.Medium: // 18 x 23 inch? return new XSize(1296, 1656);

case PageSize.Royal: // 20 x 25 inch²
return new XSize(1440, 1800);
//case PageSize.Royal: // 20 x 25 inch? return new XSize(1440, 1800);

case PageSize.Elephant: // 23 x 28 inch²
return new XSize(1565, 2016);
//case PageSize.Elephant: // 23 x 28 inch? return new XSize(1565, 2016);

case PageSize.DoubleDemy: // 23.5 x 35 inch²
return new XSize(1692, 2520);
//case PageSize.DoubleDemy: // 23.5 x 35 inch? return new XSize(1692, 2520);

case PageSize.QuadDemy: // 35 x 45 inch²
return new XSize(2520, 3240);
//case PageSize.QuadDemy: // 35 x 45 inch? return new XSize(2520, 3240);

case PageSize.STMT: // 5.5 x 8.5 inch²
return new XSize(396, 612);
//case PageSize.STMT: // 5.5 x 8.5 inch? return new XSize(396, 612);

case PageSize.Folio: // 8.5 x 13 inch²
return new XSize(612, 936);
//case PageSize.Folio: // 8.5 x 13 inch? return new XSize(612, 936);

case PageSize.Statement: // 5.5 x 8.5 inch²
return new XSize(396, 612);
//case PageSize.Statement: // 5.5 x 8.5 inch? return new XSize(396, 612);

case PageSize.Size10x14: // 10 x 14 inch²
return new XSize(720, 1008);
//case PageSize.Size10x14: // 10 x 14 inch? return new XSize(720, 1008);
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical bug: All non-ISO page size cases are commented out, but the corresponding enum values still exist in PageSize.cs (Quarto, Foolscap, Executive, GovernmentLetter, Letter, Legal, Ledger, Tabloid, Post, Crown, LargePost, Demy, Medium, Royal, Elephant, DoubleDemy, QuadDemy, STMT, Folio, Statement, Size10x14). When these enum values are passed to ToSize(), the method will throw an ArgumentException instead of returning the appropriate XSize. Either uncomment these cases or remove the corresponding enum values from PageSize.cs.

Copilot uses AI. Check for mistakes.
return new XSize(499, 709);

// The non-ISO sizes ...
//// The non-ISO sizes ...
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extra forward slash changes the comment from a standard comment (//) to a documentation comment (///). However, this line is not documenting a code element and should remain a standard comment. The correct format should be // The non-ISO sizes ... not //// The non-ISO sizes ...

Suggested change
//// The non-ISO sizes ...
// The non-ISO sizes ...

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant