diff --git a/Printing-Examples/How to configure printersettings/Printersettings.slnx b/Printing-Examples/How to configure printersettings/Printersettings.slnx
new file mode 100644
index 0000000..12ff5e2
--- /dev/null
+++ b/Printing-Examples/How to configure printersettings/Printersettings.slnx
@@ -0,0 +1,3 @@
+
+
+
diff --git a/Printing-Examples/How to configure printersettings/Printersettings/App.xaml b/Printing-Examples/How to configure printersettings/Printersettings/App.xaml
new file mode 100644
index 0000000..25a8714
--- /dev/null
+++ b/Printing-Examples/How to configure printersettings/Printersettings/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/Printing-Examples/How to configure printersettings/Printersettings/App.xaml.cs b/Printing-Examples/How to configure printersettings/Printersettings/App.xaml.cs
new file mode 100644
index 0000000..d893b44
--- /dev/null
+++ b/Printing-Examples/How to configure printersettings/Printersettings/App.xaml.cs
@@ -0,0 +1,14 @@
+using System.Configuration;
+using System.Data;
+using System.Windows;
+
+namespace Printersettings
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+
+}
diff --git a/Printing-Examples/How to configure printersettings/Printersettings/AssemblyInfo.cs b/Printing-Examples/How to configure printersettings/Printersettings/AssemblyInfo.cs
new file mode 100644
index 0000000..b0ec827
--- /dev/null
+++ b/Printing-Examples/How to configure printersettings/Printersettings/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[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)
+)]
diff --git a/Printing-Examples/How to configure printersettings/Printersettings/MainWindow.xaml b/Printing-Examples/How to configure printersettings/Printersettings/MainWindow.xaml
new file mode 100644
index 0000000..4e4b6bc
--- /dev/null
+++ b/Printing-Examples/How to configure printersettings/Printersettings/MainWindow.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/Printing-Examples/How to configure printersettings/Printersettings/MainWindow.xaml.cs b/Printing-Examples/How to configure printersettings/Printersettings/MainWindow.xaml.cs
new file mode 100644
index 0000000..3d93963
--- /dev/null
+++ b/Printing-Examples/How to configure printersettings/Printersettings/MainWindow.xaml.cs
@@ -0,0 +1,95 @@
+using Syncfusion.PdfToImageConverter;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Drawing.Printing;
+using System.IO;
+using System.Text;
+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;
+
+namespace Printersettings
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ PdfToImageConverter imageConverter = new PdfToImageConverter();
+ //Load the PDF document as a stream
+ FileStream inputStream = new FileStream("../../../testing.pdf", FileMode.Open, FileAccess.ReadWrite);
+ imageConverter.Load(inputStream);
+ //Convert PDF to Image.
+ Stream outputStream = imageConverter.Convert(0, false, false);
+ Bitmap image = new Bitmap(outputStream);
+ image.Save("tmp_without.png");
+ PrintImage("tmp_without.png");
+ }
+
+ private void PrintImage(string imagePath)
+ {
+ using (System.Drawing.Image original = System.Drawing.Image.FromFile(imagePath))
+ {
+ PrintDocument printDoc = new PrintDocument();
+ var img = original;
+ printDoc.PrinterSettings.DefaultPageSettings.Color = true;
+ //customize printer settings
+ printDoc.DefaultPageSettings.PaperSize = new PaperSize("A4", 827, 1169);
+ // Set margins
+ printDoc.DefaultPageSettings.Margins = new Margins(100, 200, 150, 150);
+ //Set paper source
+ printDoc.DefaultPageSettings.PaperSource.RawKind = (int)PaperSourceKind.LargeFormat;
+ //// Set paper kind
+ //printDoc.PrinterSettings.DefaultPageSettings.PaperSize.RawKind = (int)PaperKind.A4;
+ // Set duplex printing
+ if (printDoc.PrinterSettings.CanDuplex)
+ printDoc.PrinterSettings.Duplex = Duplex.Horizontal;
+ // Set printer resolution
+ printDoc.PrinterSettings.DefaultPageSettings.PrinterResolution.Kind = PrinterResolutionKind.High;
+ // Check if the printer supports color printing
+ if (!printDoc.PrinterSettings.DefaultPageSettings.Color)
+ {
+ img = ToGrayscale(original);
+ }
+ printDoc.PrintPage += (s, e) =>
+ {
+ e.Graphics.DrawImage(img, e.MarginBounds);
+ };
+ printDoc.Print();
+ }
+ }
+ private static System.Drawing.Image ToGrayscale(System.Drawing.Image source)
+ {
+ var bmp = new Bitmap(source.Width, source.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
+ using (var g = Graphics.FromImage(bmp))
+ {
+ var matrix = new ColorMatrix(new float[][]
+ {
+ new float[] {.299f, .299f, .299f, 0, 0},
+ new float[] {.587f, .587f, .587f, 0, 0},
+ new float[] {.114f, .114f, .114f, 0, 0},
+ new float[] {0, 0, 0, 1, 0},
+ new float[] {0, 0, 0, 0, 1}
+ });
+ var ia = new ImageAttributes();
+ ia.SetColorMatrix(matrix);
+ g.DrawImage(source, new System.Drawing.Rectangle(0, 0, bmp.Width, bmp.Height),
+ 0, 0, source.Width, source.Height, GraphicsUnit.Pixel, ia);
+ }
+ return bmp;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Printing-Examples/How to configure printersettings/Printersettings/Printersettings.csproj b/Printing-Examples/How to configure printersettings/Printersettings/Printersettings.csproj
new file mode 100644
index 0000000..3239730
--- /dev/null
+++ b/Printing-Examples/How to configure printersettings/Printersettings/Printersettings.csproj
@@ -0,0 +1,14 @@
+
+
+
+ WinExe
+
+
+
+
+
+
+
+
+
+
diff --git a/Printing-Examples/How to configure printersettings/Printersettings/targets/MultiTargeting.targets b/Printing-Examples/How to configure printersettings/Printersettings/targets/MultiTargeting.targets
new file mode 100644
index 0000000..3928b04
--- /dev/null
+++ b/Printing-Examples/How to configure printersettings/Printersettings/targets/MultiTargeting.targets
@@ -0,0 +1,10 @@
+
+
+ net462;net8.0-windows;net9.0-windows;net10.0-windows
+ true
+ False
+ True
+ True
+ True
+
+
\ No newline at end of file
diff --git a/Printing-Examples/How to configure printersettings/Printersettings/testing.pdf b/Printing-Examples/How to configure printersettings/Printersettings/testing.pdf
new file mode 100644
index 0000000..83aa682
Binary files /dev/null and b/Printing-Examples/How to configure printersettings/Printersettings/testing.pdf differ