ArthurHub / HTML-Renderer

Cross framework (WinForms/WPF/PDF/Metro/Mono/etc.), Multipurpose (UI Controls / Image generation / PDF generation / etc.), 100% managed (C#), High performance HTML Rendering library.
https://htmlrenderer.codeplex.com/
BSD 3-Clause "New" or "Revised" License
1.24k stars 522 forks source link

CSS Element "element:nth-child(even)" doesn't seem to be recognized #172

Closed erythana closed 3 years ago

erythana commented 4 years ago

Hi,

it seems that the CSS Pseudoclass element:nth-child() doesn't seem to work. For example tr:nth-child(even) The CSS formating is just skipped - normal styling to tr is applied without problems.

Im using the latest versions (beta), both for HTMLRenderer and PDFSharp. Im generating the HTML String (which validates correct) and my CSS also works directly in browsers.

Im doing the following: TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerateConfig config = new TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerateConfig(); config.PageOrientation = PdfSharp.PageOrientation.Landscape; config.PageSize = PdfSharp.PageSize.A4; PdfSharp.Pdf.PdfDocument pdf = TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf(htmlstring, config); pdf.Save(pathtopdf);

erythana commented 4 years ago

Oh, thats wrong! Just the background color or images dont get rendered... I have no clue why