Skip to content
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
6 changes: 6 additions & 0 deletions FormFields/Export&ImportFormFields/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions FormFields/Export&ImportFormFields/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="Export_ImportFormFields.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Export_ImportFormFields"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions FormFields/Export&ImportFormFields/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace Export_ImportFormFields
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
27 changes: 27 additions & 0 deletions FormFields/Export&ImportFormFields/Export&ImportFormFields.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<RootNamespace>Export_ImportFormFields</RootNamespace>
<AssemblyName>Export&amp;ImportFormFields</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<Import Project="targets\MultiTargeting.targets" />
</Project>
25 changes: 25 additions & 0 deletions FormFields/Export&ImportFormFields/Export&ImportFormFields.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.14.36119.2 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Export&ImportFormFields", "Export&ImportFormFields.csproj", "{C365A46E-5AF8-436E-A969-FBB028690E16}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C365A46E-5AF8-436E-A969-FBB028690E16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C365A46E-5AF8-436E-A969-FBB028690E16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C365A46E-5AF8-436E-A969-FBB028690E16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C365A46E-5AF8-436E-A969-FBB028690E16}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8C21E232-1D66-45CB-B197-6D07AB54913D}
EndGlobalSection
EndGlobal
Binary file not shown.
58 changes: 58 additions & 0 deletions FormFields/Export&ImportFormFields/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<Window xmlns:PdfViewer="clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF" x:Class="Export_ImportFormFields.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Export_ImportFormFields"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border VerticalAlignment="Stretch" BorderBrush="LightGray" Grid.Column="1" BorderThickness="1" Padding="40">
<Grid VerticalAlignment="Stretch">
<StackPanel Background="White"
Orientation="Vertical"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<GroupBox Header="Formats" FontSize="16" FontWeight="Bold">
<StackPanel>
<RadioButton FontWeight="Normal"
x:Name="fdfRadioButton"
VerticalContentAlignment="Center" FontSize="12" Margin="10"
GroupName="Formats" IsChecked="True">
FDF
</RadioButton>
<RadioButton FontWeight="Normal"
x:Name="xfdfRadioButton"
VerticalContentAlignment="Center" FontSize="12" Margin="10"
GroupName="Formats">
XFDF
</RadioButton>
</StackPanel>
</GroupBox>
<StackPanel Orientation="Horizontal">
<Button x:Name="ImportButton"
Content="Import"
Click="ImportButton_Click"
ToolTip="Click to import the form fields in the required format"
Margin="10" Width="80" Padding="10">
</Button>
<Button x:Name="ExportButton"
Content="Export"
Click="ExportButton_Click"
ToolTip="Click to export the form fields in the required format"
Margin="10" Width="80" Padding="10">
</Button>
</StackPanel>
</StackPanel>
</Grid>
</Border>
<Border BorderBrush="LightGray"
BorderThickness="0,1,1,1">
<PdfViewer:PdfViewerControl x:Name="pdfViewer" ZoomMode="FitWidth"/>
</Border>
</Grid>
</Window>
55 changes: 55 additions & 0 deletions FormFields/Export&ImportFormFields/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System.Windows;

namespace Export_ImportFormFields
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
string filePath = "../../../FormFillingDocument.pdf";
public MainWindow()
{
InitializeComponent();
pdfViewer.Load(filePath);
}
private void ImportButton_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog openFileDlg = new Microsoft.Win32.OpenFileDialog();
if (fdfRadioButton.IsChecked.Value)
openFileDlg.Filter = "FDF Documents|*.fdf";
else
openFileDlg.Filter = "XFDF Documents|*.xfdf";
if (openFileDlg.ShowDialog().Value)
{
Syncfusion.Pdf.Parsing.DataFormat dataFormat;
if (fdfRadioButton.IsChecked.Value)
dataFormat = Syncfusion.Pdf.Parsing.DataFormat.Fdf;
else
dataFormat = Syncfusion.Pdf.Parsing.DataFormat.XFdf;
//Import PDF form data
pdfViewer.ImportFormData(openFileDlg.FileName, dataFormat);
}
}

private void ExportButton_Click(object sender, RoutedEventArgs e)
{
pdfViewer.Save("Modified.pdf");
Microsoft.Win32.SaveFileDialog saveFileDlg = new Microsoft.Win32.SaveFileDialog();
if (fdfRadioButton.IsChecked.Value)
saveFileDlg.Filter = "FDF Documents|*.fdf";
else
saveFileDlg.Filter = "XFDF Documents|*.xfdf";
if (saveFileDlg.ShowDialog().Value)
{
Syncfusion.Pdf.Parsing.DataFormat dataFormat;
if (fdfRadioButton.IsChecked.Value)
dataFormat = Syncfusion.Pdf.Parsing.DataFormat.Fdf;
else
dataFormat = Syncfusion.Pdf.Parsing.DataFormat.XFdf;
//Export PDF form data
pdfViewer.ExportFormData(saveFileDlg.FileName, dataFormat, "Modified.pdf");
}
}
}
}
52 changes: 52 additions & 0 deletions FormFields/Export&ImportFormFields/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// 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("Export&ImportFormFields")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Export&ImportFormFields")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]


// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[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.

Loading