Skip to content

Commit 406fbdb

Browse files
committed
exclude pdfium binaries from the project, cleanup
1 parent ebc1b0b commit 406fbdb

File tree

7 files changed

+32
-36
lines changed

7 files changed

+32
-36
lines changed

PdfFileType.ThirdPartyNotices.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Please see below for details.
44

55
1. PDFium (https://pdfium.googlesource.com/)
66
2. PDFiumSharp (https://github.com/otuncelli/PDFiumSharp)
7-
3. UglyToad/PdfPig (https://github.com/otuncelli/PdfPig)
7+
3. UglyToad/PdfPig (https://github.com/UglyToad/PdfPig)
88

99

1010
%% PDFium NOTICES AND INFORMATION BEGIN HERE

PdfFileType/Export/ExportMode.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2022 Osman Tunçelli. All rights reserved.
2+
// Use of this source code is governed by GNU General Public License (GPL-2.0) that can be found in the COPYING file.
3+
4+
namespace PdfFileTypePlugin.Export
5+
{
6+
internal enum ExportMode
7+
{
8+
Normal,
9+
Cropped,
10+
Cumulative,
11+
Flattened
12+
}
13+
}

PdfFileType/Export/PdfExporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected PdfExporter(Document input, Stream output, PropertyBasedSaveConfigToke
4444
Ensure.IsNotNull(token, nameof(token));
4545
Ensure.IsNotNull(scratchSurface, nameof(scratchSurface));
4646
Ensure.IsNotNull(progressCallback, nameof(progressCallback));
47-
Ensure.Test(() => input.Width * 4 * input.Height, "Canvas is too big.");
47+
Ensure.Test(() => checked(input.Width * 4 * input.Height), "Canvas is too big.");
4848
Ensure.IsTrue(input.Layers.Count > 0, () => throw new ArgumentException("Document does not contain layers."));
4949

5050
scratchSurface.Clear();

PdfFileType/Export/PdfStandard.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2022 Osman Tunçelli. All rights reserved.
2+
// Use of this source code is governed by GNU General Public License (GPL-2.0) that can be found in the COPYING file.
3+
4+
using UglyToad.PdfPig.Writer;
5+
6+
namespace PdfFileTypePlugin.Export
7+
{
8+
internal enum PdfStandard
9+
{
10+
None = PdfAStandard.None,
11+
A1B = PdfAStandard.A1B,
12+
A2B = PdfAStandard.A2B
13+
}
14+
}

PdfFileType/Export/Enums.cs renamed to PdfFileType/Export/PropertyNames.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
11
// Copyright 2022 Osman Tunçelli. All rights reserved.
22
// Use of this source code is governed by GNU General Public License (GPL-2.0) that can be found in the COPYING file.
33

4-
using UglyToad.PdfPig.Writer;
5-
64
namespace PdfFileTypePlugin.Export
75
{
8-
internal enum ExportMode
9-
{
10-
Normal,
11-
Cropped,
12-
Cumulative,
13-
Flattened
14-
}
15-
16-
internal enum PdfStandard
17-
{
18-
None = PdfAStandard.None,
19-
A1B = PdfAStandard.A1B,
20-
A2B = PdfAStandard.A2B
21-
}
22-
236
internal enum PropertyNames
247
{
258
Quality,

PdfFileType/FodyWeavers.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
2-
<ILMerge NamespacePrefix="" IncludeResources="\.icc$" IncludeAssemblies="PDFiumSharp|UglyToad.PdfPig.*" FullImport="false" />
2+
<ILMerge NamespacePrefix="" IncludeResources="\.icc$" IncludeAssemblies="PDFiumSharp|UglyToad.PdfPig.*" FullImport="false" CompactMode="true" />
33
</Weavers>

PdfFileType/PdfFileType.csproj

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
56
<DefineConstants>FILETYPE;DONTCHECKUPDATES</DefineConstants>
67
<NoWarn>FodyPackageReference;MSB3277</NoWarn>
78
<OutputType>Library</OutputType>
@@ -72,21 +73,6 @@
7273
</Reference>
7374
</ItemGroup>
7475

75-
<ItemGroup>
76-
<None Include="runtimes\pdfium_ARM64.dll">
77-
<Link>pdfium_ARM64.dll</Link>
78-
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
79-
</None>
80-
<None Include="runtimes\pdfium_x64.dll">
81-
<Link>pdfium_x64.dll</Link>
82-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
83-
</None>
84-
<None Include="runtimes\pdfium_x86.dll">
85-
<Link>pdfium_x86.dll</Link>
86-
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
87-
</None>
88-
</ItemGroup>
89-
9076
<ItemGroup>
9177
<ProjectReference Include="..\PDFiumSharp\PDFiumSharp\PDFiumSharp.csproj" />
9278
</ItemGroup>
@@ -130,7 +116,7 @@
130116
<Exec Command="if not exist &quot;$(PluginDir)&quot; mkdir &quot;$(PluginDir)&quot;" />
131117
<Exec Command="copy &quot;$(TargetPath)&quot; &quot;$(PluginDir)&quot; /y" />
132118
<Exec Command="copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(PluginDir)&quot; /y" Condition="'$(ConfigurationName)' == 'Debug'" />
133-
<Exec Command="copy &quot;$(ProjectDir)\runtimes\pdfium_x64.dll&quot; &quot;$(PluginDir)&quot; /y" />
119+
<Exec Command="copy &quot;$(TargetDir)\runtimes\win-x64\native\pdfium.dll&quot; &quot;$(PluginDir)\pdfium_x64.dll&quot; /y" />
134120
</Target>
135121

136122
<Target Name="OuterPreBuild" BeforeTargets="DispatchToInnerBuilds">

0 commit comments

Comments
 (0)