Class: Pdfrb::Model::Type::BorderStyle
- Inherits:
-
Cos::Dictionary
- Object
- Object
- Cos::Dictionary
- Pdfrb::Model::Type::BorderStyle
- Defined in:
- lib/pdfrb/model/type/border_style.rb
Overview
BorderStyle (ISO 32000-2 §12.5.4, PDF 1.2+). The /BS dict on an annotation, controlling line width, style, and dash pattern.
Instance Attribute Summary
Attributes inherited from Object
Instance Method Summary collapse
- #beveled? ⇒ Boolean
-
#dash ⇒ Object
/D — optional, dash pattern array (only when style == :D).
- #dashed? ⇒ Boolean
- #inset? ⇒ Boolean
- #solid? ⇒ Boolean
-
#style ⇒ Object
/S — optional, border style name (default :S).
- #underline? ⇒ Boolean
-
#width ⇒ Object
/W — optional, border width in points (default 1).
Methods inherited from Cos::Dictionary
#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, merged_field, own_fields, #pdf_type, register_type, type_map, #validate
Methods inherited from Object
#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type
Constructor Details
This class inherits a constructor from Pdfrb::Model::Cos::Dictionary
Instance Method Details
#beveled? ⇒ Boolean
30 |
# File 'lib/pdfrb/model/type/border_style.rb', line 30 def beveled?; style == :B; end |
#dash ⇒ Object
/D — optional, dash pattern array (only when style == :D).
24 25 26 |
# File 'lib/pdfrb/model/type/border_style.rb', line 24 def dash value[:D] end |
#dashed? ⇒ Boolean
29 |
# File 'lib/pdfrb/model/type/border_style.rb', line 29 def dashed?; style == :D; end |
#inset? ⇒ Boolean
31 |
# File 'lib/pdfrb/model/type/border_style.rb', line 31 def inset?; style == :I; end |
#solid? ⇒ Boolean
28 |
# File 'lib/pdfrb/model/type/border_style.rb', line 28 def solid?; style == :S; end |
#style ⇒ Object
/S — optional, border style name (default :S). S = solid, D = dashed, B = beveled, I = inset, U = underline.
19 20 21 |
# File 'lib/pdfrb/model/type/border_style.rb', line 19 def style (value[:S] || :S).to_sym end |
#underline? ⇒ Boolean
32 |
# File 'lib/pdfrb/model/type/border_style.rb', line 32 def underline?; style == :U; end |
#width ⇒ Object
/W — optional, border width in points (default 1).
13 14 15 |
# File 'lib/pdfrb/model/type/border_style.rb', line 13 def width value[:W] || 1 end |