From b901f73021fb670d9ab49d357d697710705c53cb Mon Sep 17 00:00:00 2001 From: maikebing Date: Thu, 4 Dec 2025 12:35:50 +0800 Subject: [PATCH] upgrade .net 10 --- .../Charting.Renderers/MarkerRenderer.cs | 4 +- .../PdfSharp.Charting.csproj | 300 +++++++++--------- .../PdfStandardSecurityHandler.cs | 6 +- src/PdfSharp/PdfSharp.csproj | 24 +- src/PdfSharp/root/PageSizeConverter.cs | 65 ++-- 5 files changed, 203 insertions(+), 196 deletions(-) diff --git a/src/PdfSharp.Charting/Charting.Renderers/MarkerRenderer.cs b/src/PdfSharp.Charting/Charting.Renderers/MarkerRenderer.cs index 96457e16..dea3d898 100644 --- a/src/PdfSharp.Charting/Charting.Renderers/MarkerRenderer.cs +++ b/src/PdfSharp.Charting/Charting.Renderers/MarkerRenderer.cs @@ -146,7 +146,7 @@ internal static void Draw(XGraphics graphics, XPoint pos, MarkerRendererInfo ren double outerCircle = size / 2; double innerCircle = size / 5; // outer circle - double rad = -(Math.PI / 2); // 90° + double rad = -(Math.PI / 2); // 90? for (int idx = 0; idx < 10; idx += 2) { points[idx].X = pos.X + outerCircle * Math.Cos(rad); @@ -155,7 +155,7 @@ internal static void Draw(XGraphics graphics, XPoint pos, MarkerRendererInfo ren } // inner circle - rad = -(Math.PI / 4); // 45° + rad = -(Math.PI / 4); // 45? double x = innerCircle * Math.Cos(rad); double y = innerCircle * Math.Sin(rad); points[1].X = pos.X + x; diff --git a/src/PdfSharp.Charting/PdfSharp.Charting.csproj b/src/PdfSharp.Charting/PdfSharp.Charting.csproj index d017fb51..c1183a8b 100644 --- a/src/PdfSharp.Charting/PdfSharp.Charting.csproj +++ b/src/PdfSharp.Charting/PdfSharp.Charting.csproj @@ -1,147 +1,159 @@  - - netstandard2.0;net8.0 - $(DefineConstants);CORE;CORE_WITH_GDI - PdfSharp.Charting - PDFSharp.Charting.NetStandard2 - 0 - 1.51.5185.3 - false - false - false - false - false - false - false - PdfSharp.Charting - false - https://github.com/LionelVallet/PDFsharp - true - StrongnameKey.snk - empira Software GmbH, Lionel Vallet - PDFSharp, NET, Standard, Core, PDF, Charting - true - icon.png - PDFsharp is the Open Source .NET library that easily creates and processes PDF documents on the fly from any .NET language. The same drawing routines can be used to create PDF documents, draw on the screen, or send output to any printer. + + net472;netstandard2.0;net8.0;net10.0 + $(DefineConstants);CORE;CORE_WITH_GDI + PdfSharp.Charting + PDFSharp.Charting.NetStandard2 + 0 + 1.51.5185.3 + false + false + false + false + false + false + false + PdfSharp.Charting + false + https://github.com/LionelVallet/PDFsharp + true + StrongnameKey.snk + empira Software GmbH, Lionel Vallet + PDFSharp, NET, Standard, Core, PDF, Charting + true + icon.png + + PDFsharp is the Open Source .NET library that easily creates and processes PDF documents on the fly from any .NET language. The same drawing routines can be used to create PDF documents, draw on the screen, or send output to any printer. -This is the .NET Standard version of the PDFsharp PDF Core package. See Project Information for details. - LICENSE - - - - - - - root\VersionInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5a6055bc-bf86-4fdd-9f62-0109db7a303b} - PdfSharp - - - - - True - - - - True - - - + This is the .NET Standard version of the PDFsharp PDF Core package. See Project Information for details. + + LICENSE + + + + + + + + + + + + + + + + + root\VersionInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {5a6055bc-bf86-4fdd-9f62-0109db7a303b} + PdfSharp + + + + + True + + + + True + + + \ No newline at end of file diff --git a/src/PdfSharp/Pdf.Security/PdfStandardSecurityHandler.cs b/src/PdfSharp/Pdf.Security/PdfStandardSecurityHandler.cs index 4bebef22..e135f8d0 100644 --- a/src/PdfSharp/Pdf.Security/PdfStandardSecurityHandler.cs +++ b/src/PdfSharp/Pdf.Security/PdfStandardSecurityHandler.cs @@ -674,12 +674,12 @@ internal override void WriteObject(PdfWriter writer) /// /// (Required) A number specifying which revision of the standard security handler /// should be used to interpret this dictionary: - /// • 2 if the document is encrypted with a V value less than 2 and does not have any of + /// ?2 if the document is encrypted with a V value less than 2 and does not have any of /// the access permissions set (by means of the P entry, below) that are designated /// "Revision 3 or greater". - /// • 3 if the document is encrypted with a V value of 2 or 3, or has any "Revision 3 or + /// ?3 if the document is encrypted with a V value of 2 or 3, or has any "Revision 3 or /// greater" access permissions set. - /// • 4 if the document is encrypted with a V value of 4 + /// ?4 if the document is encrypted with a V value of 4 /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string R = "/R"; diff --git a/src/PdfSharp/PdfSharp.csproj b/src/PdfSharp/PdfSharp.csproj index 61d635ad..0df33187 100644 --- a/src/PdfSharp/PdfSharp.csproj +++ b/src/PdfSharp/PdfSharp.csproj @@ -1,6 +1,6 @@  - netstandard2.0;net8.0 + net472;netstandard2.0;net8.0;net10.0 $(DefineConstants);CORE;CORE_WITH_GDI false false @@ -407,9 +407,25 @@ This is the .NET Standard version of the PDFsharp PDF Core package. See Project + - - - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/PdfSharp/root/PageSizeConverter.cs b/src/PdfSharp/root/PageSizeConverter.cs index df8161ee..f9e73b77 100644 --- a/src/PdfSharp/root/PageSizeConverter.cs +++ b/src/PdfSharp/root/PageSizeConverter.cs @@ -110,70 +110,49 @@ public static XSize ToSize(PageSize value) case PageSize.B5: return new XSize(499, 709); - // The non-ISO sizes ... + //// The non-ISO sizes ... - case PageSize.Quarto: // 8 x 10 inch² - return new XSize(576, 720); + //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); } throw new ArgumentException("Invalid PageSize.", "value"); }