HTML2PDF not handling display: none

I’m trying to use the HTML2PDF PHP library to generate a PDF starting from a complex HTML page. The PDF is being generated successfully, but the HTML elements of my source page that have style="display: none" are being displayed in the PDF. I need the elements that have display: none in the HTML to also be hidden in the PDF.

I thought that maybe HTML2PDF was failing to read the CSS class, so I moved the display: none to inline, but this did not solve the problem.

Then I thought maybe HTML2PDF couldn’t read inline stiles either, but when I changed the inline style to text-decoration: underline the text was actually underlined in the PDF!

Is it possible that the display CSS property is ignored?