-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathHTMLDescriptor.cs
More file actions
36 lines (30 loc) · 977 Bytes
/
HTMLDescriptor.cs
File metadata and controls
36 lines (30 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using HTMLToQPDF.Components;
using HTMLToQPDF.Utils;
using QuestPDF.Infrastructure;
namespace HTMLQuestPDF
{
public class HTMLDescriptor
{
internal HTMLComponent PDFPage { get; } = new HTMLComponent();
public void SetHtml(string html)
{
PDFPage.HTML = html;
}
public void OverloadImgReceivingFunc(GetImgBySrc getImg)
{
PDFPage.GetImgBySrc = getImg;
}
public void SetTextStyleForHtmlElement(string tagName, TextStyle style)
{
PDFPage.TextStyles[tagName.ToLower()] = style;
}
public void SetContainerStyleForHtmlElement(string tagName, Func<IContainer, IContainer> style)
{
PDFPage.ContainerStyles[tagName.ToLower()] = style;
}
public void SetListVerticalPadding(float value, Unit unit = Unit.Point)
{
PDFPage.ListVerticalPadding = UnitUtils.ToPoints(value, unit);
}
}
}