1

Im using the Winnovative library to convert HTML Code to PDF Documents. I am having the problem when converting HTML with CSS Grid Code in it: The CSS Grid items are just displayed under each other.

HTML Code

<!DOCTYPE html>
<html>
<head>
<style>
.item1 { grid-area: header; }
.item2 { grid-area: menu; }
.item3 { grid-area: main; }
.item4 { grid-area: right; }
.item5 { grid-area: footer; }

.grid-container {
  display: grid;
  grid-template-areas:
    'header header header header header header'
    'menu main main main right right'
    'menu footer footer footer footer footer';
  gap: 10px;
  background-color: #2196F3;
  padding: 10px;
}

.grid-container > div {
  background-color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 20px 0;
  font-size: 30px;
}
</style>
</head>
<body>

<h1>Grid Layout</h1>

<p>This grid layout contains six columns and three rows:</p>

<div class="grid-container">
  <div class="item1">Header</div>
  <div class="item2">Menu</div>
  <div class="item3">Main</div>  
  <div class="item4">Right</div>
  <div class="item5">Footer</div>
</div>

</body>
</html>

PDF Output enter image description here

My input to the topic

For me it seems as if the Winnovative library cannot work with CSS Grids. As i can see from the changelogs the Library is still getting updates. So maybe it's just a bug in the Library. I will try to contact the support of the library.ยจ A very similair question has already been asked but without any answers.

For Plan B:

  • I know that tables work with the Winnovative library. Is there a way to convert CSS Grids into HTML tables?
  • Are there any other ideas and hotfixes for this problem?
Nightscape
  • 464
  • 6
  • 19

0 Answers0