is it possible evalute js code in wkhtmltopdf 0.12.5?

Viewed 16

i am trying to run this code before converting html to pdf to give all elements the same height.

<script>
  var rowWrappArr = [...document.querySelectorAll(".block__row-wrapp")];
  rowWrappArr.forEach((currentRow, index) => {
    var currentRowWrappHeight = rowWrappArr[index].offsetHeight;
    var currentRowElemsArr = [...currentRow.children];
    currentRowElemsArr.forEach((currentRowChild) => {
      var currentRowChildElem = [...currentRowChild.children][0];
      if (currentRowChildElem && currentRowChildElem.style) {
        currentRowChildElem.style.height = currentRowWrappHeight + "px";
      }
    });
  });
</script>

i use command

wkhtmltopdf ../../test.html --enable-javascript --javascript-delay 10000 test.pdf

but i get only white sheet as a result. I'm not sure if I understand correctly how wkhtmltopdf works with javascript. I also tried using var according to one of the tip it did not help. wkhtmltopdf version is 0.12.5

0 Answers
Related