1

I'm using wkhtmltopdf via subprocess to generate PDFs in a python flask web app. It works great for most html input I give, but applies some very weird formatting in certain cases. For some cases, I need to append the html block together 5 times. In that case, the PDFs generated contain multiple blank pages in between content (which I would rather not have).

The format of the HTML I provide is the following:

<body>
    <center>
        <table height="100%" width="100%" id="backgroundTable" style="
        height: 100%;
        width: 100%;">
               <!-- More content -->
        </table>
    </center>
</body>

I have found that the culprits are the height="100%" width="100%" and style="height: 100%; width: 100%;" calls for the <table> element.

Does anyone know why that would cause the issue?

0 Answers0