ivmarcos/react-to-pdf

Is it possible to generate header in all pages while using react-calendar-timeline

Opened this issue · 5 comments

@ivmarcos Very good package!

We are using this package to generate PDF of a timeline. react-calendar-timeline is the package that we are using to render calendar timeline.

And we are able to generate PDF successfully. But only requirement we have now is to print calendar header in all pages.

Please check below pdf for how it is printing now.

page (11).pdf

Let us know if it is possible to get headers in all pages. Any existing example to print header component in all pages also works. Thanks

Hey @prasanthLalapeta thanks! At the moment, there's no straightforward way to do this. I've been working on a new feature that should be added soon to support easy support for headers and footers, just need to tie up some loose ends.

Here's an example of how you could do it in the meantime: https://codesandbox.io/s/gracious-proskuriakova-6nhlwh?file=/src/ExampleHeaderFooter.tsx

image

Awesome @ivmarcos 🤩

For now I will use your example code that you provided. Thanks!

Hi @ivmarcos

Is it possible to set different margin sizes for each page ? Because in our application, header height will be dynamic.

Thanks

Hi @prasanthLalapeta. Hum, I'm not seeing how that could be done 🤔. Maybe you should set a max-height for the header and adequate the top margin to make everything fit on all pages.

I've been working on a new feature that should be added soon to support easy support for headers and footers, just need to tie up some loose ends.

@ivmarcos can't wait for this feature, it'd be so much helpful. Any update on how soon could we expect it?👀