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

Closed
ericdfields opened this Issue Dec 17, 2012 · 0 comments

Comments

Projects
None yet
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: foo.name)
sg_footer_url = url_helpers.footer_foo_url(foo, host: configatron.host_domain)

pdf = PDFKit.new 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?

Thanks.

pallymore closed this Mar 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment