Skip to content

Updated WinForms-PDFViewer-Examples #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Bookmarks Navigation/PDFBookmarks/PDFBookmarks/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
4 changes: 4 additions & 0 deletions Bookmarks Navigation/PDFBookmarks/PDFBookmarks/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ public Form1()
pdfViewer.DocumentLoaded += PdfViewer_DocumentLoaded;

// load the PDF.
#if NETCOREAPP
pdfViewer.Load("../../../Data/C_Sharp_Succinctly.pdf");
#else
pdfViewer.Load("../../Data/C_Sharp_Succinctly.pdf");
#endif
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SampleWF</RootNamespace>
<AssemblyName>SampleWF</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
Expand Down Expand Up @@ -88,7 +88,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Syncfusion.PdfViewer.Windows">
<Version>19.3.0.44</Version>
<Version>*</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWindowsForms>True</UseWindowsForms>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.PdfViewer.Windows" Version="*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup>
<Compile Update="Form1.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.226.21692
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFBookmarks_NET", "PDFBookmarks_NET.csproj", "{E79D712B-0966-4E56-989F-B6A78BE3A022}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E79D712B-0966-4E56-989F-B6A78BE3A022}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E79D712B-0966-4E56-989F-B6A78BE3A022}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E79D712B-0966-4E56-989F-B6A78BE3A022}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E79D712B-0966-4E56-989F-B6A78BE3A022}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66FBE309-FC8F-4FE0-A34F-85576BA23799}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SampleWF")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SampleWF")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand All @@ -30,7 +26,4 @@
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
// by using the '*' as shown below:
6 changes: 3 additions & 3 deletions FindText/FindText_Regex/FindText_Regex/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
</configuration>
15 changes: 5 additions & 10 deletions FindText/FindText_Regex/FindText_Regex/FindText_Regex.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FindText_Regex</RootNamespace>
<AssemblyName>FindText_Regex</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -33,15 +34,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Syncfusion.Compression.Base, Version=23.1460.36.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Compression.Base.23.1.36\lib\net46\Syncfusion.Compression.Base.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Licensing, Version=23.1460.36.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Licensing.23.1.36\lib\net46\Syncfusion.Licensing.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Pdf.Base, Version=23.1460.36.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Syncfusion.Pdf.WinForms.23.1.36\lib\net46\Syncfusion.Pdf.Base.dll</HintPath>
</Reference>
<packageReference Include="Syncfusion.Compression.Base" version="*" />
<packageReference Include="Syncfusion.Licensing" version="*" />
<packageReference Include="Syncfusion.Pdf.Base" version="*" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand Down
16 changes: 16 additions & 0 deletions FindText/FindText_Regex/FindText_Regex/FindText_Regex_NET.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>False</UseWPF>
<UseWindowsForms>True</UseWindowsForms>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup>
<Compile Update="Form1.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
</Project>
25 changes: 25 additions & 0 deletions FindText/FindText_Regex/FindText_Regex/FindText_Regex_NET.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.226.21692
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FindText_Regex_NET", "FindText_Regex_NET.csproj", "{E79D712B-0966-4E56-989F-B6A78BE3A022}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E79D712B-0966-4E56-989F-B6A78BE3A022}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E79D712B-0966-4E56-989F-B6A78BE3A022}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E79D712B-0966-4E56-989F-B6A78BE3A022}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E79D712B-0966-4E56-989F-B6A78BE3A022}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66FBE309-FC8F-4FE0-A34F-85576BA23799}
EndGlobalSection
EndGlobal
8 changes: 5 additions & 3 deletions FindText/FindText_Regex/FindText_Regex/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ public partial class Form1 : Form
public Form1()
{
InitializeComponent();

PdfLoadedDocument loadedDocument = new PdfLoadedDocument(@"../../Data/Bank statement.pdf");

#if NETCOREAPP
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(@"../../../Data/Bank statement.pdf");
#else
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(@"../../Data/Bank statement.pdf");
#endif
// Extract text from the PDF file to get matched texts present in the file based on regex pattern.
string extractedText = string.Empty;
for (int i = 0; i < loadedDocument.Pages.Count; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FindText_Regex")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FindText_Regex")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand All @@ -31,6 +27,3 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions FindText/FindText_Regex/FindText_Regex/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Syncfusion.Compression.Base" version="23.1.36" targetFramework="net46" />
<package id="Syncfusion.Licensing" version="23.1.36" targetFramework="net46" />
<package id="Syncfusion.Pdf.WinForms" version="23.1.36" targetFramework="net46" />
<package id="Syncfusion.Pdf.WinForms" version="*" targetFramework="net48" />
</packages>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ public Form1()
InitializeComponent();

//Loads the PDF document in PDF Viewer
#if NETCOREAPP
pdfViewer.Load("../../../Data/HTTP Succinctly.pdf");
#else
pdfViewer.Load("../../Data/HTTP Succinctly.pdf");

#endif
//Gets the filename of loaded PDF document
string fileName = pdfViewer.DocumentInformation.FileName;

Expand Down
Loading
Loading