attachment_fu icon indicating copy to clipboard operation
attachment_fu copied to clipboard

displaying pdf attachment inline, in the view (problem with browsers on Windows)

Open arta opened this issue 14 years ago • 2 comments

This is not an attachment_fu issue, I think, but somebody here may know what the problem is.

I have my attachments in the cloud. When I want to display an attached file in my rails app's view, I write (in the view, haml):

= image_tag @model.attachment.public_filename

and the attachment (image or pdf) is neatly displayed inline in the view.

But this only works on a Mac. The same page accessed from a browser running on Windows displays broken image holder for pdf attachments (no problem with images).

Why is that? How to fix that? How do I display a pdf attachment inline in a browser on Windows? I've searched around and found nothing. So, I post the question here.

Suggestion and help appreciated, Thanks, martin

arta avatar Jun 09 '10 23:06 arta

You're right not an attachment_fu issue. Last I checked you can't display it inline without using some sort of plugin as the browser does what the user wants. Also a PDF doesn't belong in an tag so no wonder you're getting a broken image icon :-)

parndt avatar Jun 10 '10 04:06 parndt

Thanks, would you know the plugin? The broken image icon appears on Windows only. Browsers running on MacOS display the pdfs as if they were images (which in a sense they are, those are scanned documents, pdf takes up less memory then jpg). If this is not a bug, then what image tag handles is a matter of opinion/interpretation. After all, it's not like there are natural laws governing the contents of HTML tags. Or maybe there is a need for a doc tag?

arta avatar Jun 10 '10 13:06 arta