I am using Prawn 0.12.0 in a Rails 3.2.12 app.
If I have an image on my local server it can show in a standard rails view, and I can also have it shown in a Prawn PDF using the following code
@logo = company.logo_url(:large).to_s
image @logo, :fit => [83.mm, 26.mm]
So far, so good. If I change the location of the image to be on Amazon S3 I get the following
I am able to show in a standard Rails view no problem If I try to display the image in a Prawn pdf I get the following error
Argument error (https://mydomain.s3.amazonaws.com/uploads/company/logo/20/large_2275_logo.png not found):
And if I then copy and paste that url into a browser, the image shows fine.
So to recap...
Has anyone seen anything similar, or have any suggestions?
Michael
I had the same problem, I've solved with
require 'open-uri'
image open("hxxp://www.thesite.com/theimage.png")
With the recent releases of Prawn, you can achieve loading remote images without requiring open-uri;
image open("http://example.com/remote_image.pdf"), at: [300, 100], width: 100, height: 100
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With