Skip to content

Commit 8aba7af

Browse files
authored
Merge pull request #43 from SyncfusionExamples/901074
901074 How to set the font size of text annotations greater than values available in WPF PdfViewer
2 parents e9a00ad + 04b625f commit 8aba7af

15 files changed

+527
-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="CustomizeFontSizeSample.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:CustomizeFontSizeSample"
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 CustomizeFontSizeSample
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{A263C8D9-D9AD-416A-B127-F98C84642E6A}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>CustomizeFontSizeSample</RootNamespace>
10+
<AssemblyName>CustomizeFontSizeSample</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
<Deterministic>true</Deterministic>
17+
<NuGetPackageImportStamp>
18+
</NuGetPackageImportStamp>
19+
</PropertyGroup>
20+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21+
<PlatformTarget>AnyCPU</PlatformTarget>
22+
<DebugSymbols>true</DebugSymbols>
23+
<DebugType>full</DebugType>
24+
<Optimize>false</Optimize>
25+
<OutputPath>bin\Debug\</OutputPath>
26+
<DefineConstants>DEBUG;TRACE</DefineConstants>
27+
<ErrorReport>prompt</ErrorReport>
28+
<WarningLevel>4</WarningLevel>
29+
</PropertyGroup>
30+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
31+
<PlatformTarget>AnyCPU</PlatformTarget>
32+
<DebugType>pdbonly</DebugType>
33+
<Optimize>true</Optimize>
34+
<OutputPath>bin\Release\</OutputPath>
35+
<DefineConstants>TRACE</DefineConstants>
36+
<ErrorReport>prompt</ErrorReport>
37+
<WarningLevel>4</WarningLevel>
38+
</PropertyGroup>
39+
<ItemGroup>
40+
<packageReference Include="Syncfusion.PdfViewer.WPF" version="*"/>
41+
<Reference Include="System" />
42+
<Reference Include="System.Data" />
43+
<Reference Include="System.Xml" />
44+
<Reference Include="Microsoft.CSharp" />
45+
<Reference Include="System.Core" />
46+
<Reference Include="System.Xml.Linq" />
47+
<Reference Include="System.Data.DataSetExtensions" />
48+
<Reference Include="System.Net.Http" />
49+
<Reference Include="System.Xaml">
50+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
51+
</Reference>
52+
<Reference Include="WindowsBase" />
53+
<Reference Include="PresentationCore" />
54+
<Reference Include="PresentationFramework" />
55+
</ItemGroup>
56+
<ItemGroup>
57+
<ApplicationDefinition Include="App.xaml">
58+
<Generator>MSBuild:Compile</Generator>
59+
<SubType>Designer</SubType>
60+
</ApplicationDefinition>
61+
<Page Include="MainWindow.xaml">
62+
<Generator>MSBuild:Compile</Generator>
63+
<SubType>Designer</SubType>
64+
</Page>
65+
<Compile Include="App.xaml.cs">
66+
<DependentUpon>App.xaml</DependentUpon>
67+
<SubType>Code</SubType>
68+
</Compile>
69+
<Compile Include="MainWindow.xaml.cs">
70+
<DependentUpon>MainWindow.xaml</DependentUpon>
71+
<SubType>Code</SubType>
72+
</Compile>
73+
</ItemGroup>
74+
<ItemGroup>
75+
<Compile Include="Properties\AssemblyInfo.cs">
76+
<SubType>Code</SubType>
77+
</Compile>
78+
<Compile Include="Properties\Resources.Designer.cs">
79+
<AutoGen>True</AutoGen>
80+
<DesignTime>True</DesignTime>
81+
<DependentUpon>Resources.resx</DependentUpon>
82+
</Compile>
83+
<Compile Include="Properties\Settings.Designer.cs">
84+
<AutoGen>True</AutoGen>
85+
<DependentUpon>Settings.settings</DependentUpon>
86+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
87+
</Compile>
88+
<EmbeddedResource Include="Properties\Resources.resx">
89+
<Generator>ResXFileCodeGenerator</Generator>
90+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
91+
</EmbeddedResource>
92+
<None Include="packages.config" />
93+
<None Include="Properties\Settings.settings">
94+
<Generator>SettingsSingleFileGenerator</Generator>
95+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
96+
</None>
97+
</ItemGroup>
98+
<ItemGroup>
99+
<None Include="App.config" />
100+
</ItemGroup>
101+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
102+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
103+
<PropertyGroup>
104+
</PropertyGroup>
105+
</Target>
106+
</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.9.34622.214
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomizeFontSizeSample", "CustomizeFontSizeSample.csproj", "{A263C8D9-D9AD-416A-B127-F98C84642E6A}"
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+
{A263C8D9-D9AD-416A-B127-F98C84642E6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{A263C8D9-D9AD-416A-B127-F98C84642E6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{A263C8D9-D9AD-416A-B127-F98C84642E6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{A263C8D9-D9AD-416A-B127-F98C84642E6A}.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 = {40110A29-E4A3-41A1-9266-14A1A71644BF}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net8.0-windows</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<UseWPF>true</UseWPF>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
13+
</ItemGroup>
14+
15+
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35527.113 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomizeFontSizeSample_NET", "CustomizeFontSizeSample_NET.csproj", "{EB12763B-8419-4718-90A9-910294BCA643}"
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+
{EB12763B-8419-4718-90A9-910294BCA643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{EB12763B-8419-4718-90A9-910294BCA643}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{EB12763B-8419-4718-90A9-910294BCA643}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{EB12763B-8419-4718-90A9-910294BCA643}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Window xmlns:PdfViewer="clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF" x:Class="CustomizeFontSizeSample.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:CustomizeFontSizeSample"
7+
mc:Ignorable="d"
8+
Title="MainWindow" Height="450" Width="800">
9+
<Grid>
10+
<PdfViewer:PdfViewerControl x:Name="pdfViewer"/>
11+
</Grid>
12+
</Window>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Syncfusion.Windows.PdfViewer;
2+
using System.Windows;
3+
using System.Windows.Controls;
4+
5+
namespace CustomizeFontSizeSample
6+
{
7+
/// <summary>
8+
/// Interaction logic for MainWindow.xaml
9+
/// </summary>
10+
public partial class MainWindow : Window
11+
{
12+
public MainWindow()
13+
{
14+
InitializeComponent();
15+
this.WindowState = WindowState.Maximized;
16+
#if NETCOREAPP
17+
pdfViewer.Load("../../../../../../PDF/HTTP Succinctly.pdf");
18+
#else
19+
pdfViewer.Load("../../../../../PDF/HTTP Succinctly.pdf");
20+
#endif
21+
pdfViewer.Loaded += pdfViewer_Loaded;
22+
}
23+
private void pdfViewer_Loaded(object sender, RoutedEventArgs e)
24+
{
25+
// Get the instance of the FontPropertiesDialog using its template name.
26+
FontPropertiesDialog propertiesDialog = pdfViewer.Template.FindName("PART_FreeText", pdfViewer) as FontPropertiesDialog;
27+
// Get the instance of the font size combo box using its template name.
28+
ComboBox fontSize = (ComboBox)propertiesDialog.Template.FindName("FontSizeMenu", propertiesDialog);
29+
//Add a custom font size as string to combo box items.
30+
fontSize.Items.Add("24");
31+
fontSize.Items.Add("26");
32+
fontSize.Items.Add("28");
33+
fontSize.Items.Add("36");
34+
fontSize.Items.Add("48");
35+
fontSize.Items.Add("72");
36+
}
37+
}
38+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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: AssemblyCopyright("Copyright © 2024")]
11+
[assembly: AssemblyTrademark("")]
12+
[assembly: AssemblyCulture("")]
13+
14+
// Setting ComVisible to false makes the types in this assembly not visible
15+
// to COM components. If you need to access a type in this assembly from
16+
// COM, set the ComVisible attribute to true on that type.
17+
[assembly: ComVisible(false)]
18+
19+
//In order to begin building localizable applications, set
20+
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
21+
//inside a <PropertyGroup>. For example, if you are using US english
22+
//in your source files, set the <UICulture> to en-US. Then uncomment
23+
//the NeutralResourceLanguage attribute below. Update the "en-US" in
24+
//the line below to match the UICulture setting in the project file.
25+
26+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
27+
28+
29+
[assembly: ThemeInfo(
30+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
31+
//(used if a resource is not found in the page,
32+
// or application resource dictionaries)
33+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
34+
//(used if a resource is not found in the page,
35+
// app, or any theme specific resource dictionaries)
36+
)]
37+
38+
39+
// Version information for an assembly consists of the following four values:
40+
//
41+
// Major Version
42+
// Minor Version
43+
// Build Number
44+
// Revision
45+
//
46+
// You can specify all the values or you can default the Build and Revision Numbers
47+
// by using the '*' as shown below:
48+
// [assembly: AssemblyVersion("1.0.*")]

Annotations/CustomizeFontSizeOfTextAnnotation/CustomizeFontSizeSample/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)