Wicked_pdf setting footer height or margin on page by page basis
Asked Answered
G

2

9

I have been using the Wicked PDF gem for generating pdfs. It has been working great.

However, I have run into a situation where a need to attach and have visible a large footer to the first page, but not the rest of the pages. To accomplish this I added a margin to the bottom of the body of the pdf as suggested in this post which gives the footer enough room to be visible.

This causes adverse side effects because it adds bottom margin to all of the pages not just this first page. I was hoping to only add margin to the first page and leave the rest of the pages unchanged.

I've tried to accomplish this with the use of javascript and css but have had no luck so far.

Thanks in advance

Guadalupe answered 2/9, 2016 at 18:31 Comment(0)
G
0

Unfortunately the solution is not straight forward. You would have to strip the pdf out to individual pages create a pdf of each page then stitch the pdfs back together. See this explanation

Guadalupe answered 9/9, 2016 at 17:29 Comment(0)
H
0

Checkout the documentation example for numbering pages https://github.com/mileszs/wicked_pdf#page-numbering

So it should be possible to have different footers using javascript

Check this solution wicked_pdf: Is it possible to have the header only show on the first page & the footer only on the last?

Helterskelter answered 6/9, 2016 at 19:38 Comment(0)
G
0

Unfortunately the solution is not straight forward. You would have to strip the pdf out to individual pages create a pdf of each page then stitch the pdfs back together. See this explanation

Guadalupe answered 9/9, 2016 at 17:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.