ivmarcos / react-to-pdf

Generate pdf from react components
MIT License
271 stars 61 forks source link

Pdf not rendering as my webpage (Using TailwindCSS) #101

Open mimo-lbp opened 9 months ago

mimo-lbp commented 9 months ago

Hello, i wanted to use your beautifull library to convert my react components to pdf but with TailwindCSS i encoutered an "bug".

In fact, there is a form in my app : image

And when i click on "Generate PDF in the top left" with this config :

const options: Options = { filename: "using-function.pdf", resolution: Resolution.HIGH, method: "open", page: { margin: Margin.SMALL, format: "letter", }, };

My pdf i looking like this image

Any people already encoutered this "bug" ? I tried to set preflight in my tailwind.config at false and it worked properly but couldnt use Tailwind in my project image

JefferMarcelino commented 9 months ago

I am facing the same bug, did you find a solution?

joaogabrielfragosojardim commented 8 months ago

facing the same here

joaogabrielfragosojardim commented 8 months ago

facing the same here

Fixed changing the global.css:

@tailwind base; @layer base { img, canvas { @apply inline-block; } } @tailwind components; @tailwind utilities;