Module: Sumi::Graphics::Mixtures::Export
- Defined in:
- graphics/lib/sumi/graphics/mixtures/export.rb
Overview
DSL helpers for native SVG export formats. Export CSS is a late adjustment after document checks. Its supported XML endings and cascade limitations are documented in Sundries::Export. The source callback receives SVG after CSS insertion.
Instance Method Summary collapse
-
#PDF(path = nil, **kwargs) {|svg| ... } ⇒ String
Exports the document as PDF.
-
#PNG(path = nil, **kwargs) {|svg| ... } ⇒ String
Exports the document as PNG.
Instance Method Details
#PDF(path = nil, **kwargs) {|svg| ... } ⇒ String
Exports the document as PDF. Relative paths are expanded, missing parent directories are created after export validation, and an existing file is replaced. An existing directory target uses the caller-derived default PDF name.
96 97 98 |
# File 'graphics/lib/sumi/graphics/mixtures/export.rb', line 96 def PDF(path = nil, **kwargs, &block) Runner.(self, path, caller_path: caller_locations(1, 1).first&.path, **kwargs, format: :pdf, &block) end |
#PNG(path = nil, **kwargs) {|svg| ... } ⇒ String
Exports the document as PNG. Relative paths are expanded, missing parent directories are created after export validation, and an existing file is replaced. An existing directory target uses the caller-derived default PNG name.
121 122 123 |
# File 'graphics/lib/sumi/graphics/mixtures/export.rb', line 121 def PNG(path = nil, **kwargs, &block) Runner.(self, path, caller_path: caller_locations(1, 1).first&.path, **kwargs, format: :png, &block) end |