Skip to content

Commit a158ca3

Browse files
author
Relorer
committed
Add project files.
1 parent de48829 commit a158ca3

33 files changed

+1598
-0
lines changed

HTMLToQPDF.Example/App.xaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Application
2+
x:Class="HTMLToQPDF.Example.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:hc="https://handyorg.github.io/handycontrol"
6+
StartupUri="MainWindow.xaml">
7+
<Application.Resources>
8+
<ResourceDictionary>
9+
<ResourceDictionary.MergedDictionaries>
10+
<hc:ThemeResources />
11+
<hc:Theme />
12+
</ResourceDictionary.MergedDictionaries>
13+
</ResourceDictionary>
14+
</Application.Resources>
15+
</Application>

HTMLToQPDF.Example/App.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System.Windows;
2+
3+
namespace HTMLToQPDF.Example
4+
{
5+
/// <summary>
6+
/// Interaction logic for App.xaml
7+
/// </summary>
8+
public partial class App : Application
9+
{
10+
}
11+
}

HTMLToQPDF.Example/AssemblyInfo.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
)]
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<div class="reader-container container container_center">
11+
<div class="article-image">
12+
<a href="https://www.pexels.com/ru-ru/photo/7961265/">
13+
<img src="https://images.pexels.com/photos/7961265/pexels-photo-7961265.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" />
14+
</a>
15+
</div>
16+
<p>Lorem</p>
17+
<h1>h1</h1>
18+
<h2><s>h2</s></h2>
19+
<h3>h3</h3>
20+
<h4>h4</h4>
21+
<h5>h5</h5>
22+
<br />
23+
<br />
24+
<h6>h6</h6>
25+
<p>
26+
<s>Lorem &nbsp;&nbsp;ipsum</s> dolor <br />
27+
sit, <b>amet</b> consectetur <strike>adipisicing</strike> elit. Illo
28+
aperiam perferendis soluta nam <small>ducimus</small> ipsa <br />
29+
alias animi asperiores quisquam aut ex minus, cum
30+
<u>possimus</u> accusamus corporis
31+
<a href="https://www.google.com/">Test link</a> consequatur
32+
<i>ipsam</i> praesentium.
33+
</p>
34+
<table class="tg">
35+
<thead>
36+
<tr>
37+
<td class="tg-0lax" rowspan="3">1</td>
38+
<td class="tg-0lax">2</td>
39+
<td class="tg-0lax">3</td>
40+
<td class="tg-0lax">4</td>
41+
</tr>
42+
<tr>
43+
<td class="tg-0lax" rowspan="2">5</td>
44+
<td class="tg-0lax" colspan="2">6</td>
45+
</tr>
46+
<tr>
47+
<td class="tg-0lax">7</td>
48+
<td class="tg-0lax">8</td>
49+
</tr>
50+
</thead>
51+
</table>
52+
<br />
53+
<table>
54+
<tr>
55+
<th>First Name</th>
56+
<th>Last Name</th>
57+
<th>Email Address</th>
58+
</tr>
59+
<tr>
60+
<td>Hillary</td>
61+
<td>Nyakundi</td>
62+
63+
</tr>
64+
<tr>
65+
<td>Lary</td>
66+
<td>Mak</td>
67+
68+
</tr>
69+
</table>
70+
71+
<ul>
72+
<li>
73+
<p>
74+
<s>Lorem &nbsp;&nbsp;ipsum</s> dolor <br />
75+
sit, <b>amet</b> consectetur <strike>adipisicing</strike> elit. Illo
76+
aperiam perferendis soluta nam <small>ducimus</small> ipsa <br />
77+
alias animi asperiores quisquam aut ex minus, cum
78+
<u>possimus</u> accusamus corporis
79+
<a href="https://www.google.com/">Test link</a> consequatur
80+
<i>ipsam</i> praesentium.
81+
</p>
82+
</li>
83+
lorem
84+
<li>
85+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ullam
86+
voluptates dignissimos, praesentium non necessitatibus reiciendis
87+
nihil repudiandae quibusdam deleniti, placeat accusantium impedit
88+
aperiam laborum. Cupiditate sed repellendus eos quam harum.
89+
<ol>
90+
<li>Option 1</li>
91+
<li>Option 2</li>
92+
</ol>
93+
</li>
94+
</ul>
95+
96+
<p>
97+
Лорем ипсум долор сит амет, хинц феугаит албуциус не пер, вис еу темпор
98+
номинати маиестатис. Еу ерос оптион яуи. Ерат миним ехерци хас еа, нец
99+
легимус детерруиссет ат. Еирмод тхеопхрастус те хис, еи яуо видит аугуе,
100+
дицтас цонсецтетуер при ад. Бруте сенсибус вис ат, нам путант форенсибус
101+
ид, мел еа порро толлит перфецто. Яуот цлита ут нец. Ан иус алиа
102+
цонсецтетуер, те хис тале неморе. Цу сусципит апеириан торяуатос цум.
103+
Яуи ут адхуц аппареат цомпрехенсам, граецис еррорибус еи вел.
104+
</p>
105+
106+
<p>—————————————————————</p>
107+
<br />
108+
<p>● Lorem ipsum dolor sit amet</p>
109+
<p>● Lorem ipsum dolor sit amet</p>
110+
<p>Lorem ipsum dolor sit amet. 😊</p>
111+
</div>
112+
</body>
113+
</html>
4.49 KB
Binary file not shown.

HTMLToQPDF.Example/FodyWeavers.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
2+
<PropertyChanged />
3+
</Weavers>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net6.0-windows</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<UseWPF>true</UseWPF>
8+
<ApplicationIcon>Assets\web-programming.ico</ApplicationIcon>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<Content Include="Assets\web-programming.ico" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="DevExpress.Mvvm.CodeGenerators" Version="22.1.1" />
17+
<PackageReference Include="DevExpressMvvm" Version="22.1.3" />
18+
<PackageReference Include="Fody" Version="6.6.4">
19+
<PrivateAssets>all</PrivateAssets>
20+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
21+
</PackageReference>
22+
<PackageReference Include="HandyControls" Version="3.4.2" />
23+
<PackageReference Include="PropertyChanged.Fody" Version="4.0.4" />
24+
<PackageReference Include="QuestPDF" Version="2022.9.0" />
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<ProjectReference Include="..\HTMLToQPDF\HTMLToQPDF.csproj" />
29+
</ItemGroup>
30+
31+
<ItemGroup>
32+
<Compile Update="Properties\Resources.Designer.cs">
33+
<DesignTime>True</DesignTime>
34+
<AutoGen>True</AutoGen>
35+
<DependentUpon>Resources.resx</DependentUpon>
36+
</Compile>
37+
</ItemGroup>
38+
39+
<ItemGroup>
40+
<EmbeddedResource Update="Properties\Resources.resx">
41+
<Generator>ResXFileCodeGenerator</Generator>
42+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
43+
</EmbeddedResource>
44+
</ItemGroup>
45+
46+
</Project>

HTMLToQPDF.Example/MainWindow.xaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<Window
2+
x:Class="HTMLToQPDF.Example.MainWindow"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:hc="https://handyorg.github.io/handycontrol"
7+
xmlns:local="clr-namespace:HTMLToQPDF.Example"
8+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
xmlns:vm="clr-namespace:HTMLToQPDF.Example.ViewModels"
10+
Title="HTMLToQPDF"
11+
Width="800"
12+
Height="450"
13+
MinWidth="300"
14+
MinHeight="250"
15+
mc:Ignorable="d">
16+
17+
<Window.DataContext>
18+
<vm:MainWindowViewModel />
19+
</Window.DataContext>
20+
21+
<DockPanel LastChildFill="True">
22+
<DockPanel Margin="5" DockPanel.Dock="Bottom">
23+
<StackPanel
24+
DockPanel.Dock="Right"
25+
Orientation="Horizontal">
26+
<CheckBox
27+
Margin="5"
28+
Content="Custom Styles"
29+
IsChecked="{Binding CustomStyles}" />
30+
<Button
31+
Margin="5"
32+
Command="{Binding CreatePDFCommand}"
33+
Content="Create PDF"
34+
Style="{StaticResource ButtonPrimary}" />
35+
</StackPanel>
36+
<StackPanel Orientation="Horizontal">
37+
<Button
38+
Margin="5"
39+
Command="{Binding SelectSavePathCommand}"
40+
Content="Select the save path" />
41+
<TextBlock
42+
Margin="5"
43+
HorizontalAlignment="Left"
44+
Style="{StaticResource TextBlockDefault}"
45+
Text="{Binding SavePath}"
46+
TextTrimming="CharacterEllipsis"
47+
ToolTip="{Binding SavePath}" />
48+
</StackPanel>
49+
</DockPanel>
50+
51+
<hc:TextBox
52+
Margin="5"
53+
Padding="10"
54+
VerticalContentAlignment="Top"
55+
hc:InfoElement.Placeholder="&lt;body&gt; Hello world! &lt;/body&gt;"
56+
AcceptsReturn="True"
57+
Text="{Binding HTML, UpdateSourceTrigger=PropertyChanged}"
58+
TextWrapping="Wrap" />
59+
</DockPanel>
60+
</Window>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Windows;
2+
3+
namespace HTMLToQPDF.Example
4+
{
5+
/// <summary>
6+
/// Interaction logic for MainWindow.xaml
7+
/// </summary>
8+
public partial class MainWindow : Window
9+
{
10+
public MainWindow()
11+
{
12+
InitializeComponent();
13+
}
14+
}
15+
}

HTMLToQPDF.Example/Properties/Resources.Designer.cs

Lines changed: 92 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)