Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PDFsharp-Team committed Mar 21, 2024
1 parent b28bc32 commit 3fb4e9e
Show file tree
Hide file tree
Showing 403 changed files with 14,991 additions and 8,194 deletions.
16 changes: 15 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[*.{cs,vb}]

# 2024-02-23: I noticed that Visual studio started to think my source code is written in German 😲
spelling_languages = en-us

# IDE0049: Simplify Names
dotnet_style_predefined_type_for_locals_parameters_members = false:silent

Expand Down Expand Up @@ -72,6 +75,9 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
dotnet_style_readonly_field = true:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent

[*.cs]
csharp_indent_labels = one_less_than_current
Expand All @@ -97,4 +103,12 @@ csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_space_around_binary_operators = before_and_after
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_prefer_static_local_function = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
19 changes: 19 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,23 @@
*.dbproj text=auto
*.sln text=auto eol=crlf

# Some more extensions required for git under Linux
.editorconfig text=auto
.gitattributes text=auto
.gitignore text=auto
LICENSE text=auto
*.config text=auto
*.DotSettings text=auto
*.json text=auto
*.md text=auto
*.nuspec text=auto
*.props text=auto
*.ps1 text=auto
*.restext text=auto
*.settings text=auto
*.txt text=auto
*.xaml text=auto
*.yaml text=auto
*.yml text=auto

*.sh eol=lf
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2001-2023 empira Software GmbH, Cologne Area, Germany
Copyright (c) 2001-2024 empira Software GmbH, Troisdorf (Cologne Area), Germany

http://docs.pdfsharp.net

Expand Down
43 changes: 43 additions & 0 deletions PdfSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{18632E7D-54DF-4933-A8DF-A7ECE8666E9B}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Build.targets = src\Directory.Build.targets
src\Directory.Packages.props = src\Directory.Packages.props
src\dotnet-test.Build.props = src\dotnet-test.Build.props
EndProjectSection
Expand Down Expand Up @@ -40,6 +41,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{18E75E2F-2
ProjectSection(SolutionItems) = preProject
src\foundation\src\PDFsharp\docs\AboutFonts.md = src\foundation\src\PDFsharp\docs\AboutFonts.md
src\foundation\src\PDFsharp\docs\AboutImages.md = src\foundation\src\PDFsharp\docs\AboutImages.md
src\foundation\src\PDFsharp\docs\GlobalStuff.md = src\foundation\src\PDFsharp\docs\GlobalStuff.md
src\foundation\src\PDFsharp\docs\Notebook.md = src\foundation\src\PDFsharp\docs\Notebook.md
src\foundation\src\PDFsharp\docs\PortingNotes.md = src\foundation\src\PDFsharp\docs\PortingNotes.md
EndProjectSection
Expand Down Expand Up @@ -207,6 +209,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PDFsharp.Features.Runner-gd
EndProject
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}"
EndProject
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}"
EndProject
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}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{E00A1E03-7FB3-4A26-BB33-9BE7AA42CFB7}"
ProjectSection(SolutionItems) = preProject
src\foundation\src\shared\docs\Notebook.md = src\foundation\src\shared\docs\Notebook.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfFileViewer", "src\tools\src\PdfFileViewer\PdfFileViewer.csproj", "{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.TestHelper-gdi", "src\tools\src\PdfSharp.TestHelper-gdi\PdfSharp.TestHelper-gdi.csproj", "{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.TestHelper-wpf", "src\tools\src\PdfSharp.TestHelper-wpf\PdfSharp.TestHelper-wpf.csproj", "{284F0281-F283-4EC3-BD60-DD0CD5A5442F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -429,6 +446,26 @@ Global
{D0CD20C3-C06B-436E-8C88-E5A608C74AB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0CD20C3-C06B-436E-8C88-E5A608C74AB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0CD20C3-C06B-436E-8C88-E5A608C74AB2}.Release|Any CPU.Build.0 = Release|Any CPU
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2}.Release|Any CPU.Build.0 = Release|Any CPU
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4}.Release|Any CPU.Build.0 = Release|Any CPU
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49}.Release|Any CPU.Build.0 = Release|Any CPU
{284F0281-F283-4EC3-BD60-DD0CD5A5442F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{284F0281-F283-4EC3-BD60-DD0CD5A5442F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{284F0281-F283-4EC3-BD60-DD0CD5A5442F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{284F0281-F283-4EC3-BD60-DD0CD5A5442F}.Release|Any CPU.Build.0 = Release|Any CPU
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -515,6 +552,12 @@ Global
{BA04FBE0-6B97-4D21-9561-91F12906A5F9} = {F6F7E411-5CD0-4507-BF59-70004EDD09DA}
{380C02B5-94DC-491C-9458-6F5287698C77} = {F6F7E411-5CD0-4507-BF59-70004EDD09DA}
{D0CD20C3-C06B-436E-8C88-E5A608C74AB2} = {F6F7E411-5CD0-4507-BF59-70004EDD09DA}
{32402A03-34B2-4DA8-8A55-A4E0FCA4C3B2} = {71BD4587-A8B0-4653-A3B2-93578F71ABB7}
{AE89ED51-5A8A-4663-ABBE-2D399C8528F4} = {71BD4587-A8B0-4653-A3B2-93578F71ABB7}
{E00A1E03-7FB3-4A26-BB33-9BE7AA42CFB7} = {A484FFA0-1C54-4C5C-B46D-6AB5C05AC5AB}
{6B5BAD8B-F029-452D-A721-0CF5F95DA1DC} = {CC13B431-6963-480F-8C21-1F78A220A399}
{6E63D5DF-CADA-4AD5-8824-F1FB97185A49} = {CC13B431-6963-480F-8C21-1F78A220A399}
{284F0281-F283-4EC3-BD60-DD0CD5A5442F} = {CC13B431-6963-480F-8C21-1F78A220A399}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D5FF5562-3C79-434B-B951-B84542D01625}
Expand Down
2 changes: 2 additions & 0 deletions PdfSharp.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AESV/@EntryIndexedValue">AESV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AL/@EntryIndexedValue">AL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CF/@EntryIndexedValue">CF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IO/@EntryIndexedValue">IO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IV/@EntryIndexedValue">IV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SASL/@EntryIndexedValue">SASL</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=AESV/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -19,6 +20,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Encryptions/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=encryptor/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Endian/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=endianness/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Failsafe/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=flate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=flavlor/@EntryIndexedValue">True</s:Boolean>
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# PDFsharp & MigraDoc 6.0
# PDFsharp & MigraDoc 6

Version **6.1.0-preview-1**
Published **2023-12-21**
Version **6.1.0-preview-2**
Published **2024-03-21**

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.
This is a preview version of the **PDFsharp** project, the main project of PDFsharp & MigraDoc 6 with updates for C# 12 and .NET 6.

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

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

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

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

### Download assets first

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

Execute `.\dev\download-assets.ps1`
Execute
```ps
.\dev\download-assets.ps1
```

### Build the solution

Expand Down
54 changes: 46 additions & 8 deletions dev/download-assets.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Downloads assets
# Downloads assets.

# This file downloads assets required to compile the PDFsharp/MigraDoc source codes.
# This file runs under PowerShell Core 7.0 or higher.

#Requires -Version 7
#Requires -PSEdition Core

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

# Part 1: Download assets from assets.pdfsharp.net

[string[]]$assetList = @(
"pdfsharp/pdfsharp.zip"
"migradoc/migradoc.zip"
Expand All @@ -22,22 +27,55 @@ if (test-path -PathType container $destination) {
}
New-Item -ItemType Directory -Path $destination

# Download assets version.
$url = $source + ".assets-version"
$dest = $destination + ".assets-version"
Invoke-WebRequest $url -OutFile $dest

# Download assets files.
foreach ($asset in $assetList) {
$url = $source + $asset
$dest = $destination + $asset

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

$x = Invoke-WebRequest $url -OutFile $dest
Invoke-WebRequest $url -OutFile $dest

$idx = $asset.LastIndexOf("/")
$assetFolder = $asset.Substring(0, $idx)
$zip = $asset.Substring($idx + 1)
Expand-Archive "$destination/$asset" -DestinationPath "$destination/$assetFolder" -Force
if ($LASTEXITCODE -eq 0) {
Remove-Item "$destination/$asset"
# Not all ZIP files contain compress.ps1. Suppress error messages.
Remove-Item "$destination/$assetFolder/compress.ps1" -ErrorAction Ignore
}

Remove-Item "$destination/$asset"
# Not all ZIP files contain compress.ps1. Suppress error messages.
Remove-Item "$destination/$assetFolder/compress.ps1" -ErrorAction Ignore
}

# Part 2: Download fonts

$source = "https://fonts.google.com/"
$destination = "$PSScriptRoot/../assets/fonts/Noto/Noto_Sans/static/"

New-Item -ItemType Directory -Path $destination
New-Item -ItemType Directory -Path "$destination/temp/"

$url = $source + "download?family=Noto%20Sans"
$dest = $destination

Invoke-WebRequest $url -OutFile "$dest/temp/noto_sans_temp.zip"
Expand-Archive "$destination/temp/noto_sans_temp.zip" -DestinationPath "$destination/temp/" -Force

# Successfully extracted. Now move the fonts files.
[string[]]$folderList = @(
"NotoSans"
"NotoSans_Condensed"
"NotoSans_ExtraCondensed"
"NotoSans_SemiCondensed"
)

foreach ($folder in $folderList) {
Copy-Item -Path "$destination/temp/static/$folder/*" -Include "*.ttf" -Destination $dest
}

# Remove the folder.
Remove-Item "$destination/temp" -Recurse
Loading

0 comments on commit 3fb4e9e

Please sign in to comment.