openxml-docx 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/examples/drawing-ml +1 -1
  4. data/examples/image-embedding +141 -0
  5. data/examples/ochanomizu.jpg +0 -0
  6. data/lib/openxml/docx.rb +8 -0
  7. data/lib/openxml/docx/attribute_builder.rb +11 -1
  8. data/lib/openxml/docx/elements/book_fold_printing.rb +12 -0
  9. data/lib/openxml/docx/elements/book_fold_printing_sheets.rb +12 -0
  10. data/lib/openxml/docx/elements/book_fold_reverse_printing.rb +12 -0
  11. data/lib/openxml/docx/elements/drawing.rb +1 -1
  12. data/lib/openxml/docx/elements/embed_system_fonts.rb +14 -0
  13. data/lib/openxml/docx/elements/embed_true_type_fonts.rb +14 -0
  14. data/lib/openxml/docx/elements/font_alternate_name.rb +15 -0
  15. data/lib/openxml/docx/elements/font_character_set.rb +15 -0
  16. data/lib/openxml/docx/elements/font_panose_one.rb +15 -0
  17. data/lib/openxml/docx/elements/font_pitch.rb +15 -0
  18. data/lib/openxml/docx/elements/font_sig.rb +20 -0
  19. data/lib/openxml/docx/elements/save_subset_fonts.rb +14 -0
  20. data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +13 -11
  21. data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +1 -1
  22. data/lib/openxml/docx/elements/word_processing_drawing_position_h.rb +1 -11
  23. data/lib/openxml/docx/elements/word_processing_drawing_position_offset.rb +18 -1
  24. data/lib/openxml/docx/elements/word_processing_drawing_position_v.rb +1 -11
  25. data/lib/openxml/docx/elements/word_processing_drawing_wrap_coordinate.rb +26 -0
  26. data/lib/openxml/docx/elements/word_processing_drawing_wrap_polygon.rb +13 -0
  27. data/lib/openxml/docx/elements/word_processing_drawing_wrap_square.rb +17 -0
  28. data/lib/openxml/docx/elements/word_processing_drawing_wrap_through.rb +15 -0
  29. data/lib/openxml/docx/elements/word_processing_drawing_wrap_tight.rb +15 -0
  30. data/lib/openxml/docx/elements/word_processing_drawing_wrap_top_and_bottom.rb +14 -0
  31. data/lib/openxml/docx/elements/word_processing_groups_group_shape_properties.rb +13 -0
  32. data/lib/openxml/docx/elements/word_processing_groups_nv_shape_drawing_properties.rb +11 -0
  33. data/lib/openxml/docx/elements/word_processing_shapes_nv_drawing_properties.rb +17 -0
  34. data/lib/openxml/docx/package.rb +39 -13
  35. data/lib/openxml/docx/parts/document.rb +3 -2
  36. data/lib/openxml/docx/parts/fonts.rb +2 -1
  37. data/lib/openxml/docx/parts/footer.rb +2 -1
  38. data/lib/openxml/docx/parts/header.rb +2 -1
  39. data/lib/openxml/docx/parts/settings.rb +5 -0
  40. data/lib/openxml/docx/properties/tabs.rb +2 -0
  41. data/lib/openxml/docx/root_namespaces.rb +1 -1
  42. data/lib/openxml/docx/version.rb +1 -1
  43. data/lib/openxml/drawingml/elements/blip.rb +18 -0
  44. data/lib/openxml/drawingml/elements/blip_fill.rb +1 -1
  45. data/lib/openxml/drawingml/elements/fill_rectangle.rb +16 -0
  46. data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +6 -6
  47. data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +1 -1
  48. data/lib/openxml/drawingml/elements/picture_locks.rb +23 -0
  49. data/lib/openxml/drawingml/elements/picture_shape_properties.rb +13 -0
  50. data/lib/openxml/drawingml/elements/source_rectangle.rb +16 -0
  51. data/lib/openxml/drawingml/elements/stretch.rb +10 -0
  52. data/spec/elements/book_fold_printing_sheets_spec.rb +27 -0
  53. data/spec/elements/book_fold_printing_spec.rb +19 -0
  54. data/spec/elements/book_fold_reverse_printing_spec.rb +19 -0
  55. data/spec/elements/drawingml/blip_fill_spec.rb +8 -3
  56. data/spec/elements/drawingml/blip_spec.rb +47 -0
  57. data/spec/elements/drawingml/fill_rectangle_spec.rb +76 -0
  58. data/spec/elements/drawingml/graphic_frame_locks_spec.rb +47 -18
  59. data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +8 -3
  60. data/spec/elements/drawingml/non_visual_picture_drawing_properties_spec.rb +7 -2
  61. data/spec/elements/drawingml/picture_locks_spec.rb +122 -0
  62. data/spec/elements/drawingml/picture_shape_properties_spec.rb +21 -0
  63. data/spec/elements/drawingml/source_rectangle_spec.rb +76 -0
  64. data/spec/elements/drawingml/stretch_spec.rb +8 -0
  65. data/spec/elements/embed_system_fonts_spec.rb +19 -0
  66. data/spec/elements/embed_true_type_fonts_spec.rb +19 -0
  67. data/spec/elements/font_alternate_name_spec.rb +19 -0
  68. data/spec/elements/font_character_set_spec.rb +19 -0
  69. data/spec/elements/font_panose_one_spec.rb +19 -0
  70. data/spec/elements/font_pitch_spec.rb +21 -0
  71. data/spec/elements/font_sig_spec.rb +74 -0
  72. data/spec/elements/save_subset_fonts_spec.rb +19 -0
  73. data/spec/elements/word_processing_drawing_anchor_spec.rb +107 -25
  74. data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +1 -1
  75. data/spec/elements/word_processing_drawing_position_h_spec.rb +6 -5
  76. data/spec/elements/word_processing_drawing_position_v_spec.rb +6 -5
  77. data/spec/elements/word_processing_drawing_wrap_coordinate_spec.rb +40 -0
  78. data/spec/elements/word_processing_drawing_wrap_polygon_spec.rb +23 -0
  79. data/spec/elements/word_processing_drawing_wrap_square_spec.rb +65 -0
  80. data/spec/elements/word_processing_drawing_wrap_through_spec.rb +43 -0
  81. data/spec/elements/word_processing_drawing_wrap_tight_spec.rb +43 -0
  82. data/spec/elements/word_processing_drawing_wrap_top_and_bottom_spec.rb +30 -0
  83. data/spec/elements/word_processing_groups_group_shape_properties_spec.rb +21 -0
  84. data/spec/elements/word_processing_groups_nv_shape_drawing_properties_spec.rb +8 -0
  85. data/spec/elements/word_processing_shapes_nv_drawing_properties_spec.rb +64 -0
  86. data/spec/package_spec.rb +2 -2
  87. data/spec/parts/settings_spec.rb +6 -0
  88. data/spec/properties/table_border_spec.rb +2 -2
  89. data/spec/properties/table_cell_border_spec.rb +2 -2
  90. data/spec/style_spec.rb +2 -2
  91. data/spec/support/data/parts/document_with_children_part.xml +1 -1
  92. data/spec/support/data/parts/document_with_multiple_sections_part.xml +1 -1
  93. data/spec/support/data/parts/document_with_one_section_part.xml +1 -1
  94. data/spec/support/data/parts/empty_document_part.xml +1 -1
  95. data/spec/support/data/parts/settings_part.xml +1 -1
  96. data/spec/support/property_test_macros.rb +1 -1
  97. metadata +56 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 721596bd0a99e7649d104985afa53b7152101fa6
4
- data.tar.gz: e956ff4f80b2ce46f3022e5a05f92bb99e7057ef
3
+ metadata.gz: 281ebe5865109648134cd7d0e38f3dece19e3bb1
4
+ data.tar.gz: 5198b7f285a17344137d32f5f53044bd44f63e87
5
5
  SHA512:
6
- metadata.gz: bbfecbf3a5aa07b90d1909c0642926dc025cafd08866f75b283768c3b7e0943b88a29737bcd92a0e4de90e29a1011f35d9fdc8514480157f1238d67c8b91caf5
7
- data.tar.gz: a0aeb4b5b1032e62f3531498e9d3ffe4e27ef4e7834d41e80917fcb4edfa57c0eabbd4cfed81688245f8f30476a739f9da76d4bae7a38f7e9ea8f7ec78d0f8bc
6
+ metadata.gz: e405e98f203bbd647a9e29a164da5c4fee1f23e64092f56e9aefd73f4f7b5fcd5d29dbd9cd3292394b571e61216b2d0a23071a0a5d9e11174e02d3fe78f85f71
7
+ data.tar.gz: 41d7848b012173dac7a9b62819586d022d02c7bc6b2a36810c7e60c555f2fed5b18c6feb89ed205ca3ebf3e52bf95517181c64af23a5ecfac8d3cd26d524de6c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openxml-docx (0.10.0)
4
+ openxml-docx (0.10.1)
5
5
  nokogiri
6
6
  openxml-package (>= 0.2.2)
7
7
 
@@ -14,7 +14,7 @@ GEM
14
14
  json (1.8.3)
15
15
  method_source (0.8.2)
16
16
  mini_portile2 (2.0.0)
17
- nokogiri (1.6.7)
17
+ nokogiri (1.6.7.1)
18
18
  mini_portile2 (~> 2.0.0.rc2)
19
19
  openxml-package (0.2.2)
20
20
  nokogiri
data/examples/drawing-ml CHANGED
@@ -11,7 +11,7 @@ document = OpenXml::Docx::Package.new
11
11
  table = Table.new
12
12
  table.table_width.type = :auto
13
13
  table.table_width.width = 0
14
- table.table_layout = :fixed
14
+ table.table_layout.type = :fixed
15
15
 
16
16
  table_cell_margins = OpenXml::Docx::Properties::TableCellMargins.new
17
17
  start_margin = OpenXml::Docx::Properties::TableCellMargin.new(:start)
@@ -0,0 +1,141 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.push Dir.pwd + "/lib"
4
+ require "pry"
5
+ require "ox"
6
+ require "openxml/docx"
7
+ require "openxml/drawingml"
8
+
9
+ package = OpenXml::Docx::Package.new
10
+
11
+ include OpenXml::Docx::Elements
12
+ include OpenXml::DrawingML::Elements
13
+
14
+ text = Text.new("Some text that I want to include in my new OOXML document")
15
+
16
+ run = Run.new
17
+ run << text
18
+ paragraph = Paragraph.new
19
+ paragraph << run
20
+
21
+ package.document << paragraph
22
+
23
+ image_rid = package.embed_image(path: File.join(File.dirname(__FILE__), "ochanomizu.jpg"))
24
+
25
+ paragraph = Paragraph.new
26
+ run = Run.new
27
+
28
+ # This is the overall container for the drawing elements
29
+ drawing = Drawing.new
30
+
31
+ # This is the anchor that provides positioning information in Word
32
+ anchor = WordProcessingDrawingAnchor.new
33
+ anchor.allow_overlap = true
34
+ anchor.behind_document = false
35
+ anchor.layout_in_cell = true
36
+ anchor.locked = false
37
+ anchor.z_index = 1000
38
+ anchor.simple_position = false
39
+ anchor.distance_from_bottom = 0
40
+ anchor.distance_from_top = 0
41
+ anchor.distance_from_left = 0
42
+ anchor.distance_from_right = 0
43
+
44
+ # These elements are required to be children of anchor and supply the actual positioning information
45
+ simple_pos = WordProcessingDrawingSimplePosition.new
46
+ simple_pos.x = 0
47
+ simple_pos.y = 0
48
+ anchor << simple_pos
49
+ position_h = WordProcessingDrawingPositionH.new
50
+ position_h.relative_from = :column
51
+ position_offset = WordProcessingDrawingPositionOffset.new
52
+ position_offset.value = "0"
53
+ position_h << position_offset
54
+ anchor << position_h
55
+ position_v = WordProcessingDrawingPositionV.new
56
+ position_v.relative_from = :paragraph
57
+ position_offset = WordProcessingDrawingPositionOffset.new
58
+ position_offset.value = "0"
59
+ position_v << position_offset
60
+ anchor << position_v
61
+
62
+ # Extent is the size of the Object
63
+ extent = WordProcessingDrawingExtent.new
64
+ extent.extent_length = 599 * 20 # Convert pixels to EMU?
65
+ extent.extent_width = 393 * 20
66
+ anchor << extent
67
+
68
+ # One of the wrap properties is required
69
+ anchor << WordProcessingDrawingWrapNone.new
70
+
71
+ # Object (non-visual) properties are also required
72
+ doc_pr = WordProcessingDrawingObjectNvProperties.new
73
+ doc_pr.description = "ochanomizu.jpg"
74
+ doc_pr.object_name = "Ochanomizu but not from Tetsuwan Atomu"
75
+ doc_pr.id = 1
76
+ anchor << doc_pr
77
+
78
+ # This is the actual graphics object
79
+ graphic = Graphic.new
80
+ graphic_data = GraphicData.new
81
+ graphic_data.uri = "http://schemas.openxmlformats.org/drawingml/2006/picture"
82
+ pic_container = Picture.new
83
+
84
+ # Must also define the Picture's non-visual Properties
85
+ pic_nv_properties = NonVisualPictureProperties.new
86
+ nv_properties = NonVisualDrawingProperties.new
87
+ nv_properties.id = 0
88
+ nv_properties.picture_name = "Ochanomizu but not from Tetsuwan Atomu"
89
+ nv_properties.description = "ochanomizu.jpg"
90
+ pic_nv_properties << nv_properties
91
+ drawing_properties = NonVisualPictureDrawingProperties.new
92
+ picture_locks = PictureLocks.new
93
+ picture_locks.disallow_aspect_ratio_changes = true
94
+ picture_locks.disallow_arrowhead_changes = true
95
+ drawing_properties << picture_locks
96
+ pic_nv_properties << drawing_properties
97
+ pic_container << pic_nv_properties
98
+
99
+ # Blip Fill defines the picture that will fill the object's shape
100
+ blip_fill = BlipFill.new
101
+ pic_ref = Blip.new
102
+ pic_ref.embed = image_rid
103
+ stretch = Stretch.new
104
+ fill_rect = FillRectangle.new
105
+ stretch << fill_rect
106
+ blip_fill << pic_ref
107
+ blip_fill << stretch
108
+ blip_fill << SourceRectangle.new
109
+ pic_container << blip_fill
110
+
111
+ # Must also define the picture's shape properties
112
+ shape_properties = PictureShapeProperties.new
113
+ shape_properties.black_and_white_mode = :auto
114
+ preset_geometry = PresetGeometry.new
115
+ preset_geometry.preset = :rect
116
+ shape_properties << preset_geometry
117
+ transform = TransformEffect.new
118
+ offset = Offset.new
119
+ offset.x = 0
120
+ offset.y = 0
121
+ transform << offset
122
+ extent = Extents.new
123
+ extent.extent_length = 599 * 20
124
+ extent.extent_width = 393 * 20
125
+ transform << extent
126
+ shape_properties << transform
127
+ pic_container << shape_properties
128
+
129
+ graphic_data << pic_container
130
+ graphic << graphic_data
131
+
132
+ anchor << graphic
133
+ drawing << anchor
134
+ run << drawing
135
+ paragraph << run
136
+ package.document << paragraph
137
+
138
+ filename = "image_embedding_test.docx"
139
+ system "rm -f ~/Desktop/#{filename}" # -f so that we don't have an error if the file doesn't exist
140
+ package.save File.expand_path("~/Desktop/#{filename}")
141
+ exec "open ~/Desktop/#{filename}"
Binary file
data/lib/openxml/docx.rb CHANGED
@@ -7,6 +7,7 @@ module OpenXml
7
7
  REL_FOOTER = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer".freeze
8
8
  REL_FONT_TABLE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable".freeze
9
9
  REL_FONT = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/font".freeze
10
+ REL_IMAGE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image".freeze
10
11
 
11
12
  TYPE_STYLES = "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml".freeze
12
13
  TYPE_SETTINGS = "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml".freeze
@@ -15,6 +16,13 @@ module OpenXml
15
16
  TYPE_FONT_TABLE = "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml".freeze
16
17
  TYPE_XML = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml".freeze
17
18
  TYPE_OBSCURED_FONT = "application/vnd.openxmlformats-officedocument.obfuscatedFont".freeze
19
+ TYPE_IMAGE = {
20
+ jpeg: "image/jpeg".freeze,
21
+ png: "image/png".freeze,
22
+ gif: "image/gif".freeze,
23
+ bmp: "image/bmp".freeze,
24
+ tiff: "image/tiff".freeze
25
+ }
18
26
  end
19
27
  end
20
28
 
@@ -245,7 +245,7 @@ module OpenXml
245
245
  value = send(name)
246
246
  attr_name = "#{namespace}:#{display}"
247
247
  attr_name = "#{display}" if namespace.nil?
248
- attrs[attr_name] = value if value
248
+ attrs[attr_name] = value unless value.nil?
249
249
  end
250
250
  end
251
251
 
@@ -269,6 +269,16 @@ module OpenXml
269
269
  raise ArgumentError, message unless value =~ /[0-9A-F]{4}/
270
270
  end
271
271
 
272
+ def long_hex_number(value)
273
+ message = "Invalid #{name}: must be an eight-digit hex number, e.g., FFAC0013"
274
+ raise ArgumentError, message unless value =~ /^[0-9A-F]{8}$/
275
+ end
276
+
277
+ def hex_string(value)
278
+ message = "Invalid #{name}: must be a string of hexadecimal numbers, e.g. FFA23C6E"
279
+ raise ArgumentError, message unless value =~ /^[0-9A-F]+$/
280
+ end
281
+
272
282
  def integer(value)
273
283
  message = "Invalid #{name}: must be an integer"
274
284
  raise ArgumentError, message unless value.is_a?(Integer)
@@ -0,0 +1,12 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class BookFoldPrinting < Element
5
+ tag :bookFoldPrinting
6
+
7
+ attribute :value, expects: :true_or_false, displays_as: :val, namespace: :w
8
+
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class BookFoldPrintingSheets < Element
5
+ tag :bookFoldPrintingSheets
6
+
7
+ attribute :value, expects: :positive_integer, displays_as: :val, namespace: :w
8
+
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class BookFoldReversePrinting < Element
5
+ tag :bookFoldRevPrinting
6
+
7
+ attribute :value, expects: :true_or_false, displays_as: :val, namespace: :w
8
+
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,7 +1,7 @@
1
1
  module OpenXml
2
2
  module Docx
3
3
  module Elements
4
- class Drawing < Element
4
+ class Drawing < Container
5
5
  tag :drawing
6
6
  end
7
7
  end
@@ -0,0 +1,14 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class EmbedSystemFonts < Element
5
+ namespace :w
6
+
7
+ with_namespace :w do
8
+ attribute :value, expects: :true_or_false, displays_as: :val
9
+ end
10
+
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class EmbedTrueTypeFonts < Element
5
+ namespace :w
6
+
7
+ with_namespace :w do
8
+ attribute :value, expects: :true_or_false, displays_as: :val
9
+ end
10
+
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class FontAlternateName < Element
5
+ namespace :w
6
+ tag :altName
7
+
8
+ with_namespace :w do
9
+ attribute :value, expects: :string, displays_as: :val
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class FontCharacterSet < Element
5
+ namespace :w
6
+ tag :charset
7
+
8
+ with_namespace :w do
9
+ attribute :character_set, expects: :string, displays_as: :characterSet
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class FontPanoseOne < Element
5
+ namespace :w
6
+ tag :panose1
7
+
8
+ with_namespace :w do
9
+ attribute :value, expects: :hex_string, displays_as: :val
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class FontPitch < Element
5
+ namespace :w
6
+ tag :pitch
7
+
8
+ with_namespace :w do
9
+ attribute :value, one_of: %i(default fixed variable), displays_as: :val
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class FontSig < Element
5
+ namespace :w
6
+ tag :sig
7
+
8
+ with_namespace :w do
9
+ attribute :csb0, expects: :long_hex_number
10
+ attribute :csb1, expects: :long_hex_number
11
+ attribute :usb0, expects: :long_hex_number
12
+ attribute :usb1, expects: :long_hex_number
13
+ attribute :usb2, expects: :long_hex_number
14
+ attribute :usb3, expects: :long_hex_number
15
+ end
16
+
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ module OpenXml
2
+ module Docx
3
+ module Elements
4
+ class SaveSubsetFonts < Element
5
+ namespace :w
6
+
7
+ with_namespace :w do
8
+ attribute :value, expects: :true_or_false, displays_as: :val
9
+ end
10
+
11
+ end
12
+ end
13
+ end
14
+ end
@@ -5,17 +5,19 @@ module OpenXml
5
5
  tag :anchor
6
6
  namespace :wp
7
7
 
8
- attribute :allowOverlap, expects: :true_or_false
9
- attribute :behindDoc, expects: :true_or_false
10
- attribute :distB, expects: :positive_integer
11
- attribute :distL, expects: :positive_integer
12
- attribute :distR, expects: :positive_integer
13
- attribute :distT, expects: :positive_integer
14
- attribute :hidden, expects: :true_or_false
15
- attribute :layoutInCell, expects: :true_or_false
16
- attribute :locked, expects: :true_or_false
17
- attribute :relativeHeight, expects: :positive_integer
18
- attribute :simplePos, expects: :true_or_false
8
+ attribute :allow_overlap, expects: :true_or_false, displays_as: :allowOverlap # Required
9
+ attribute :behind_document, expects: :true_or_false, displays_as: :behindDoc # Required
10
+ attribute :distance_from_bottom, expects: :positive_integer, displays_as: :distB # Optional
11
+ attribute :distance_from_left, expects: :positive_integer, displays_as: :distL # Optional
12
+ attribute :distance_from_right, expects: :positive_integer, displays_as: :distR # Optional
13
+ attribute :distance_from_top, expects: :positive_integer, displays_as: :distT # Optional
14
+ attribute :hidden, expects: :true_or_false # Optional
15
+ attribute :layout_in_cell, expects: :true_or_false, displays_as: :layoutInCell # Required
16
+ attribute :locked, expects: :true_or_false # Required
17
+ attribute :z_index, expects: :positive_integer, displays_as: :relativeHeight # Required
18
+ attribute :simple_position, expects: :true_or_false, displays_as: :simplePos # Optional
19
+
20
+ # Children elements required by spec: <docPr>, <a:graphic>, <wp:simplePos>, <wp:positionH>, <wp:positionV>, <wp:extent>, and one of the wp: wrap type tags
19
21
 
20
22
  end
21
23
  end