Skip to content

Commit 05b09d9

Browse files
committed
upgrade to dot net 8
1 parent d34be3f commit 05b09d9

File tree

5 files changed

+35
-118
lines changed

5 files changed

+35
-118
lines changed

CS/pdf-custom-properties/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static void Main(string[] args)
1717
pdfProcessor.LoadDocument("PageDeletion.pdf");
1818
ModifyCustomProperties(pdfProcessor.Document);
1919
pdfProcessor.SaveDocument("Result.pdf");
20-
Process.Start("Result.pdf");
20+
Process.Start(new ProcessStartInfo("Result.pdf") { UseShellExecute = true });
2121
}
2222
}
2323

Original file line numberDiff line numberDiff line change
@@ -1,60 +1,19 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{93D0267B-1E70-4E92-AB61-038A27DBB767}</ProjectGuid>
3+
<TargetFramework>net8.0</TargetFramework>
84
<OutputType>Exe</OutputType>
95
<RootNamespace>pdf_custom_properties</RootNamespace>
10-
<AssemblyName>pdf-custom-properties</AssemblyName>
11-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12-
<FileAlignment>512</FileAlignment>
13-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14-
<Deterministic>true</Deterministic>
6+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
157
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<PlatformTarget>AnyCPU</PlatformTarget>
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<PlatformTarget>AnyCPU</PlatformTarget>
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
</PropertyGroup>
35-
<ItemGroup>
36-
<Reference Include="DevExpress.Data.v19.2, Version=19.2.15.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
37-
<Reference Include="DevExpress.Docs.v19.2, Version=19.2.15.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
38-
<Reference Include="DevExpress.Pdf.v19.2.Core, Version=19.2.15.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
39-
<Reference Include="DevExpress.Pdf.v19.2.Drawing, Version=19.2.15.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
40-
<Reference Include="System" />
41-
<Reference Include="System.Core" />
42-
<Reference Include="System.Xml.Linq" />
43-
<Reference Include="System.Data.DataSetExtensions" />
44-
<Reference Include="Microsoft.CSharp" />
45-
<Reference Include="System.Data" />
46-
<Reference Include="System.Net.Http" />
47-
<Reference Include="System.Xml" />
48-
</ItemGroup>
498
<ItemGroup>
50-
<Compile Include="Program.cs" />
51-
<Compile Include="Properties\AssemblyInfo.cs" />
52-
</ItemGroup>
53-
<ItemGroup>
54-
<None Include="App.config" />
55-
<None Include="PageDeletion.pdf">
9+
<None Update="PageDeletion.pdf">
5610
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5711
</None>
5812
</ItemGroup>
59-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
60-
</Project>
13+
<ItemGroup>
14+
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
15+
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
16+
<PackageReference Include="DevExpress.Document.Processor" Version="24.2.5" />
17+
<PackageReference Include="DevExpress.Drawing.Skia" Version="24.2.5" />
18+
</ItemGroup>
19+
</Project>

README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66
<!-- default badges end -->
77
# PDF Document API - Access and Modify Custom Document Properties
88

9-
The code sample below shows how to use the **PdfDocument.CustomProperties** property to access the collection of document's custom properties. You can add and delete custom properties or change associated names or values.
9+
This sample project uses the [PdfDocument.CustomProperties](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Pdf.PdfDocument.CustomProperties) property to obtain the collection of document's custom properties. You can add and delete custom properties or change associated names or values.
10+
11+
> [!Important]
12+
> The Universal Subscription or an additional Office File API Subscription is required to use this example in production code. For pricing information, please refer to the [DevExpress Subscription](https://www.devexpress.com/Subscriptions/) page.
13+
14+
## Files to Review
15+
16+
| C# | Visual Basic |
17+
|---|---|
18+
| [Program.cs](./CS/pdf-custom-properties/Program.cs) | [Program.vb](./VB/pdf-custom-properties/Program.vb) |
19+
1020
<!-- feedback -->
1121
## Does this example address your development requirements/objectives?
1222

VB/pdf-custom-properties/Program.vb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Namespace pdf_custom_properties
1313
pdfProcessor.LoadDocument("PageDeletion.pdf")
1414
ModifyCustomProperties(pdfProcessor.Document)
1515
pdfProcessor.SaveDocument("Result.pdf")
16-
Process.Start("Result.pdf")
16+
Process.Start(New ProcessStartInfo("Result.pdf") With {.UseShellExecute = True})
1717
End Using
1818
End Sub
1919

Original file line numberDiff line numberDiff line change
@@ -1,74 +1,22 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{93D0267B-1E70-4E92-AB61-038A27DBB767}</ProjectGuid>
3+
<TargetFramework>net8.0</TargetFramework>
84
<OutputType>Exe</OutputType>
95
<RootNamespace></RootNamespace>
10-
<AssemblyName>pdf-custom-properties</AssemblyName>
11-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12-
<FileAlignment>512</FileAlignment>
13-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14-
<Deterministic>true</Deterministic>
15-
<OptionExplicit>On</OptionExplicit>
16-
<OptionCompare>Binary</OptionCompare>
17-
<OptionStrict>Off</OptionStrict>
18-
<OptionInfer>On</OptionInfer>
19-
</PropertyGroup>
20-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21-
<PlatformTarget>AnyCPU</PlatformTarget>
22-
<DebugSymbols>true</DebugSymbols>
23-
<DebugType>full</DebugType>
24-
<Optimize>false</Optimize>
25-
<OutputPath>bin\Debug\</OutputPath>
26-
<DefineDebug>true</DefineDebug>
27-
<DefineTrace>true</DefineTrace>
28-
<ErrorReport>prompt</ErrorReport>
6+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
297
</PropertyGroup>
308
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
31-
<PlatformTarget>AnyCPU</PlatformTarget>
32-
<DebugType>pdbonly</DebugType>
33-
<Optimize>true</Optimize>
34-
<OutputPath>bin\Release\</OutputPath>
359
<DefineDebug>false</DefineDebug>
36-
<DefineTrace>true</DefineTrace>
37-
<ErrorReport>prompt</ErrorReport>
3810
</PropertyGroup>
3911
<ItemGroup>
40-
<Reference Include="DevExpress.Data.v19.2, Version=19.2.15.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
41-
<Reference Include="DevExpress.Docs.v19.2, Version=19.2.15.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
42-
<Reference Include="DevExpress.Pdf.v19.2.Core, Version=19.2.15.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
43-
<Reference Include="DevExpress.Pdf.v19.2.Drawing, Version=19.2.15.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
44-
<Reference Include="System" />
45-
<Reference Include="System.Core" />
46-
<Reference Include="System.Xml.Linq" />
47-
<Reference Include="System.Data.DataSetExtensions" />
48-
<Reference Include="Microsoft.CSharp" />
49-
<Reference Include="System.Data" />
50-
<Reference Include="System.Net.Http" />
51-
<Reference Include="System.Xml" />
52-
</ItemGroup>
53-
<ItemGroup>
54-
<Import Include="Microsoft.VisualBasic" />
55-
<Import Include="System.Collections.Generic" />
56-
<Import Include="System.Collections" />
57-
<Import Include="System.Diagnostics" />
58-
<Import Include="System.Linq" />
59-
<Import Include="System.Xml.Linq" />
60-
<Import Include="System.Data" />
61-
<Import Include="System" />
62-
</ItemGroup>
63-
<ItemGroup>
64-
<Compile Include="Program.vb" />
65-
<Compile Include="My Project\AssemblyInfo.vb" />
66-
</ItemGroup>
67-
<ItemGroup>
68-
<None Include="App.config" />
69-
<None Include="PageDeletion.pdf">
12+
<None Update="PageDeletion.pdf">
7013
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7114
</None>
7215
</ItemGroup>
73-
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
74-
</Project>
16+
<ItemGroup>
17+
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
18+
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
19+
<PackageReference Include="DevExpress.Document.Processor" Version="24.2.5" />
20+
<PackageReference Include="DevExpress.Drawing.Skia" Version="24.2.5" />
21+
</ItemGroup>
22+
</Project>

0 commit comments

Comments
 (0)