From 08073f2e9e7680e714bc256ee876e563e67fd921 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Sat, 1 Feb 2025 00:00:28 -0300 Subject: [PATCH] Upgrade all projects to .net8 --- DemoHighlight/DemoHighlighter.csproj | 51 +---- DemoHighlight/Properties/AssemblyInfo.cs | 35 ---- DemoImagePlugin/DemoImagePlugin.csproj | 61 +----- DemoImagePlugin/Properties/AssemblyInfo.cs | 35 ---- DemoImagePlugin/packages.config | 4 - .../Converters/BlockConverterBase.cs | 12 +- .../ContainerBlockConverter.cs | 4 +- .../ContainerConverters/RootBlockConverter.cs | 6 +- .../TableBlockConverter.cs | 6 +- .../LeafConverters/LeafBlockConverter.cs | 4 +- MarkdownToPdf/Dimension.cs | 2 +- .../Documentation/articles/conversion.md | 2 +- MarkdownToPdf/MarkdownToPdf.cs | 14 +- MarkdownToPdf/MarkdownToPdf.csproj | 179 +++--------------- MarkdownToPdf/MigrDoc/FontResolver.cs | 6 +- MarkdownToPdf/Properties/AssemblyInfo.cs | 39 ---- MarkdownToPdf/Styling/DefaultStyles.cs | 10 +- MarkdownToPdf/packages.config | 9 - Tests/Examples/AdvancedStyling.cs | 6 +- Tests/Examples/Attributes.cs | 2 +- Tests/Examples/BasicStyling.cs | 4 +- Tests/Examples/CustomStyles.cs | 4 +- Tests/Examples/Events.cs | 2 +- Tests/Examples/Features.cs | 4 +- Tests/Examples/FullBook.cs | 6 +- Tests/Examples/Highlighting.cs | 2 +- Tests/Examples/Plugins.cs | 2 +- Tests/Examples/Sections.cs | 2 +- Tests/Examples/Tables.cs | 2 +- Tests/Examples/Toc.cs | 2 +- Tests/Properties/AssemblyInfo.cs | 35 ---- Tests/Tests.csproj | 155 ++------------- Tests/data/attributes.md | 6 +- Tests/data/features.md | 2 +- Tests/packages.config | 5 - 35 files changed, 111 insertions(+), 609 deletions(-) delete mode 100644 DemoHighlight/Properties/AssemblyInfo.cs delete mode 100644 DemoImagePlugin/Properties/AssemblyInfo.cs delete mode 100644 DemoImagePlugin/packages.config delete mode 100644 MarkdownToPdf/Properties/AssemblyInfo.cs delete mode 100644 MarkdownToPdf/packages.config delete mode 100644 Tests/Properties/AssemblyInfo.cs delete mode 100644 Tests/packages.config diff --git a/DemoHighlight/DemoHighlighter.csproj b/DemoHighlight/DemoHighlighter.csproj index 2053f5a..490ed35 100644 --- a/DemoHighlight/DemoHighlighter.csproj +++ b/DemoHighlight/DemoHighlighter.csproj @@ -1,55 +1,16 @@ - - - + - Debug - AnyCPU - {03D26E9E-02B3-474A-BF6F-FC1E6F04BF66} + net8.0 Library - Properties DemoHighlight DemoHighlight - v4.7.2 - 512 - true + false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - + - - {3b2a01a0-b940-480b-bb24-4ab041a04aa2} - MarkdownToPdf - + + - \ No newline at end of file diff --git a/DemoHighlight/Properties/AssemblyInfo.cs b/DemoHighlight/Properties/AssemblyInfo.cs deleted file mode 100644 index 2093f97..0000000 --- a/DemoHighlight/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DemoHighlight")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("DemoHighlight")] -[assembly: AssemblyCopyright("Copyright © 2022")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("03d26e9e-02b3-474a-bf6f-fc1e6f04bf66")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/DemoImagePlugin/DemoImagePlugin.csproj b/DemoImagePlugin/DemoImagePlugin.csproj index 5e058bc..00e61d1 100644 --- a/DemoImagePlugin/DemoImagePlugin.csproj +++ b/DemoImagePlugin/DemoImagePlugin.csproj @@ -1,63 +1,18 @@ - - - + - Debug - AnyCPU - {02AD716B-4EEC-4094-8B0D-DF2EFD2C2A6A} + net8.0-windows Library - Properties - DemoImagePlugin - DemoImagePlugin - v4.7.2 - 512 - true + true + true - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - ..\packages\WpfMath.0.11.0\lib\net452\WpfMath.dll - - - - + - - {3b2a01a0-b940-480b-bb24-4ab041a04aa2} - MarkdownToPdf - + + - + - \ No newline at end of file diff --git a/DemoImagePlugin/Properties/AssemblyInfo.cs b/DemoImagePlugin/Properties/AssemblyInfo.cs deleted file mode 100644 index f506d07..0000000 --- a/DemoImagePlugin/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DemoImagePlugin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("DemoImagePlugin")] -[assembly: AssemblyCopyright("Copyright © 2022")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("02ad716b-4eec-4094-8b0d-df2efd2c2a6a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/DemoImagePlugin/packages.config b/DemoImagePlugin/packages.config deleted file mode 100644 index 9a5006f..0000000 --- a/DemoImagePlugin/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/MarkdownToPdf/Converters/BlockConverterBase.cs b/MarkdownToPdf/Converters/BlockConverterBase.cs index 0537825..4eb0cda 100644 --- a/MarkdownToPdf/Converters/BlockConverterBase.cs +++ b/MarkdownToPdf/Converters/BlockConverterBase.cs @@ -187,7 +187,7 @@ private void PrepareVerticalInheritedMargin(BoxSide side) } else { - horizontalMarginsPending.Add((EvaluatedStyle.Margin[side].Eval(FontSize, Width), Parent.EvaluatedStyle.Background)); + horizontalMarginsPending.Add((EvaluatedStyle.Margin[side].Eval(FontSize, Width).Point, Parent.EvaluatedStyle.Background)); EvaluatedStyle.Margin[side] = 0; } } @@ -201,24 +201,24 @@ private void PrepareVerticalInheritedMargin(BoxSide side) if (!EvaluatedStyle.Margin[side].IsEmptyOrZero(FontSize, Width)) { - horizontalMarginsPending.Add((EvaluatedStyle.Margin[side].Eval(FontSize, Width), Parent.EvaluatedStyle.Background)); + horizontalMarginsPending.Add((EvaluatedStyle.Margin[side].Eval(FontSize, Width).Point, Parent.EvaluatedStyle.Background)); } while (!(parent is IStandaloneContainerConverter) && IsMarginalBlock(parent.Block, side)) { if (!parent.EvaluatedStyle.Padding[side].IsEmptyOrZero(FontSize, Width)) - horizontalMarginsPending.Add((parent.EvaluatedStyle.Padding[side].Eval(FontSize, Width), parent.EvaluatedStyle.Background)); + horizontalMarginsPending.Add((parent.EvaluatedStyle.Padding[side].Eval(FontSize, Width).Point, parent.EvaluatedStyle.Background)); if (!parent.EvaluatedStyle.Margin[side].IsEmptyOrZero(FontSize, Width)) - horizontalMarginsPending.Add((parent.EvaluatedStyle.Margin[side].Eval(FontSize, Width), parent.Parent.EvaluatedStyle.Background)); + horizontalMarginsPending.Add((parent.EvaluatedStyle.Margin[side].Eval(FontSize, Width).Point, parent.Parent.EvaluatedStyle.Background)); parent = parent.Parent; } if (!(parent is IStandaloneContainerConverter)) { - horizontalMarginsPending.Add((parent.EvaluatedStyle.Padding[side].Eval(FontSize, Width), parent.EvaluatedStyle.Background)); - horizontalMarginsPending.Add((parent.EvaluatedStyle.Margin[side].Eval(FontSize, Width), parent.Parent.EvaluatedStyle.Background)); + horizontalMarginsPending.Add((parent.EvaluatedStyle.Padding[side].Eval(FontSize, Width).Point, parent.EvaluatedStyle.Background)); + horizontalMarginsPending.Add((parent.EvaluatedStyle.Margin[side].Eval(FontSize, Width).Point, parent.Parent.EvaluatedStyle.Background)); } return horizontalMarginsPending; } diff --git a/MarkdownToPdf/Converters/ContainerConverters/ContainerBlockConverter.cs b/MarkdownToPdf/Converters/ContainerConverters/ContainerBlockConverter.cs index d3040a0..a793092 100644 --- a/MarkdownToPdf/Converters/ContainerConverters/ContainerBlockConverter.cs +++ b/MarkdownToPdf/Converters/ContainerConverters/ContainerBlockConverter.cs @@ -35,9 +35,9 @@ protected override void PrepareStyling() EvaluatedStyle.Font = EvaluatedStyle.Font.MergeWith(Parent.EvaluatedStyle.Font); EvaluatedStyle.Background = EvaluatedStyle.Background.IsEmpty ? Parent.EvaluatedStyle.Background : EvaluatedStyle.Background; - FontSize = EvaluatedStyle.Font.Size.Eval(Parent.FontSize, Parent.Width); + FontSize = EvaluatedStyle.Font.Size.Eval(Parent.FontSize, Parent.Width).Point; Width = Parent.Width - (EvaluatedStyle.Margin.Left + EvaluatedStyle.Margin.Right + EvaluatedStyle.Padding.Left + EvaluatedStyle.Padding.Right) - .Eval(FontSize, Parent.Width); + .Eval(FontSize, Parent.Width).Point; } } diff --git a/MarkdownToPdf/Converters/ContainerConverters/RootBlockConverter.cs b/MarkdownToPdf/Converters/ContainerConverters/RootBlockConverter.cs index 174be45..b5f0717 100644 --- a/MarkdownToPdf/Converters/ContainerConverters/RootBlockConverter.cs +++ b/MarkdownToPdf/Converters/ContainerConverters/RootBlockConverter.cs @@ -19,7 +19,7 @@ public RootBlockConvertor(MarkdownDocument block, string rawText, MigraDocBlockC RawText = rawText; OutputContainer = output; ElementDescriptor = new SingleElementDescriptor { Attributes = Attributes, Type = ElementType.Root }; - Width = Owner.RealPageWidth; + Width = Owner.RealPageWidth.Point; Split(rawText); } @@ -32,8 +32,8 @@ private void Split(string rawText) protected override void PrepareStyling() { base.PrepareStyling(); - Width = Owner.RealPageWidth; - FontSize = EvaluatedStyle.Font.Size.Eval(12, Owner.RealPageWidth); + Width = Owner.RealPageWidth.Point; + FontSize = EvaluatedStyle.Font.Size.Eval(12, Owner.RealPageWidth.Point).Point; } } } \ No newline at end of file diff --git a/MarkdownToPdf/Converters/ContainerConverters/TableBlockConverter.cs b/MarkdownToPdf/Converters/ContainerConverters/TableBlockConverter.cs index d95c830..a0ba288 100644 --- a/MarkdownToPdf/Converters/ContainerConverters/TableBlockConverter.cs +++ b/MarkdownToPdf/Converters/ContainerConverters/TableBlockConverter.cs @@ -41,7 +41,7 @@ protected override void PrepareStyling() if (!EvaluatedStyle.Table.Width.IsEmpty) { - Width = EvaluatedStyle.Table.Width.Eval(FontSize, Parent.Width); + Width = EvaluatedStyle.Table.Width.Eval(FontSize, Parent.Width).Point; tableWidthSet = true; } if (Attributes.ContainsKey("align")) @@ -60,7 +60,7 @@ protected override void PrepareStyling() try { var w = Dimension.Parse(Attributes.Attributes["width"]); - Width = w.Eval(FontSize, Parent.Width); + Width = w.Eval(FontSize, Parent.Width).Point; tableWidthSet = true; } catch (ArgumentException e) @@ -164,7 +164,7 @@ private void AddSimulatedMargin(Unit margin, bool top = false) private void PrepareColumns() { var colWidths = GetColumnWidths(); - var totalColumnsWidth = colWidths.Sum(x => x.Eval(FontSize, Width)); + var totalColumnsWidth = colWidths.Sum(x => x.Eval(FontSize, Width).Point); var scale = totalColumnsWidth > Width || tableWidthSet ? Width / totalColumnsWidth : 1.0; for (var i = 0; i < colWidths.Count; i++) diff --git a/MarkdownToPdf/Converters/LeafConverters/LeafBlockConverter.cs b/MarkdownToPdf/Converters/LeafConverters/LeafBlockConverter.cs index 77c4d26..f571440 100644 --- a/MarkdownToPdf/Converters/LeafConverters/LeafBlockConverter.cs +++ b/MarkdownToPdf/Converters/LeafConverters/LeafBlockConverter.cs @@ -50,8 +50,8 @@ protected override void PrepareStyling() } } - FontSize = EvaluatedStyle.Font.Size.Eval(Parent.FontSize, Parent.Width); - Width = Parent.Width - (EvaluatedStyle.Margin.Left + EvaluatedStyle.Margin.Right + EvaluatedStyle.Padding.Left + EvaluatedStyle.Padding.Right).Eval(FontSize, Parent.Width); + FontSize = EvaluatedStyle.Font.Size.Eval(Parent.FontSize, Parent.Width).Point; + Width = Parent.Width - (EvaluatedStyle.Margin.Left + EvaluatedStyle.Margin.Right + EvaluatedStyle.Padding.Left + EvaluatedStyle.Padding.Right).Eval(FontSize, Parent.Width).Point; } protected override void AdjustInheritedHorizontalMargins() diff --git a/MarkdownToPdf/Dimension.cs b/MarkdownToPdf/Dimension.cs index 1d67d10..e9457a9 100644 --- a/MarkdownToPdf/Dimension.cs +++ b/MarkdownToPdf/Dimension.cs @@ -130,7 +130,7 @@ public static implicit operator Dimension(string value) public static implicit operator Dimension(Unit value) { - return FromPoints(value); + return FromPoints(value.Point); } /// diff --git a/MarkdownToPdf/Documentation/articles/conversion.md b/MarkdownToPdf/Documentation/articles/conversion.md index 0a165b4..a109c91 100644 --- a/MarkdownToPdf/Documentation/articles/conversion.md +++ b/MarkdownToPdf/Documentation/articles/conversion.md @@ -24,7 +24,7 @@ pdf Headers and footers can be added by `AddHeader()` and `AdFooter()` and their variants - see the [MarkDownToPdfClass](xref:Orionsoft.MarkdownToPdfLib.MarkdownToPdf) documentation. Like in this example: ```csharp -var markdown = File.ReadAllText("../../data/alice1.md"); +var markdown = File.ReadAllText("data/alice1.md"); var footer = "{align=center}\r\n\\- [](md:page) - "; var pdf = new MarkdownToPdf(); diff --git a/MarkdownToPdf/MarkdownToPdf.cs b/MarkdownToPdf/MarkdownToPdf.cs index 674f4e5..2367b68 100644 --- a/MarkdownToPdf/MarkdownToPdf.cs +++ b/MarkdownToPdf/MarkdownToPdf.cs @@ -409,10 +409,10 @@ public IMarkdownToPdf PaperOrientation(PaperOrientation po) public IMarkdownToPdf PageMargins(Dimension left, Dimension right, Dimension top, Dimension bottom) { PageSetup target = GetCurrentPageSetup(); - target.LeftMargin = left.Eval(defaultStyles.fontSize, RealPageWidth); - target.RightMargin = right.Eval(defaultStyles.fontSize, RealPageWidth); - target.TopMargin = top.Eval(defaultStyles.fontSize, RealPageWidth); - target.BottomMargin = bottom.Eval(defaultStyles.fontSize, RealPageWidth); + target.LeftMargin = left.Eval(defaultStyles.fontSize, RealPageWidth.Point); + target.RightMargin = right.Eval(defaultStyles.fontSize, RealPageWidth.Point); + target.TopMargin = top.Eval(defaultStyles.fontSize, RealPageWidth.Point); + target.BottomMargin = bottom.Eval(defaultStyles.fontSize, RealPageWidth.Point); return this; } @@ -422,7 +422,7 @@ public IMarkdownToPdf PageMargins(Dimension left, Dimension right, Dimension top public IMarkdownToPdf HeaderDistance(Dimension distance) { PageSetup target = GetCurrentPageSetup(); - target.HeaderDistance = distance.Eval(defaultStyles.fontSize, RealPageWidth); + target.HeaderDistance = distance.Eval(defaultStyles.fontSize, RealPageWidth.Point); return this; } @@ -432,7 +432,7 @@ public IMarkdownToPdf HeaderDistance(Dimension distance) public IMarkdownToPdf FooterDistance(Dimension distance) { PageSetup target = GetCurrentPageSetup(); - target.FooterDistance = distance.Eval(defaultStyles.fontSize, RealPageWidth); + target.FooterDistance = distance.Eval(defaultStyles.fontSize, RealPageWidth.Point); return this; } @@ -514,7 +514,7 @@ private Unit GetRealPageWidth() private PdfDocumentRenderer Render() { - PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(true) + PdfDocumentRenderer pdfRenderer = new() { Document = MigraDocument }; diff --git a/MarkdownToPdf/MarkdownToPdf.csproj b/MarkdownToPdf/MarkdownToPdf.csproj index f8698f6..ca3a0cc 100644 --- a/MarkdownToPdf/MarkdownToPdf.csproj +++ b/MarkdownToPdf/MarkdownToPdf.csproj @@ -1,165 +1,40 @@ - - - + - Debug - AnyCPU - {3B2A01A0-B940-480B-BB24-4AB041A04AA2} + net8.0 Library Orionsoft.MarkdownToPdfLib - MarkdownToPdf - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\MarkdownToPdf.xml + true - + C# library for easy generation of PDFs from markdown + MarkdownToPdf Library + Copyright © 2022 Tomas Kun - - ..\packages\Markdig.0.26.0\lib\net452\Markdig.dll - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\MigraDoc.DocumentObjectModel.dll - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\MigraDoc.Rendering.dll - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\MigraDoc.RtfRendering.dll - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\PdfSharp.dll - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\PdfSharp.Charting.dll - - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - .editorconfig - - - - + - + + + + + + + + + + + + + + - \ No newline at end of file diff --git a/MarkdownToPdf/MigrDoc/FontResolver.cs b/MarkdownToPdf/MigrDoc/FontResolver.cs index 7b17aaa..423556f 100644 --- a/MarkdownToPdf/MigrDoc/FontResolver.cs +++ b/MarkdownToPdf/MigrDoc/FontResolver.cs @@ -30,8 +30,12 @@ public FontResolverInfo ResolveTypeface(string familyName, bool isBold, bool isI var name = familyName.ToLower(); var registeredFont = _fonts.FirstOrDefault(x => x.Name.ToLower() == name); + + if (registeredFont == null) + { - if (registeredFont == null) return PlatformFontResolver.ResolveTypeface(familyName, isBold, isItalic); + return PlatformFontResolver.ResolveTypeface(familyName, isBold, isItalic); + } if (isBold) { diff --git a/MarkdownToPdf/Properties/AssemblyInfo.cs b/MarkdownToPdf/Properties/AssemblyInfo.cs deleted file mode 100644 index 0f49f79..0000000 --- a/MarkdownToPdf/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -// This file is a part of MarkdownToPdf Library by Tomas Kubec -// Distributed under MIT license - see license.txt -// - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MarkdownToPdf")] -[assembly: AssemblyDescription("C# library for easy generation of PDFs from markdown")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MarkdownToPdf Library")] -[assembly: AssemblyCopyright("Copyright © 2022 Tomas Kun\bec")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3b2a01a0-b940-480b-bb24-4ab041a04aa2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/MarkdownToPdf/Styling/DefaultStyles.cs b/MarkdownToPdf/Styling/DefaultStyles.cs index ceb9112..a4c9065 100644 --- a/MarkdownToPdf/Styling/DefaultStyles.cs +++ b/MarkdownToPdf/Styling/DefaultStyles.cs @@ -234,11 +234,11 @@ private void InitContainers() style.Margin.Bottom = ".75em"; style = styleManager.Styles[MarkdownStyleNames.UnorderedListItem]; - style.Bullet.Normal.Content = "\x2022"; - style.Bullet.Unchecked.Font.Name = "Wingdings"; - style.Bullet.Unchecked.Content = "\xA8"; - style.Bullet.Checked.Font.Name = "Wingdings"; - style.Bullet.Checked.Content = "\xFE"; + style.Bullet.Normal.Content = "•"; + style.Bullet.Unchecked.Font.Name = "Segoe UI Symbol"; + style.Bullet.Unchecked.Content = "☐"; + style.Bullet.Checked.Font.Name = "Segoe UI Symbol"; + style.Bullet.Checked.Content = "☑"; style.Bullet.Normal.Font.Bold = false; style.Bullet.Normal.Font.Italic = false; style.Bullet.Normal.Font.Superscript = false; diff --git a/MarkdownToPdf/packages.config b/MarkdownToPdf/packages.config deleted file mode 100644 index c03df32..0000000 --- a/MarkdownToPdf/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Tests/Examples/AdvancedStyling.cs b/Tests/Examples/AdvancedStyling.cs index d1f3dc9..3ccd20f 100644 --- a/Tests/Examples/AdvancedStyling.cs +++ b/Tests/Examples/AdvancedStyling.cs @@ -16,15 +16,15 @@ public static class AdvancedStyling { public static void Run() { - var markdown = File.ReadAllText("../../data/advanced.md"); + var markdown = File.ReadAllText("data/advanced.md"); var pdf = new MarkdownToPdf(); // definition of asterism ruler - centered decorative symbol var asterismStyle = pdf.StyleManager.AddStyle("asterismRuler", MarkdownStyleNames.Break); asterismStyle.Paragraph.Alignment = ParagraphAlignment.Center; - asterismStyle.Bullet.Normal.Content = "\xF9"; - asterismStyle.Bullet.Normal.Font.Name = "Wingdings 2"; + asterismStyle.Bullet.Normal.Content = "⁂"; + asterismStyle.Bullet.Normal.Font.Name = "Segoe UI Symbol"; asterismStyle.Bullet.Normal.Font.Size = "2em"; asterismStyle.Margin.Top = 12; asterismStyle.Margin.Bottom = 12; diff --git a/Tests/Examples/Attributes.cs b/Tests/Examples/Attributes.cs index 6242d92..09ddd07 100644 --- a/Tests/Examples/Attributes.cs +++ b/Tests/Examples/Attributes.cs @@ -13,7 +13,7 @@ public static class Attributes { public static void Run() { - var markdown = File.ReadAllText("../../data/attributes.md"); + var markdown = File.ReadAllText("data/attributes.md"); var pdf = new MarkdownToPdf(); pdf.WarningIssued += (o, e) => { Console.WriteLine($"{e.Category}: {e.Message}"); }; diff --git a/Tests/Examples/BasicStyling.cs b/Tests/Examples/BasicStyling.cs index 5b88318..b75ca07 100644 --- a/Tests/Examples/BasicStyling.cs +++ b/Tests/Examples/BasicStyling.cs @@ -17,7 +17,7 @@ public static class BasicStyling { public static void Run() { - var markdown = File.ReadAllText("../../data/alice1.md"); + var markdown = File.ReadAllText("data/alice1.md"); var footer = "{align=center}\r\n\\- [](md:page) - "; var pdf = new MarkdownToPdf(); @@ -29,7 +29,7 @@ public static void Run() .PaperSize(PaperSize.B5) .Title("Alice's Adventures in Wonderland, Chapter I") .Author("Lewis Carroll") - .DefaultFont("Garamond", 12) + .DefaultFont("Arial", 12) .Add(markdown) .AddFooter(footer) .Save("alice.pdf"); diff --git a/Tests/Examples/CustomStyles.cs b/Tests/Examples/CustomStyles.cs index 1cf976f..a3b3820 100644 --- a/Tests/Examples/CustomStyles.cs +++ b/Tests/Examples/CustomStyles.cs @@ -16,7 +16,7 @@ public static class CustomStyles { public static void Run() { - var markdown = File.ReadAllText("../../data/customStyles.md"); + var markdown = File.ReadAllText("data/customStyles.md"); var pdf = new MarkdownToPdf(); // style with modifyied bullet is bound to nested list item (list item with an ancestor - other list litem) @@ -31,7 +31,7 @@ public static void Run() pdf.StyleManager.ForElement(ElementType.Paragraph, "blue").Bind(style); pdf - .DefaultFont("Calibri", 11) + .DefaultFont("Times New Roman", 11) .Add(markdown) .Save("customStyles.pdf"); } diff --git a/Tests/Examples/Events.cs b/Tests/Examples/Events.cs index c0389ce..6c3d748 100644 --- a/Tests/Examples/Events.cs +++ b/Tests/Examples/Events.cs @@ -19,7 +19,7 @@ public static class Events { public static void Run() { - var markdown = File.ReadAllText("../../data/events.md"); + var markdown = File.ReadAllText("data/events.md"); var pdf = new MarkdownToPdf(); diff --git a/Tests/Examples/Features.cs b/Tests/Examples/Features.cs index 0b93a79..86b33ab 100644 --- a/Tests/Examples/Features.cs +++ b/Tests/Examples/Features.cs @@ -14,7 +14,7 @@ public static class Features { public static void Run() { - var markdown = File.ReadAllText("../../data/features.md"); + var markdown = File.ReadAllText("data/features.md"); var footer = "{align=center}\r\nPage [](md:page)"; var pdf = new MarkdownToPdf(); pdf.PluginManager.Add(new DemoHighlighter.Highlighter()); @@ -31,7 +31,7 @@ public static void Run() pdf .PaperSize(PaperSize.A4) - .FontDir("../../data/fonts") + .FontDir("data/fonts") .RegisterLocalFont("Roboto", regular: "Roboto-Light.ttf", bold: "Roboto-Bold.ttf", italic: "Roboto-Italic.ttf") .DefaultFont("Roboto", 11) .Add(markdown) diff --git a/Tests/Examples/FullBook.cs b/Tests/Examples/FullBook.cs index 5b43509..e69f671 100644 --- a/Tests/Examples/FullBook.cs +++ b/Tests/Examples/FullBook.cs @@ -14,7 +14,7 @@ public static class FullBook { public static void Run() { - var markdown = File.ReadAllText("../../data/alice.md"); + var markdown = File.ReadAllText("data/alice.md"); var footer = "{.center}\r\n[](md:page)"; var pdf = new MarkdownToPdf(); @@ -26,8 +26,8 @@ public static void Run() .DefalutDpi(200) .Title("Alice's Adventures in Wonderland") .Author("Lewis Carroll") - .DefaultFont("Garamond", 12) - .ImageDir("../../data/") + .DefaultFont("Arial", 12) + .ImageDir("data/") .PageMargins("2cm", "2cm", "2cm", "2.5cm") .Add(markdown) .AddFooter(footer) diff --git a/Tests/Examples/Highlighting.cs b/Tests/Examples/Highlighting.cs index c0a3f98..449de3b 100644 --- a/Tests/Examples/Highlighting.cs +++ b/Tests/Examples/Highlighting.cs @@ -12,7 +12,7 @@ public static class Highlighting { public static void Run() { - var markdown = File.ReadAllText("../../data/highlighting.md"); + var markdown = File.ReadAllText("data/highlighting.md"); var pdf = new MarkdownToPdf(); pdf.PluginManager.Add(new DemoHighlighter.Highlighter()); pdf.WarningIssued += (o, e) => { Console.WriteLine($"{e.Category}: {e.Message}"); }; diff --git a/Tests/Examples/Plugins.cs b/Tests/Examples/Plugins.cs index c816847..839a19e 100644 --- a/Tests/Examples/Plugins.cs +++ b/Tests/Examples/Plugins.cs @@ -13,7 +13,7 @@ public static class Plugins public static void Run() { var dp = new DemoImagePlugin.DemoImagePlugin(); - var markdown = File.ReadAllText("../../data/plugins.md"); + var markdown = File.ReadAllText("data/plugins.md"); using (var pdf = new MarkdownToPdf()) { pdf.PluginManager.AddMathPlugin(dp); diff --git a/Tests/Examples/Sections.cs b/Tests/Examples/Sections.cs index c191967..3eb0d19 100644 --- a/Tests/Examples/Sections.cs +++ b/Tests/Examples/Sections.cs @@ -14,7 +14,7 @@ public static class Sections { public static void Run() { - var markdown = File.ReadAllText("../../data/sections.md"); + var markdown = File.ReadAllText("data/sections.md"); var pdf = new MarkdownToPdf(); pdf.WarningIssued += (o, e) => { Console.WriteLine($"{e.Category}: {e.Message}"); }; diff --git a/Tests/Examples/Tables.cs b/Tests/Examples/Tables.cs index 408331e..7ab0a00 100644 --- a/Tests/Examples/Tables.cs +++ b/Tests/Examples/Tables.cs @@ -15,7 +15,7 @@ public static class Tables { public static void Run() { - var markdown = File.ReadAllText("../../data/tables.md"); + var markdown = File.ReadAllText("data/tables.md"); var pdf = new MarkdownToPdf(); diff --git a/Tests/Examples/Toc.cs b/Tests/Examples/Toc.cs index d8f63b4..10a38b4 100644 --- a/Tests/Examples/Toc.cs +++ b/Tests/Examples/Toc.cs @@ -12,7 +12,7 @@ public static class Toc { public static void Run() { - var markdown = File.ReadAllText("../../data/toc.md"); + var markdown = File.ReadAllText("data/toc.md"); var pdf = new MarkdownToPdf(); diff --git a/Tests/Properties/AssemblyInfo.cs b/Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 69c2cc5..0000000 --- a/Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Tests")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6df4a657-6d6f-4e04-8621-6de99c8d78f6")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 4a1c123..091d862 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,153 +1,22 @@ - - - + - Debug - AnyCPU - {6DF4A657-6D6F-4E04-8621-6DE99C8D78F6} + net8.0-windows Exe - Tests - Tests - v4.7.2 - 512 - true - true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\MigraDoc.DocumentObjectModel.dll - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\MigraDoc.Rendering.dll - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\MigraDoc.RtfRendering.dll - - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\PdfSharp.dll - - - ..\packages\PDFsharp-MigraDoc.1.50.5147\lib\net20\PdfSharp.Charting.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {03d26e9e-02b3-474a-bf6f-fc1e6f04bf66} - DemoHighlighter - - - {02ad716b-4eec-4094-8b0d-df2efd2c2a6a} - DemoImagePlugin - - - {3B2A01A0-B940-480B-BB24-4AB041A04AA2} - MarkdownToPdf - + + + - + + + + + - - False - Microsoft .NET Framework 4.7.2 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - + + - \ No newline at end of file diff --git a/Tests/data/attributes.md b/Tests/data/attributes.md index f0d1bf8..e2f88e1 100644 --- a/Tests/data/attributes.md +++ b/Tests/data/attributes.md @@ -28,15 +28,15 @@ - li -Inline image ![Clock](../../data/images/clock.png){height=1em} is here. +Inline image ![Clock](data/images/clock.png){height=1em} is here. **Centered image:** -![Clock](../../data/images/clock.png){align=center width=2em} +![Clock](data/images/clock.png){align=center width=2em} **Watermark image:** -![Clock](../../data/images/clock.png){align=right width=3em watermark} +![Clock](data/images/clock.png){align=right width=3em watermark} Text is placed over the image formatted as `watermark`. diff --git a/Tests/data/features.md b/Tests/data/features.md index de2329e..c8de810 100644 --- a/Tests/data/features.md +++ b/Tests/data/features.md @@ -94,7 +94,7 @@ Autoconverted link http://www.google.com is also possible ## Images -![Clock](../../data/images/clock.png) +![Clock](data/images/clock.png) # Extended features diff --git a/Tests/packages.config b/Tests/packages.config deleted file mode 100644 index d6d6892..0000000 --- a/Tests/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file