diff --git a/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar.csproj b/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar.csproj new file mode 100644 index 0000000..756ac6b --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar.csproj @@ -0,0 +1,106 @@ + + + + + Debug + AnyCPU + {16DB3F24-C63E-4E04-87B0-E2489A46A106} + WinExe + AddStandardStampsInToolBar + AddStandardStampsInToolBar + v4.8 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE;NETFRAMEWORK + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE;NETFRAMEWORK + prompt + 4 + + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + \ No newline at end of file diff --git a/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar.sln b/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar.sln new file mode 100644 index 0000000..8282e6d --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddStandardStampsInToolBar", "AddStandardStampsInToolBar.csproj", "{16DB3F24-C63E-4E04-87B0-E2489A46A106}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {16DB3F24-C63E-4E04-87B0-E2489A46A106}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16DB3F24-C63E-4E04-87B0-E2489A46A106}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16DB3F24-C63E-4E04-87B0-E2489A46A106}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16DB3F24-C63E-4E04-87B0-E2489A46A106}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar_NET.csproj b/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar_NET.csproj new file mode 100644 index 0000000..1c15958 --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar_NET.csproj @@ -0,0 +1,15 @@ + + + + WinExe + net8.0-windows + enable + enable + true + + + + + + + diff --git a/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar_NET.sln b/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar_NET.sln new file mode 100644 index 0000000..2b34a3f --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/AddStandardStampsInToolBar_NET.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddStandardStampsInToolBar_NET", "AddStandardStampsInToolBar_NET.csproj", "{14239ED3-0AA6-4B56-93F4-80D7EE3467C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {14239ED3-0AA6-4B56-93F4-80D7EE3467C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14239ED3-0AA6-4B56-93F4-80D7EE3467C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14239ED3-0AA6-4B56-93F4-80D7EE3467C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14239ED3-0AA6-4B56-93F4-80D7EE3467C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Annotations/AddStandardStampsinToolBar/App.config b/Annotations/AddStandardStampsinToolBar/App.config new file mode 100644 index 0000000..e7f1514 --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Annotations/AddStandardStampsinToolBar/App.xaml b/Annotations/AddStandardStampsinToolBar/App.xaml new file mode 100644 index 0000000..04567f6 --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Annotations/AddStandardStampsinToolBar/App.xaml.cs b/Annotations/AddStandardStampsinToolBar/App.xaml.cs new file mode 100644 index 0000000..89db7e8 --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/App.xaml.cs @@ -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 AddingStandardStampsInToolBar +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Annotations/AddStandardStampsinToolBar/Data/Adventure_Cycle.jpg b/Annotations/AddStandardStampsinToolBar/Data/Adventure_Cycle.jpg new file mode 100644 index 0000000..4698ae1 Binary files /dev/null and b/Annotations/AddStandardStampsinToolBar/Data/Adventure_Cycle.jpg differ diff --git a/Annotations/AddStandardStampsinToolBar/Data/Confidential.png b/Annotations/AddStandardStampsinToolBar/Data/Confidential.png new file mode 100644 index 0000000..27b6e26 Binary files /dev/null and b/Annotations/AddStandardStampsinToolBar/Data/Confidential.png differ diff --git a/Annotations/AddStandardStampsinToolBar/Data/F#.pdf b/Annotations/AddStandardStampsinToolBar/Data/F#.pdf new file mode 100644 index 0000000..873e7b8 Binary files /dev/null and b/Annotations/AddStandardStampsinToolBar/Data/F#.pdf differ diff --git a/Annotations/AddStandardStampsinToolBar/MainWindow.xaml b/Annotations/AddStandardStampsinToolBar/MainWindow.xaml new file mode 100644 index 0000000..0b7dc71 --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/MainWindow.xaml @@ -0,0 +1,13 @@ + + + + + diff --git a/Annotations/AddStandardStampsinToolBar/MainWindow.xaml.cs b/Annotations/AddStandardStampsinToolBar/MainWindow.xaml.cs new file mode 100644 index 0000000..9ca7d7a --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/MainWindow.xaml.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Syncfusion.Windows.PdfViewer; + +namespace AddingStandardStampsInToolBar +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + string path; + public MainWindow() + { + InitializeComponent(); + this.WindowState = WindowState.Maximized; + //Setting the path based on the framework +#if NETFRAMEWORK + path = "../../Data/"; +#else + path = "../../../Data/"; +#endif + pdfViewer.Load(System.IO.Path.Combine(path, "F#.pdf")); + pdfViewer.DocumentLoaded += PdfViewer_DocumentLoaded; + } + + /// + /// Document loaded event that handles the creation of stamps from the local images and adds the standard stamps to the toolbar. + /// + /// Source of the event + /// Event arguments + private void PdfViewer_DocumentLoaded(object sender, EventArgs args) + { + // Clear the existing standard stamps if it is not needed. + pdfViewer.ToolbarSettings.StampAnnotations.Clear(); + //Load the custom image from the local disk. + System.Windows.Controls.Image image1 = new System.Windows.Controls.Image(); + image1.Source = new BitmapImage(new Uri(System.IO.Path.Combine(path, "Adventure_Cycle.jpg"), UriKind.RelativeOrAbsolute)); + System.Windows.Controls.Image image2 = new System.Windows.Controls.Image(); + image2.Source = new BitmapImage(new Uri(System.IO.Path.Combine(path, "Confidential.png"), UriKind.RelativeOrAbsolute)); + //Create a new standard stamp from the image. + PdfStampAnnotation newStandardStamp1 = new PdfStampAnnotation(image1); + PdfStampAnnotation newStandardStamp2 = new PdfStampAnnotation(image2); + //Add the custom stamp in the toolbar. + pdfViewer.ToolbarSettings.StampAnnotations.Add(newStandardStamp1); + pdfViewer.ToolbarSettings.StampAnnotations.Add(newStandardStamp2 ); + } + } +} diff --git a/Annotations/AddStandardStampsinToolBar/Properties/AssemblyInfo.cs b/Annotations/AddStandardStampsinToolBar/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7844e4e --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/Properties/AssemblyInfo.cs @@ -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("AddingStandardStampsInToolBar")] +//[assembly: AssemblyDescription("")] +//[assembly: AssemblyConfiguration("")] +//[assembly: AssemblyCompany("")] +//[assembly: AssemblyProduct("AddingStandardStampsInToolBar")] +[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 +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the 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")] diff --git a/Annotations/AddStandardStampsinToolBar/Properties/Resources.Designer.cs b/Annotations/AddStandardStampsinToolBar/Properties/Resources.Designer.cs new file mode 100644 index 0000000..14d17df --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AddingStandardStampsInToolBar.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AddingStandardStampsInToolBar.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Annotations/AddCustomStampInCustomizedButton/Properties/Resources.resx b/Annotations/AddStandardStampsinToolBar/Properties/Resources.resx similarity index 100% rename from Annotations/AddCustomStampInCustomizedButton/Properties/Resources.resx rename to Annotations/AddStandardStampsinToolBar/Properties/Resources.resx diff --git a/Annotations/AddStandardStampsinToolBar/Properties/Settings.Designer.cs b/Annotations/AddStandardStampsinToolBar/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6a7626e --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AddingStandardStampsInToolBar.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Annotations/AddStandardStampsinToolBar/Properties/Settings.settings b/Annotations/AddStandardStampsinToolBar/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Annotations/AddStandardStampsinToolBar/packages.config b/Annotations/AddStandardStampsinToolBar/packages.config new file mode 100644 index 0000000..1f82aa8 --- /dev/null +++ b/Annotations/AddStandardStampsinToolBar/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file