How to remove a css tag that breaks PDF rendition?


I have found that a … body{…} tag in my html input breaks the PDF generation, only the first page is in the output.
I can’t control the input HTML but I would like to use the JavaScript file used to load and pre-process the page before PDF generation to detect and remove that particular tag from the input.
Maybe someone has done something similar and could provide some directions?
John Marelius