danfickle / openhtmltopdf

An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support. Now also with accessible PDF support (WCAG, Section 508, PDF/UA)!
https://danfickle.github.io/pdf-templates/index.html
Other
1.93k stars 359 forks source link

Ability to ignore HTML attributes #897

Open joshuajaharwood opened 1 year ago

joshuajaharwood commented 1 year ago

Hello,

I'm using openhtmltopdf to generate PDF pages from a received email. Outlook emails generate an @page CSS selector by default, which breaks PDF formatting. Could there be support for ignoring certain attributes when rendering PDFs?

Many thanks, Josh

SharkFourSix commented 1 year ago

One way you do that is pass the template into some XML/HTML manipulator to remove the attribute