If have still a problem . Here is my code:
if @company.photo.attached?
@logo = @company.photo.download
end
respond_to do |format|
format.html
format.pdf do
pdf = ValuesPdf.new(current_user, current_company, @logo, view_context)
send_data pdf.render, filename: @documentname, type: "application/pdf", disposition: "attachment"
end
end
bounding_box([0, cursor] , width: 500 ) do
if @company.photo.attached?
image @logo, :width => 250, fit: [270, 270], position: :center
end