Opening pdf data as image in rails views -
i have used rails 4, views <div> <%=image_tag(some_method_path), class: 'image-view' %> </div> controller method def some_method @label_image = base64_incoded image hex send_data @label_image, :type => 'application/pdf', :disposition => 'inline' end the image not opening in view opening pdf if run url in window. how display pdf image in div ? any appreciated as far understood, trying render preview image tag of pdf document. however, not automatic task, , browser won't magically perform conversion you. you need library render pdf , capture preview. not rails problem, it's generic pdf conversion problem. note. question similar how have pdf viewer in ruby