mileszs / wicked_pdf

PDF generator (from HTML) plugin for Ruby on Rails
http://www.mileszs.com/wicked-pdf-plugin
MIT License
3.53k stars 642 forks source link

Rendering Filepicker images #372

Open bcackerman opened 9 years ago

bcackerman commented 9 years ago

I render filepicker images (ex. https://www.filepicker.io/api/file/KidMFBsnQ46vZ2E5UnHc+file.jpeg/convert?fit=clip&h=100&w=100) using image_tag like this:

= image_tag image.filepicker_url+'+file.'+image.mime_type.split('/')[-1]+'/convert?fit=clip&h=100&w=100', {class: 'invoice-image image-thumb-70-width'}

which displays normally in HTML but PDF displays nothing, just a blank.

I used wicked_pdf_image_tag like so:

= wicked_pdf_image_tag image.filepicker_url+'+file.'+image.mime_type.split('/')[-1]+'/convert?fit=clip&h=100&w=100', {class: 'invoice-image image-thumb-70-width'}

but get undefined method 'pathname' for nil:NilClass

What's going on? Am I able to use Filepicker to show images in a PDF version of a page?

unixmonkey commented 9 years ago

@bcackerman Have you tried just using image_tag instead of wicked_pdf_image_tag?

Since the images are on a remote server, they aren't served through the asset pipeline, there should be no need for wicked_pdf_image_tag.

bcackerman commented 9 years ago

Yeah that's what I'm using now. Take a peak: PDF version: https://www.printavo.com/invoice/359c3938197387f15e3f5551f5a09ef4.pdf Debug version: https://www.printavo.com/invoice/359c3938197387f15e3f5551f5a09ef4.pdf?debug=1

unixmonkey commented 9 years ago

Could you show me the erb code for the Wooden Cotton logo as well as the Seen logo?

bcackerman commented 9 years ago

Yeah = image_tag account.logo_url(:thumb2x), class: "img-responsive" I'm using carrierwave where you pass in the size of the image you'd like