Skip to content

Commit 75619ac

Browse files
Merge pull request #160 from SyncfusionExamples/956834
956834 Updated GitHub sample and content from .NET 7 to .NET 8.0 in MAUI sample
2 parents aae7bab + 2f89c1e commit 75619ac

4 files changed

Lines changed: 98 additions & 5 deletions

File tree

Open and Save PDF document/.NET MAUI/Load_and_Save_PDF_MAUI/Load_and_Save_PDF_MAUI/Load_and_Save_PDF_MAUI.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7-
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
88
<OutputType>Exe</OutputType>
99
<RootNamespace>Load_and_Save_PDF_MAUI</RootNamespace>
1010
<UseMaui>true</UseMaui>
@@ -59,7 +59,7 @@
5959
</ItemGroup>
6060

6161
<ItemGroup>
62-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
62+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
6363
<PackageReference Include="Syncfusion.Pdf.NET" Version="*" />
6464
</ItemGroup>
6565

Open and Save PDF document/.NET MAUI/Load_and_Save_PDF_MAUI/Load_and_Save_PDF_MAUI/Load_and_Save_PDF_MAUI.csproj.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
5-
<ActiveDebugFramework>net7.0-windows10.0.19041.0</ActiveDebugFramework>
5+
<ActiveDebugFramework>net8.0-windows10.0.19041.0</ActiveDebugFramework>
66
<ActiveDebugProfile>Windows Machine</ActiveDebugProfile>
77
</PropertyGroup>
88
</Project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#region Copyright Syncfusion® Inc. 2001-2025.
2+
// Copyright Syncfusion® Inc. 2001-2025. All rights reserved.
3+
// Use of this code is subject to the terms of our license.
4+
// A copy of the current license can be obtained at any time by e-mailing
5+
// licensing@syncfusion.com. Any infringement will be prosecuted under
6+
// applicable laws.
7+
#endregion
8+
using QuickLook;
9+
10+
public class PreviewControllerDS : QLPreviewControllerDataSource
11+
{
12+
private readonly QLPreviewItem _item;
13+
14+
public PreviewControllerDS(QLPreviewItem item)
15+
{
16+
_item = item;
17+
}
18+
19+
public override nint PreviewItemCount(QLPreviewController controller)
20+
{
21+
return (nint)1;
22+
}
23+
24+
public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index)
25+
{
26+
return _item;
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#region Copyright Syncfusion® Inc. 2001-2025.
2+
// Copyright Syncfusion® Inc. 2001-2025. All rights reserved.
3+
// Use of this code is subject to the terms of our license.
4+
// A copy of the current license can be obtained at any time by e-mailing
5+
// licensing@syncfusion.com. Any infringement will be prosecuted under
6+
// applicable laws.
7+
#endregion
8+
using Foundation;
9+
using QuickLook;
10+
using System.IO;
11+
12+
public class QLPreviewItemFileSystem : QLPreviewItem
13+
{
14+
readonly string _fileName, _filePath;
15+
16+
public QLPreviewItemFileSystem(string fileName, string filePath)
17+
{
18+
_fileName = fileName;
19+
_filePath = filePath;
20+
}
21+
22+
public override string PreviewItemTitle
23+
{
24+
get
25+
{
26+
return _fileName;
27+
}
28+
}
29+
public override NSUrl PreviewItemUrl
30+
{
31+
get
32+
{
33+
return NSUrl.FromFilename(_filePath);
34+
}
35+
}
36+
}
37+
38+
public class QLPreviewItemBundle : QLPreviewItem
39+
{
40+
readonly string _fileName, _filePath;
41+
public QLPreviewItemBundle(string fileName, string filePath)
42+
{
43+
_fileName = fileName;
44+
_filePath = filePath;
45+
}
46+
47+
public override string PreviewItemTitle
48+
{
49+
get
50+
{
51+
return _fileName;
52+
}
53+
}
54+
public override NSUrl PreviewItemUrl
55+
{
56+
get
57+
{
58+
var documents = NSBundle.MainBundle.BundlePath;
59+
var lib = Path.Combine(documents, _filePath);
60+
var url = NSUrl.FromFilename(lib);
61+
return url;
62+
}
63+
}
64+
}
65+

0 commit comments

Comments
 (0)