# File lib/pdf/writer/graphics.rb, line 540 540: def add_image_from_file(image, x, y, width = nil, height = nil, link = nil) 541: data = nil 542: 543: if image.respond_to?(:read) 544: data = image.read 545: else 546: open(image, 'rb') { |ff| data = ff.read } 547: end 548: 549: add_image(data, x, y, width, height, nil, link) 550: end