Class: Pdf::Components::Logo
- Inherits:
-
Pdf::Component
- Object
- Pdf::Component
- Pdf::Components::Logo
- Defined in:
- lib/pdf/components/logo.rb
Instance Attribute Summary
Attributes inherited from Pdf::Component
Instance Method Summary collapse
Methods inherited from Pdf::Component
Constructor Details
This class inherits a constructor from Pdf::Component
Instance Method Details
#render(path, width: 120, height: nil, **_options) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/pdf/components/logo.rb', line 6 def render(path, width: 120, height: nil, **) raise Pdf::FileNotFoundError, "Logo not found: #{path}" unless File.exist?(path) opts = { width: width } opts[:height] = height if height @pdf.image path, **opts end |