Closed himadrinath closed 2 months ago
@JeremyVm can u help me with this
@himadrinath We'll need a bit more information in regards to what you're trying to do?
Do you have a working code sample / repo so we can reproduce / test it?
@JeremyVm here is the example
internal class Program
{
static void Main(string[] args)
{
QuestPDF.Settings.License = LicenseType.Community;
string html = "<ol><li><p>Measurements in the same patient can show physiological & analytical variations. Three serial samples 1 week apart are recommended for Total Cholesterol, Triglycerides, HDL & LDL Cholesterol. </p></li><li><p>Lipid Association of India (LAI) recommends screening of all adults above the age of 20 years for Atherosclerotic Cardiovascular Disease (ASCVD) risk factors especially lipid profile. This should be done earlier if there is family history of premature heart disease, dyslipidemia, obesity or other risk factors</p></li></ol><h3>ASCVD Risk Stratification & Treatment goals in Indian population</h3><ol><li><p>Indians are at very high risk of developing ASCVD, they usually get the disease at an early age, have a more severe form of the disease and have poorer outcome as compared to the western populations</p></li><li><p>Many individuals remain asymptomatic before they get heart attack, ASCVD risk helps to identify high risk individuals even when there is no symptom related to heart disease</p></li><li><p>ASCVD risk category helps clinician to decide when to consider therapy and what should be the treatment goal</p></li></ol><h3 style=\"text-align: center\"><mark>Treatment Goals as per Lipid Association of India 2020</mark></h3><table class=\"tiptap\" style=\"minWidth: 125px\"><colgroup><col><col><col><col><col></colgroup><tbody><tr><th colspan=\"1\" rowspan=\"2\"><p style=\"text-align: center\">ASCVD RISK </p><p style=\"text-align: center\">CATEGORY@</p></th><th colspan=\"2\" rowspan=\"1\"><p style=\"text-align: center\">CONSIDER THERAPY</p></th><th colspan=\"2\" rowspan=\"1\"><p style=\"text-align: center\">TREATMENT GOAL</p></th></tr><tr><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">LDL CHOLESTEROL</p><p style=\"text-align: center\">(LDL-C)(mg/dL)</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">NON HDL CHLOESTEROL</p><p style=\"text-align: center\">(NON HDL-C) (mg/dL)</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">LDL CHOLESTEROL</p><p style=\"text-align: center\">(LDL-C)(mg/dL)</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">NON HDL CHLOESTEROL</p><p style=\"text-align: center\">(NON HDL-C) (mg/dL)</p></td></tr><tr><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">Extreme (A)</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=50</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=80</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><50 (Indispensable)</p><p style=\"text-align: center\"><30 (Optional)</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><80</p></td></tr><tr><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">Extreme (B)</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=30</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=60</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><30</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><60</p></td></tr><tr><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">Very High</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=50</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=80</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><50</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><80</p></td></tr><tr><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">High</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=70</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=100</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><70</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><100</p></td></tr><tr><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">Moderate</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=100</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=130</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><100</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><130</p></td></tr><tr><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">Low</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=130*</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\">>=160*</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><100</p></td><td colspan=\"1\" rowspan=\"1\" style=\"background-color: null\"><p style=\"text-align: center\"><130</p></td></tr></tbody></table><p>* In low risk patient, consider therapy after an initial non-pharmacological intervention for at least 3 months</p><p></p><p><strong>@To know your risk category click on bit.ly link sent on your registered mobile number, answer the questionnaire, the ASCVD risk report can be downloaded from website.</strong></p>";
var document = Document.Create(container =>
{
container.Page(page =>
{
page.Content().Column(col =>
{
col.Item().HTML(handler =>
{
handler.SetHtml(html);
});
});
});
});
document.ShowInPreviewer();
}
}
package reference
<PackageReference Include="QuestPDF" Version="2024.6.1" />
<PackageReference Include="QuestPDF.Barcodes" Version="2024.3.1" />
<PackageReference Include="QuestPDF.HTML" Version="1.0.0" />
If I am not mistaken, this could be a breaking change introduced in the 2024.6.0 release. It extends the Element()
method to collect context information about where it is invoked. That is further used to enhance the debugging experience in case of layout issues.
This change is invisible to a typical development workflow, as the compiler handles all attributes. However, it may require rebuilding the nuget library.
public static void Element(
this IContainer parent,
Action<IContainer> handler,
[CallerArgumentExpression("handler")] string handlerName = null, // <- invisible in IDE
[CallerMemberName] string parentName = "",
[CallerFilePath] string sourceFilePath = "",
[CallerLineNumber] int sourceLineNumber = 0)
My suggestion is to rebuild the HTMLToQPDF library targeting QuestPDF 2024.6.X.
I am very sorry for this inconvenience. I strongly believe that this change is highly valuable to improve development experience now, and especially in the upcoming releases.
@MarcinZiabek @JeremyVm thanks you guys. it working just updated to 1.2.0
@JeremyVm Thank you so much for the update and taking prompt action ❤️
@Relorer tried this but getting exception