Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Main PDF content not getting styled, header & footer is #9

ericdfields opened this Issue · 0 comments

2 participants


I've got the following code in a Rails worker:

foo = Foo.find(foo_id)

url_helpers = Rails.application.routes.url_helpers

sg_url = url_helpers.foo_url(foo, host: configatron.host_domain)
sg_header_url = url_helpers.header_foo_url(foo, host: configatron.host_domain, name:
sg_footer_url = url_helpers.footer_foo_url(foo, host: configatron.host_domain)

pdf = sg_url, header_html: sg_header_url, footer_html: sg_footer_url, margin_top: '1.5in', margin_right: '.5in', margin_bottom: '1in', margin_left: '.5in'

This works almost as expected. The caveat is the header & footer html respect the stylesheet that's being served in each resource, but the main content, foo, isn't being styled.

Foo, the header and the footer all have the same stylehseet_include_tag.

Also, it renders fine on dev but not on staging or production (latter two both heroku).

I'm going to try manually testing out different versions of wkhtmltopdf on staging. Is it likely the binary or something about how I'm generating my pdfkit?


@pallymore pallymore closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.