File tree Expand file tree Collapse file tree 10 files changed +113
-0
lines changed
Printing-Examples/Lanscape-settings
Landscape_printersettings Expand file tree Collapse file tree 10 files changed +113
-0
lines changed Original file line number Diff line number Diff line change 1+ <Solution >
2+ <Project Path =" Landscape_printersettings/Landscape_printersettings.csproj" />
3+ </Solution >
Original file line number Diff line number Diff line change 1+ <Application x : Class =" Landscape_printersettings.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:Landscape_printersettings"
5+ StartupUri =" MainWindow.xaml" >
6+ <Application .Resources>
7+
8+ </Application .Resources>
9+ </Application >
Original file line number Diff line number Diff line change 1+ using System . Configuration ;
2+ using System . Data ;
3+ using System . Windows ;
4+
5+ namespace Landscape_printersettings
6+ {
7+ /// <summary>
8+ /// Interaction logic for App.xaml
9+ /// </summary>
10+ public partial class App : Application
11+ {
12+ }
13+
14+ }
Original file line number Diff line number Diff line change 1+ using System . Windows ;
2+
3+ [ assembly: ThemeInfo (
4+ ResourceDictionaryLocation . None , //where theme specific resource dictionaries are located
5+ //(used if a resource is not found in the page,
6+ // or application resource dictionaries)
7+ ResourceDictionaryLocation . SourceAssembly //where the generic resource dictionary is located
8+ //(used if a resource is not found in the page,
9+ // app, or any theme specific resource dictionaries)
10+ ) ]
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+
3+ <PropertyGroup >
4+ <OutputType >WinExe</OutputType >
5+ </PropertyGroup >
6+
7+ <ItemGroup >
8+ <PackageReference Include =" Syncfusion.PdfViewer.WPF" Version =" *" />
9+ </ItemGroup >
10+ <Import Project =" targets\MultiTargeting.targets" />
11+
12+ </Project >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <Project ToolsVersion =" Current" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
3+ <PropertyGroup />
4+ </Project >
Original file line number Diff line number Diff line change 1+ <Window x : Class =" Landscape_printersettings.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:Landscape_printersettings"
7+ xmlns : syncfusion =" clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF"
8+ mc : Ignorable =" d"
9+ Title =" MainWindow" Height =" 450" Width =" 800" >
10+ <Grid >
11+ <Grid .RowDefinitions>
12+ <RowDefinition Height =" Auto" />
13+ <RowDefinition Height =" *" />
14+ </Grid .RowDefinitions>
15+ <Button x : Name =" Print" Content =" Print" Width =" 100" Height =" 30" Margin =" 10" Click =" Print_Click" />
16+ <syncfusion : PdfViewerControl x : Name =" pdfViewer" Grid.Row=" 1" ></syncfusion : PdfViewerControl >
17+ </Grid >
18+ </Window >
Original file line number Diff line number Diff line change 1+ using Syncfusion . Windows . PdfViewer ;
2+ using System . Text ;
3+ using System . Windows ;
4+ using System . Windows . Controls ;
5+ using System . Windows . Data ;
6+ using System . Windows . Documents ;
7+ using System . Windows . Input ;
8+ using System . Windows . Media ;
9+ using System . Windows . Media . Imaging ;
10+ using System . Windows . Navigation ;
11+ using System . Windows . Shapes ;
12+
13+ namespace Landscape_printersettings
14+ {
15+ /// <summary>
16+ /// Interaction logic for MainWindow.xaml
17+ /// </summary>
18+ public partial class MainWindow : Window
19+ {
20+ public MainWindow ( )
21+ {
22+ InitializeComponent ( ) ;
23+ pdfViewer . Load ( "../../../Input.pdf" ) ;
24+ }
25+ private void Print_Click ( object sender , RoutedEventArgs e )
26+ {
27+ // Set the page orientation to landscape
28+ pdfViewer . PrinterSettings . PageOrientation = PdfViewerPrintOrientation . Landscape ;
29+ // Print the PDF document
30+ pdfViewer . Print ( ) ;
31+ }
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ <Project >
2+ <PropertyGroup >
3+ <TargetFrameworks >net462;net8.0-windows;net9.0-windows;net10.0-windows</TargetFrameworks >
4+ <UseWPF >true</UseWPF >
5+ <GenerateAssemblyInfo >False</GenerateAssemblyInfo >
6+ <GenerateDocumentationFile >True</GenerateDocumentationFile >
7+ <EnableDefaultItems >True</EnableDefaultItems >
8+ <EnableDefaultEmbeddedResourceItems >True</EnableDefaultEmbeddedResourceItems >
9+ </PropertyGroup >
10+ </Project >
You can’t perform that action at this time.
0 commit comments