Nreco C# WkHtmlToPdf wrapper flex wrap

370 Views Asked by At

I cant seem to find a combination of prefixes for flex that enables flex wrapping using the Nreco HTML to PDF componment.

.container {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient:horizontal;
-webkit-box-direction:normal;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
}

.item {
flex: 1 1 16.6%;
-webkit-box-flex: 1;
-webkit-flex: 1;
-webkit-basis: 16.6%;  
}

When rendered in Chrome etc I get the wrap once the row is filled with items at least 16.6% width of the container but via the WkHtmlToPdf the elements are all inline.

Any ideas?

Thanks

1

There are 1 best solutions below

0
On

Wkhtmltopdf 0.12.x (latest stable release is 0.12.6) is based on modified QtWebKit 4.8; this version was released about 10 years ago, and it doesn't support modern CSS3 things like flex/grid layouts. You need to format input HTML like for legacy browsers.

There was a branch that uses newer QtWebKit (0.13a) but it seems it is frozen in 'forever alpha' which misses many critical things that 0.12.6 can do. Wkhtmltopdf is widely used (as a time-proven tool for PDF generation by HTML templates) but at the same time there are no active maintainers at this moment.