You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,43 @@ HTMLToQPDF is an extension for QuestPDF that allows to generate PDF from HTML
2
2
3
3
[QuestPDF](https://github.com/QuestPDF/QuestPDF) currently does not support inserting html into a pdf document. So I wrote a small library for this. It doesn't support the full functionality of html and css, but I think it should be enough for most cases.
4
4
5
-
You can use [HTMLToQPDF.Example](https://github.com/Relorer/HTMLToQPDF/tree/master/HTMLToQPDF.Example) to try out the capabilities of this extension.
5
+
The simplest example of use:
6
+
```
7
+
Document.Create(container =>
8
+
{
9
+
container.Page(page =>
10
+
{
11
+
page.HTML(handler =>
12
+
{
13
+
handler.SetHtml(html);
14
+
});
15
+
});
16
+
}).GeneratePdf(path);
17
+
```
18
+
**I strongly recommend overloading the image upload method, because the outdated WebClient is used by default without using asynchronous.**
19
+
To do this, you can use the OverloadImgReceivingFunc:
20
+
```
21
+
page.HTML(handler =>
22
+
{
23
+
handler.OverloadImgReceivingFunc(GetImgBySrc);
24
+
handler.SetHtml(html);
25
+
});
26
+
```
27
+
28
+
You can customize the styles of text and containers for tags:
0 commit comments