react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Fixed footer per page

Open ewein opened this issue 7 years ago • 4 comments

Is it possible to set a fixed footer per page when wrap is true. I would like to set a fixed footer to display the current page and some other meta data. However when wrap is true, this footer is pushed to the bottom of the entire document.

Thanks for your help.

ewein avatar May 17 '19 17:05 ewein

For anyone who might be looking for the solution, the fixed prop will do the trick.

bewildergeist avatar Aug 30 '19 12:08 bewildergeist

I ran into an issue where my wrapping content inside nested flex views was preventing the fixed footer from rendering.

<Page>
  <View> // <-- container view 
    <MyFixedHeader style={{flex: 0.2}}/>
    <View style={{flex: 1}}>
      ...myContentThatWraps
    </View>
  </View> 
  <MyFixedFooter /> // <-- would only render on last page
</Page> 

Removing the container view and some of the flex styling allowed my fixed header/footer to render on all pages.

benRivello avatar Jan 13 '21 15:01 benRivello

@benRivello Could this be done without removing flex settings?

yogeshmuthuraj avatar Sep 27 '21 20:09 yogeshmuthuraj

I ran into an issue where my wrapping content inside nested flex views was preventing the fixed footer from rendering.

<Page>
  <View> // <-- container view 
    <MyFixedHeader style={{flex: 0.2}}/>
    <View style={{flex: 1}}>
      ...myContentThatWraps
    </View>
  </View> 
  <MyFixedFooter /> // <-- would only render on last page
</Page> 

Removing the container view and some of the flex styling allowed my fixed header/footer to render on all pages.

you need to set fixed prop in the component footer

elioenays avatar Nov 13 '23 13:11 elioenays