Skip to content

Commit 3fb4e9e

Browse files
committed
1 parent b28bc32 commit 3fb4e9e

File tree

403 files changed

+14991
-8194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

403 files changed

+14991
-8194
lines changed

.editorconfig

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[*.{cs,vb}]
22

3+
# 2024-02-23: I noticed that Visual studio started to think my source code is written in German 😲
4+
spelling_languages = en-us
5+
36
# IDE0049: Simplify Names
47
dotnet_style_predefined_type_for_locals_parameters_members = false:silent
58

@@ -72,6 +75,9 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
7275
dotnet_style_prefer_compound_assignment = true:suggestion
7376
dotnet_style_prefer_simplified_interpolation = true:suggestion
7477
dotnet_style_namespace_match_folder = true:suggestion
78+
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
79+
dotnet_style_readonly_field = true:suggestion
80+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
7581

7682
[*.cs]
7783
csharp_indent_labels = one_less_than_current
@@ -97,4 +103,12 @@ csharp_style_prefer_index_operator = true:suggestion
97103
csharp_style_prefer_range_operator = true:suggestion
98104
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
99105
csharp_style_prefer_tuple_swap = true:suggestion
100-
csharp_style_prefer_utf8_string_literals = true:suggestion
106+
csharp_style_prefer_utf8_string_literals = true:suggestion
107+
csharp_space_around_binary_operators = before_and_after
108+
csharp_style_prefer_primary_constructors = true:suggestion
109+
csharp_style_inlined_variable_declaration = true:suggestion
110+
csharp_style_deconstructed_variable_declaration = true:suggestion
111+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
112+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
113+
csharp_prefer_static_local_function = true:suggestion
114+
csharp_style_prefer_readonly_struct = true:suggestion

.gitattributes

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,23 @@
4949
*.dbproj text=auto
5050
*.sln text=auto eol=crlf
5151

52+
# Some more extensions required for git under Linux
53+
.editorconfig text=auto
54+
.gitattributes text=auto
55+
.gitignore text=auto
56+
LICENSE text=auto
57+
*.config text=auto
58+
*.DotSettings text=auto
59+
*.json text=auto
60+
*.md text=auto
61+
*.nuspec text=auto
62+
*.props text=auto
63+
*.ps1 text=auto
64+
*.restext text=auto
65+
*.settings text=auto
66+
*.txt text=auto
67+
*.xaml text=auto
68+
*.yaml text=auto
69+
*.yml text=auto
70+
5271
*.sh eol=lf

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2001-2023 empira Software GmbH, Cologne Area, Germany
1+
Copyright (c) 2001-2024 empira Software GmbH, Troisdorf (Cologne Area), Germany
22

33
http://docs.pdfsharp.net
44

PdfSharp.sln

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{18632E7D-54DF-4933-A8DF-A7ECE8666E9B}"
77
ProjectSection(SolutionItems) = preProject
88
src\Directory.Build.props = src\Directory.Build.props
9+
src\Directory.Build.targets = src\Directory.Build.targets
910
src\Directory.Packages.props = src\Directory.Packages.props
1011
src\dotnet-test.Build.props = src\dotnet-test.Build.props
1112
EndProjectSection
@@ -40,6 +41,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{18E75E2F-2
4041
ProjectSection(SolutionItems) = preProject
4142
src\foundation\src\PDFsharp\docs\AboutFonts.md = src\foundation\src\PDFsharp\docs\AboutFonts.md
4243
src\foundation\src\PDFsharp\docs\AboutImages.md = src\foundation\src\PDFsharp\docs\AboutImages.md
44+
src\foundation\src\PDFsharp\docs\GlobalStuff.md = src\foundation\src\PDFsharp\docs\GlobalStuff.md
4345
src\foundation\src\PDFsharp\docs\Notebook.md = src\foundation\src\PDFsharp\docs\Notebook.md
4446
src\foundation\src\PDFsharp\docs\PortingNotes.md = src\foundation\src\PDFsharp\docs\PortingNotes.md
4547
EndProjectSection
@@ -207,6 +209,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PDFsharp.Features.Runner-gd
207209
EndProject
208210
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PDFsharp.Features.Runner-wpf", "src\foundation\src\PDFsharp\features\PDFsharp.Features.Runner-wpf\PDFsharp.Features.Runner-wpf.csproj", "{D0CD20C3-C06B-436E-8C88-E5A608C74AB2}"
209211
EndProject
212+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.Tests-gdi", "src\foundation\src\PDFsharp\tests\PdfSharp.Tests-gdi\PdfSharp.Tests-gdi.csproj", "{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2}"
213+
EndProject
214+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.tests-wpf", "src\foundation\src\PDFsharp\tests\PdfSharp.tests-wpf\PdfSharp.tests-wpf.csproj", "{AE89ED51-5A8A-4663-ABBE-2D399C8528F4}"
215+
EndProject
216+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{E00A1E03-7FB3-4A26-BB33-9BE7AA42CFB7}"
217+
ProjectSection(SolutionItems) = preProject
218+
src\foundation\src\shared\docs\Notebook.md = src\foundation\src\shared\docs\Notebook.md
219+
EndProjectSection
220+
EndProject
221+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfFileViewer", "src\tools\src\PdfFileViewer\PdfFileViewer.csproj", "{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}"
222+
EndProject
223+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.TestHelper-gdi", "src\tools\src\PdfSharp.TestHelper-gdi\PdfSharp.TestHelper-gdi.csproj", "{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}"
224+
EndProject
225+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.TestHelper-wpf", "src\tools\src\PdfSharp.TestHelper-wpf\PdfSharp.TestHelper-wpf.csproj", "{284F0281-F283-4EC3-BD60-DD0CD5A5442F}"
226+
EndProject
210227
Global
211228
GlobalSection(SolutionConfigurationPlatforms) = preSolution
212229
Debug|Any CPU = Debug|Any CPU
@@ -429,6 +446,26 @@ Global
429446
{D0CD20C3-C06B-436E-8C88-E5A608C74AB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
430447
{D0CD20C3-C06B-436E-8C88-E5A608C74AB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
431448
{D0CD20C3-C06B-436E-8C88-E5A608C74AB2}.Release|Any CPU.Build.0 = Release|Any CPU
449+
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
450+
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
451+
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
452+
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2}.Release|Any CPU.Build.0 = Release|Any CPU
453+
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
454+
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
455+
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
456+
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4}.Release|Any CPU.Build.0 = Release|Any CPU
457+
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
458+
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}.Debug|Any CPU.Build.0 = Debug|Any CPU
459+
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}.Release|Any CPU.ActiveCfg = Release|Any CPU
460+
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}.Release|Any CPU.Build.0 = Release|Any CPU
461+
{284F0281-F283-4EC3-BD60-DD0CD5A5442F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
462+
{284F0281-F283-4EC3-BD60-DD0CD5A5442F}.Debug|Any CPU.Build.0 = Debug|Any CPU
463+
{284F0281-F283-4EC3-BD60-DD0CD5A5442F}.Release|Any CPU.ActiveCfg = Release|Any CPU
464+
{284F0281-F283-4EC3-BD60-DD0CD5A5442F}.Release|Any CPU.Build.0 = Release|Any CPU
465+
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
466+
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
467+
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
468+
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}.Release|Any CPU.Build.0 = Release|Any CPU
432469
EndGlobalSection
433470
GlobalSection(SolutionProperties) = preSolution
434471
HideSolutionNode = FALSE
@@ -515,6 +552,12 @@ Global
515552
{BA04FBE0-6B97-4D21-9561-91F12906A5F9} = {F6F7E411-5CD0-4507-BF59-70004EDD09DA}
516553
{380C02B5-94DC-491C-9458-6F5287698C77} = {F6F7E411-5CD0-4507-BF59-70004EDD09DA}
517554
{D0CD20C3-C06B-436E-8C88-E5A608C74AB2} = {F6F7E411-5CD0-4507-BF59-70004EDD09DA}
555+
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2} = {71BD4587-A8B0-4653-A3B2-93578F71ABB7}
556+
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4} = {71BD4587-A8B0-4653-A3B2-93578F71ABB7}
557+
{E00A1E03-7FB3-4A26-BB33-9BE7AA42CFB7} = {A484FFA0-1C54-4C5C-B46D-6AB5C05AC5AB}
558+
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC} = {CC13B431-6963-480F-8C21-1F78A220A399}
559+
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49} = {CC13B431-6963-480F-8C21-1F78A220A399}
560+
{284F0281-F283-4EC3-BD60-DD0CD5A5442F} = {CC13B431-6963-480F-8C21-1F78A220A399}
518561
EndGlobalSection
519562
GlobalSection(ExtensibilityGlobals) = postSolution
520563
SolutionGuid = {D5FF5562-3C79-434B-B951-B84542D01625}

PdfSharp.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AESV/@EntryIndexedValue">AESV</s:String>
44
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AL/@EntryIndexedValue">AL</s:String>
55
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CF/@EntryIndexedValue">CF</s:String>
6+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IO/@EntryIndexedValue">IO</s:String>
67
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IV/@EntryIndexedValue">IV</s:String>
78
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SASL/@EntryIndexedValue">SASL</s:String>
89
<s:Boolean x:Key="/Default/UserDictionary/Words/=AESV/@EntryIndexedValue">True</s:Boolean>
@@ -19,6 +20,7 @@
1920
<s:Boolean x:Key="/Default/UserDictionary/Words/=Encryptions/@EntryIndexedValue">True</s:Boolean>
2021
<s:Boolean x:Key="/Default/UserDictionary/Words/=encryptor/@EntryIndexedValue">True</s:Boolean>
2122
<s:Boolean x:Key="/Default/UserDictionary/Words/=Endian/@EntryIndexedValue">True</s:Boolean>
23+
<s:Boolean x:Key="/Default/UserDictionary/Words/=endianness/@EntryIndexedValue">True</s:Boolean>
2224
<s:Boolean x:Key="/Default/UserDictionary/Words/=Failsafe/@EntryIndexedValue">True</s:Boolean>
2325
<s:Boolean x:Key="/Default/UserDictionary/Words/=flate/@EntryIndexedValue">True</s:Boolean>
2426
<s:Boolean x:Key="/Default/UserDictionary/Words/=flavlor/@EntryIndexedValue">True</s:Boolean>

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# PDFsharp & MigraDoc 6.0
1+
# PDFsharp & MigraDoc 6
22

3-
Version **6.1.0-preview-1**
4-
Published **2023-12-21**
3+
Version **6.1.0-preview-2**
4+
Published **2024-03-21**
55

6-
This is a preview version of the **PDFsharp** project, the main project of PDFsharp & MigraDoc 6.0 with updates for C# 10 and .NET 6.0.
6+
This is a preview version of the **PDFsharp** project, the main project of PDFsharp & MigraDoc 6 with updates for C# 12 and .NET 6.
77

8-
PDFsharp: Copyright (c) 2005-2023 empira Software GmbH, Troisdorf (Cologne Area, Germany)
9-
MigraDoc: Copyright (c) 2001-2023 empira Software GmbH, Troisdorf (Cologne Area, Germany)
8+
PDFsharp: Copyright (c) 2005-2024 empira Software GmbH, Troisdorf (Cologne Area), Germany
9+
MigraDoc: Copyright (c) 2001-2024 empira Software GmbH, Troisdorf (Cologne Area), Germany
1010
Published Open Source under the [MIT License](https://docs.pdfsharp.net/LICENSE.html)
1111

1212
For more information see [docs.pdfsharp.net](https://docs.pdfsharp.net/)
@@ -15,15 +15,18 @@ For more information see [docs.pdfsharp.net](https://docs.pdfsharp.net/)
1515

1616
Project documentation can be found on our DOCS site: <https://docs.pdfsharp.net>.
1717

18-
Note: PowerShell 7 or higher is required to execute the PowerShell scripts that come with PDFsharp.
18+
Note: PowerShell 7 is required to execute the PowerShell scripts that come with PDFsharp.
1919

2020
### Download assets first
2121

2222
Assets like bitmaps, fonts, or PDF files are not part of the repository anymore.
2323
You must download them before compiling the solution for the first time.
2424
Use `download-assets.ps1` in the `dev` folder to create `assets` folder required for some unit tests and needed by some projects.
2525

26-
Execute `.\dev\download-assets.ps1`
26+
Execute
27+
```ps
28+
.\dev\download-assets.ps1
29+
```
2730

2831
### Build the solution
2932

dev/download-assets.ps1

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
# Downloads assets
1+
# Downloads assets.
2+
3+
# This file downloads assets required to compile the PDFsharp/MigraDoc source codes.
4+
# This file runs under PowerShell Core 7.0 or higher.
25

36
#Requires -Version 7
47
#Requires -PSEdition Core
58

69
# Get-ChildItem .\ -include bin,obj -Recurse | ForEach-Object ($_) { remove-item $_.fullname -Force -Recurse }
710

11+
# Part 1: Download assets from assets.pdfsharp.net
12+
813
[string[]]$assetList = @(
914
"pdfsharp/pdfsharp.zip"
1015
"migradoc/migradoc.zip"
@@ -22,22 +27,55 @@ if (test-path -PathType container $destination) {
2227
}
2328
New-Item -ItemType Directory -Path $destination
2429

30+
# Download assets version.
31+
$url = $source + ".assets-version"
32+
$dest = $destination + ".assets-version"
33+
Invoke-WebRequest $url -OutFile $dest
34+
35+
# Download assets files.
2536
foreach ($asset in $assetList) {
2637
$url = $source + $asset
2738
$dest = $destination + $asset
2839

2940
$folder = [IO.Path]::GetDirectoryName($dest)
3041
New-Item -ItemType Directory -Path $folder -Force
3142

32-
$x = Invoke-WebRequest $url -OutFile $dest
43+
Invoke-WebRequest $url -OutFile $dest
3344

3445
$idx = $asset.LastIndexOf("/")
3546
$assetFolder = $asset.Substring(0, $idx)
36-
$zip = $asset.Substring($idx + 1)
3747
Expand-Archive "$destination/$asset" -DestinationPath "$destination/$assetFolder" -Force
38-
if ($LASTEXITCODE -eq 0) {
39-
Remove-Item "$destination/$asset"
40-
# Not all ZIP files contain compress.ps1. Suppress error messages.
41-
Remove-Item "$destination/$assetFolder/compress.ps1" -ErrorAction Ignore
42-
}
48+
49+
Remove-Item "$destination/$asset"
50+
# Not all ZIP files contain compress.ps1. Suppress error messages.
51+
Remove-Item "$destination/$assetFolder/compress.ps1" -ErrorAction Ignore
4352
}
53+
54+
# Part 2: Download fonts
55+
56+
$source = "https://fonts.google.com/"
57+
$destination = "$PSScriptRoot/../assets/fonts/Noto/Noto_Sans/static/"
58+
59+
New-Item -ItemType Directory -Path $destination
60+
New-Item -ItemType Directory -Path "$destination/temp/"
61+
62+
$url = $source + "download?family=Noto%20Sans"
63+
$dest = $destination
64+
65+
Invoke-WebRequest $url -OutFile "$dest/temp/noto_sans_temp.zip"
66+
Expand-Archive "$destination/temp/noto_sans_temp.zip" -DestinationPath "$destination/temp/" -Force
67+
68+
# Successfully extracted. Now move the fonts files.
69+
[string[]]$folderList = @(
70+
"NotoSans"
71+
"NotoSans_Condensed"
72+
"NotoSans_ExtraCondensed"
73+
"NotoSans_SemiCondensed"
74+
)
75+
76+
foreach ($folder in $folderList) {
77+
Copy-Item -Path "$destination/temp/static/$folder/*" -Include "*.ttf" -Destination $dest
78+
}
79+
80+
# Remove the folder.
81+
Remove-Item "$destination/temp" -Recurse

0 commit comments

Comments
 (0)