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
I have a fresh project Console App, .NET 8. I have installed PDFSharp 6.2.0-preview-1 and HtmlRenderer.PdfSharp (1.5.1-beta-1) and HtmlRenderer.Core (1.5.1-beta-1).
My code is very simple from the readme.txt:
PdfDocument pdf = PdfGenerator.GeneratePdf("<p><h1>Hello World</h1>This is html rendered text</p>", PageSize.A4);
pdf.Save("C:\\Users\\username\\Downloads\\document.pdf");
When I debug the project, I get this exception:
System.MissingMethodException: 'Method not found: 'PdfSharp.Drawing.XGraphics PdfSharp.Drawing.XGraphics.CreateMeasureContext(PdfSharp.Drawing.XSize, PdfSharp.Drawing.XGraphicsUnit, PdfSharp.Drawing.XPageDirection)'.'
Here are some details:
Source: "HtmlRenderer.PdfSharp"
StackTrace:
at TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.AddPdfPages(PdfDocument document, String html, PdfGenerateConfig config, CssData cssData, EventHandler1 stylesheetLoad, EventHandler1 imageLoad)
at TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf(String html, PdfGenerateConfig config, CssData cssData, EventHandler1 stylesheetLoad, EventHandler1 imageLoad)
at TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf(String html, PageSize pageSize, Int32 margin, CssData cssData, EventHandler1 stylesheetLoad, EventHandler1 imageLoad)
at Program.
$(String[] args) in C:\Company\Projects\C_Sharp\Test\GeneratePdf\GeneratePdf\Program.cs:line 12
I've created a new project with .NET Framework 4.7.2 and installed HtmlRenderer.PdfSharp (1.5.1-beta-1) and HtmlRenderer.Core (1.5.1-beta-1). Here the code works fine without error. Is it an issue with .NET?
Any help appriciated. Thanks in advance.
The text was updated successfully, but these errors were encountered:
I have a fresh project Console App, .NET 8. I have installed PDFSharp 6.2.0-preview-1 and HtmlRenderer.PdfSharp (1.5.1-beta-1) and HtmlRenderer.Core (1.5.1-beta-1).
My code is very simple from the readme.txt:
When I debug the project, I get this exception:
Here are some details:
Source: "HtmlRenderer.PdfSharp"
StackTrace:
I've created a new project with .NET Framework 4.7.2 and installed HtmlRenderer.PdfSharp (1.5.1-beta-1) and HtmlRenderer.Core (1.5.1-beta-1). Here the code works fine without error. Is it an issue with .NET?
Any help appriciated. Thanks in advance.
The text was updated successfully, but these errors were encountered: