Skip to content

Commit dde8ea9

Browse files
authored
Merge pull request #76 from SyncfusionExamples/890905
890910: Revamp the contents of RTL, Pdf to image and Localization in PdfViewer FT 890909: Revamp the contents of the Import/Export annotations and forms in PdfViewer FT
2 parents ff5e9bf + fea7045 commit dde8ea9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2051
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
5+
</startup>
6+
</configuration>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="Export_ImportFormFields.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:Export_ImportFormFields"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace Export_ImportFormFields
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>WinExe</OutputType>
4+
<RootNamespace>Export_ImportFormFields</RootNamespace>
5+
<AssemblyName>Export&amp;ImportFormFields</AssemblyName>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
9+
</ItemGroup>
10+
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
11+
<Reference Include="System" />
12+
<Reference Include="System.Data" />
13+
<Reference Include="System.Xml" />
14+
<Reference Include="Microsoft.CSharp" />
15+
<Reference Include="System.Core" />
16+
<Reference Include="System.Xml.Linq" />
17+
<Reference Include="System.Data.DataSetExtensions" />
18+
<Reference Include="System.Net.Http" />
19+
<Reference Include="System.Xaml">
20+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
21+
</Reference>
22+
<Reference Include="WindowsBase" />
23+
<Reference Include="PresentationCore" />
24+
<Reference Include="PresentationFramework" />
25+
</ItemGroup>
26+
<Import Project="targets\MultiTargeting.targets" />
27+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36119.2 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Export&ImportFormFields", "Export&ImportFormFields.csproj", "{C365A46E-5AF8-436E-A969-FBB028690E16}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{C365A46E-5AF8-436E-A969-FBB028690E16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{C365A46E-5AF8-436E-A969-FBB028690E16}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{C365A46E-5AF8-436E-A969-FBB028690E16}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{C365A46E-5AF8-436E-A969-FBB028690E16}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {8C21E232-1D66-45CB-B197-6D07AB54913D}
24+
EndGlobalSection
25+
EndGlobal
595 KB
Binary file not shown.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<Window xmlns:PdfViewer="clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF" x:Class="Export_ImportFormFields.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:Export_ImportFormFields"
7+
mc:Ignorable="d"
8+
Title="MainWindow" Height="450" Width="800">
9+
<Grid>
10+
<Grid.ColumnDefinitions>
11+
<ColumnDefinition Width="*"></ColumnDefinition>
12+
<ColumnDefinition Width="Auto"></ColumnDefinition>
13+
</Grid.ColumnDefinitions>
14+
<Border VerticalAlignment="Stretch" BorderBrush="LightGray" Grid.Column="1" BorderThickness="1" Padding="40">
15+
<Grid VerticalAlignment="Stretch">
16+
<StackPanel Background="White"
17+
Orientation="Vertical"
18+
VerticalAlignment="Center"
19+
HorizontalAlignment="Center">
20+
<GroupBox Header="Formats" FontSize="16" FontWeight="Bold">
21+
<StackPanel>
22+
<RadioButton FontWeight="Normal"
23+
x:Name="fdfRadioButton"
24+
VerticalContentAlignment="Center" FontSize="12" Margin="10"
25+
GroupName="Formats" IsChecked="True">
26+
FDF
27+
</RadioButton>
28+
<RadioButton FontWeight="Normal"
29+
x:Name="xfdfRadioButton"
30+
VerticalContentAlignment="Center" FontSize="12" Margin="10"
31+
GroupName="Formats">
32+
XFDF
33+
</RadioButton>
34+
</StackPanel>
35+
</GroupBox>
36+
<StackPanel Orientation="Horizontal">
37+
<Button x:Name="ImportButton"
38+
Content="Import"
39+
Click="ImportButton_Click"
40+
ToolTip="Click to import the form fields in the required format"
41+
Margin="10" Width="80" Padding="10">
42+
</Button>
43+
<Button x:Name="ExportButton"
44+
Content="Export"
45+
Click="ExportButton_Click"
46+
ToolTip="Click to export the form fields in the required format"
47+
Margin="10" Width="80" Padding="10">
48+
</Button>
49+
</StackPanel>
50+
</StackPanel>
51+
</Grid>
52+
</Border>
53+
<Border BorderBrush="LightGray"
54+
BorderThickness="0,1,1,1">
55+
<PdfViewer:PdfViewerControl x:Name="pdfViewer" ZoomMode="FitWidth"/>
56+
</Border>
57+
</Grid>
58+
</Window>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System.Windows;
2+
3+
namespace Export_ImportFormFields
4+
{
5+
/// <summary>
6+
/// Interaction logic for MainWindow.xaml
7+
/// </summary>
8+
public partial class MainWindow : Window
9+
{
10+
string filePath = "../../../FormFillingDocument.pdf";
11+
public MainWindow()
12+
{
13+
InitializeComponent();
14+
pdfViewer.Load(filePath);
15+
}
16+
private void ImportButton_Click(object sender, RoutedEventArgs e)
17+
{
18+
Microsoft.Win32.OpenFileDialog openFileDlg = new Microsoft.Win32.OpenFileDialog();
19+
if (fdfRadioButton.IsChecked.Value)
20+
openFileDlg.Filter = "FDF Documents|*.fdf";
21+
else
22+
openFileDlg.Filter = "XFDF Documents|*.xfdf";
23+
if (openFileDlg.ShowDialog().Value)
24+
{
25+
Syncfusion.Pdf.Parsing.DataFormat dataFormat;
26+
if (fdfRadioButton.IsChecked.Value)
27+
dataFormat = Syncfusion.Pdf.Parsing.DataFormat.Fdf;
28+
else
29+
dataFormat = Syncfusion.Pdf.Parsing.DataFormat.XFdf;
30+
//Import PDF form data
31+
pdfViewer.ImportFormData(openFileDlg.FileName, dataFormat);
32+
}
33+
}
34+
35+
private void ExportButton_Click(object sender, RoutedEventArgs e)
36+
{
37+
pdfViewer.Save("Modified.pdf");
38+
Microsoft.Win32.SaveFileDialog saveFileDlg = new Microsoft.Win32.SaveFileDialog();
39+
if (fdfRadioButton.IsChecked.Value)
40+
saveFileDlg.Filter = "FDF Documents|*.fdf";
41+
else
42+
saveFileDlg.Filter = "XFDF Documents|*.xfdf";
43+
if (saveFileDlg.ShowDialog().Value)
44+
{
45+
Syncfusion.Pdf.Parsing.DataFormat dataFormat;
46+
if (fdfRadioButton.IsChecked.Value)
47+
dataFormat = Syncfusion.Pdf.Parsing.DataFormat.Fdf;
48+
else
49+
dataFormat = Syncfusion.Pdf.Parsing.DataFormat.XFdf;
50+
//Export PDF form data
51+
pdfViewer.ExportFormData(saveFileDlg.FileName, dataFormat, "Modified.pdf");
52+
}
53+
}
54+
}
55+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using System.Reflection;
2+
using System.Resources;
3+
using System.Runtime.CompilerServices;
4+
using System.Runtime.InteropServices;
5+
using System.Windows;
6+
7+
// General Information about an assembly is controlled through the following
8+
// set of attributes. Change these attribute values to modify the information
9+
// associated with an assembly.
10+
[assembly: AssemblyTitle("Export&ImportFormFields")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("")]
14+
[assembly: AssemblyProduct("Export&ImportFormFields")]
15+
[assembly: AssemblyCopyright("Copyright © 2025")]
16+
[assembly: AssemblyTrademark("")]
17+
[assembly: AssemblyCulture("")]
18+
19+
// Setting ComVisible to false makes the types in this assembly not visible
20+
// to COM components. If you need to access a type in this assembly from
21+
// COM, set the ComVisible attribute to true on that type.
22+
[assembly: ComVisible(false)]
23+
24+
//In order to begin building localizable applications, set
25+
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
26+
//inside a <PropertyGroup>. For example, if you are using US english
27+
//in your source files, set the <UICulture> to en-US. Then uncomment
28+
//the NeutralResourceLanguage attribute below. Update the "en-US" in
29+
//the line below to match the UICulture setting in the project file.
30+
31+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32+
33+
34+
[assembly: ThemeInfo(
35+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36+
//(used if a resource is not found in the page,
37+
// or application resource dictionaries)
38+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39+
//(used if a resource is not found in the page,
40+
// app, or any theme specific resource dictionaries)
41+
)]
42+
43+
44+
// Version information for an assembly consists of the following four values:
45+
//
46+
// Major Version
47+
// Minor Version
48+
// Build Number
49+
// Revision
50+
//
51+
[assembly: AssemblyVersion("1.0.0.0")]
52+
[assembly: AssemblyFileVersion("1.0.0.0")]

FormFields/Export&ImportFormFields/Properties/Resources.Designer.cs

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)