Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4.2.1 Images do not show in generated pdf #44

Open
sailorxyz opened this issue Sep 25, 2015 · 2 comments
Open

Rails 4.2.1 Images do not show in generated pdf #44

sailorxyz opened this issue Sep 25, 2015 · 2 comments

Comments

@sailorxyz
Copy link

I have a bunch of images in app/assets/images/ when I render the html view the images are present as one would expect. When I render the pdf view via princely they are not present I just get something like this: Bd header70 b cc0e9cd02bd0b2ec1f31f22bbfe90be47fec42de002e9f5445603b82b492bdaa

In my controller I have this:

    render :pdf => 'ConsultantsQuote',
           :template => 'quotes/show_consultant',
           :handlers => %w[erb],
           :formats => %w[pdf],
           :stylesheets => %w[application pdf],
           :layout => 'pdf',
           :disposition => 'inline', 
           :relative_paths => true 

In my view:

<%= image_tag("bd_header70_b.png") %>

What am I doing wrong? Thanks Paul Thompson

@gra1
Copy link

gra1 commented Jan 12, 2017

Same for me, images aren't render in pdf.

@gra1
Copy link

gra1 commented Jan 13, 2017

Just added in controller action flag relative_paths: false also if layout: false then need wrap view to html -> head and body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants