Class: PrawndownExt::Interface::CommandInterface
- Inherits:
-
Object
- Object
- PrawndownExt::Interface::CommandInterface
- Defined in:
- lib/prawndown-ext.rb
Constant Summary collapse
- COMMAND =
{ "text" => -> (args, pdf) { cl_text(args, pdf) }, "img" => -> (args, pdf) { cl_img(args, pdf) }, "quote" => -> (args,pdf) { cl_text_box(args, pdf) }, }
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.cl_img(args, pdf) ⇒ Object
33 34 35 36 37 |
# File 'lib/prawndown-ext.rb', line 33 def self.cl_img args, pdf pdf.image(args["path"], width: pdf.bounds.width, position: :center) end |
.cl_text(args, pdf) ⇒ Object
18 19 20 21 22 |
# File 'lib/prawndown-ext.rb', line 18 def self.cl_text args, pdf pdf.text args["text"], inline_format: true end |
.cl_text_box(args, pdf) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/prawndown-ext.rb', line 24 def self.cl_text_box args, pdf pdf.pad args["margin"] do pdf.indent args["margin"], args["margin"] do pdf.text args["text"], inline_format: true end end end |