Preserve CSS Form Styling In Rendered PDFs

What I’m trying to do:

My apologies if this has been addressed elsewhere; I did search but couldn’t find any posts or comments that addressed this specific issue, which seemed strange because surely I’m not the first to encounter it.

Anyway, I went to the trouble of styling a form with CSS–relatively simple changes to border weights, colors, corner radii, etc.–with no remote resources (fonts, etc.) called upon.

However, none of the styling is preserved when render_form() is called server-side. Even the basic, built-in monospace font used in the form is abandoned when the PDF is rendered, and replaced with whatever the standard font is. Is there a way to get server-side code to use the same CSS styling that’s applied to the client-side form?

Hi @demapped,

Chrome’s PDF rendering (which is what we use for PDFs) is a bit finicky and does mess up styling a bit, but usually not as far as “dropping everything, including simple font changes”. Can you come up with a minimal demonstration and drop a clone link to show what you’re seeing?

1 Like