
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
QuestPDF.HTML is an extension for QuestPDF that allows to generate PDF from HTML. Originally created by Relorer (https://github.com/Relorer/HTMLToQPDF), Modified by JeremyVm
Relorer.QuestPDF.HTML is an extension for QuestPDF that allows to generate PDF from HTML
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.
The simplest example of use:
Document.Create(container =>
{
container.Page(page =>
{
page.Content().Column(col =>
{
col.Item().HTML(handler =>
{
handler.SetHtml(html);
});
});
});
}).GeneratePdf(path);
I strongly recommend overloading the image upload method, because the outdated WebClient is used by default without using asynchronous. To do this, you can use the OverloadImgReceivingFunc:
col.Item().HTML(handler =>
{
handler.OverloadImgReceivingFunc(GetImgBySrc);
handler.SetHtml(html);
});
You can customize the styles of text and containers for tags:
handler.SetTextStyleForHtmlElement("div", TextStyle.Default.FontColor(Colors.Grey.Medium));
handler.SetTextStyleForHtmlElement("h1", TextStyle.Default.FontColor(Colors.DeepOrange.Accent4).FontSize(32).Bold());
handler.SetContainerStyleForHtmlElement("table", c => c.Background(Colors.Pink.Lighten5));
handler.SetContainerStyleForHtmlElement("ul", c => c.PaddingVertical(10));
You can set the vertical padding size for lists. This padding will not apply to sub-lists:
handler.SetListVerticalPadding(40);
You can use HTMLToQPDF.Example to try out the capabilities of this extension.
Default Styles | Options for changing styles |
![]() | ![]() |
FAQs
QuestPDF.HTML is an extension for QuestPDF that allows to generate PDF from HTML. Originally created by Relorer (https://github.com/Relorer/HTMLToQPDF), Modified by JeremyVm
We found that questpdf.html demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.