Daniel.Sirz-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2007-Mar-05 17:58 UTC
Displaying Binary Image
Hi There, hopefully this is the right group to solve my Problem: I Need to display an image in a PDF Document. The image is created via another webseite for example: http://xyz.com?barcode=123456 The Image to display is a barcode and its type is PNG. All I want to do is to integrate this image into a PDF Document (generated with pdflib). I recieve a binary coded input stream but i don''t know how to display this in the PDF, I would be glad if somebody could help me out. Thanks a lot, Daniel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I have not yet worked with pdflib, but if you can incorporate the image into the PDF document using an external link then here is an example of how to provide the link: Add a method similar to this in your controller class: def picture @picture = Picture.find(params[:id]) send_data(@picture.data, :filename => @picture.name, :type => @picture.content_type, :disposition => "inline") end and link to it like: /mycontoller/picture/123 On Mar 5, 12:58 pm, "Daniel.S...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" <Daniel.S...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi There, > > hopefully this is the right group to solve my Problem: > > I Need to display an image in a PDF Document. > > The image is created via another webseite for example:http://xyz.com?barcode=123456 > > The Image to display is a barcode and its type is PNG. > > All I want to do is to integrate this image into a PDF Document > (generated with pdflib). > > I recieve a binary coded input stream but i don''t know how to display > this in the PDF, > > I would be glad if somebody could help me out. > > Thanks a lot, > > Daniel--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---