standard-procedure-consolidate 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cbb574bced054ba32f67038b7f91eed28836470eb0d40e7bbbbcaefdca41142
4
- data.tar.gz: 64438e3b31ea879c4c10d42afa08873a44528ec89ba60d3e248c07baf1bd028b
3
+ metadata.gz: c3a7f02d5159a44a47af30100fe1743b2b5bff5ab845a0da2170ffaf44302f03
4
+ data.tar.gz: b041806b3d682a4c5ccc0011025a1d3d5b25a7c1a65fda56e9b3fcce34b364a9
5
5
  SHA512:
6
- metadata.gz: 947a488ad5d98514589cbaa9495cd7970e7821832a05f74719821d9423785fc9e04f2563b7c4c4c34e5c5c25c32c6a1fd175cbd862e247cdfc2e8612663412b4
7
- data.tar.gz: cc6e12303d7abea0be365df9c443d868d18bc658f3696488a6826ce83b93cfd17e588aecc6f3af94a9ac46e9621bc483800effd44e37b550dc752767757fe9fc
6
+ metadata.gz: 2bc84355758ef68cd525c684fe1ef6973858eb3ba360f4a37a026cc54a11c9eb143cc364bd034cdd4452bec75a91a768b7f96ccbb727039da5e6ba727fb643bd
7
+ data.tar.gz: b8061eb3ff1a61deb3c1b153be11d9c5b416be6a576d559c0846236a1e8dabdf9dcf339f33479e39589d3c247930cb28d437a360becbe5e498e90b99eb26ffea
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # [0.4.3] - 2025-02-24
2
+
3
+ Use wp:anchor tags instead of wp:inline tags for embedding images
4
+
1
5
  # [0.4.1] - 2024-12-18
2
6
 
3
7
  Replace image merge fields with blanks if the image data is not provided
@@ -0,0 +1 @@
1
+ 646e5a14ad25738c476cb587c9012fff12687fc7e26e555b6d17a61d69ae1477bdf1a55326b952bbc05dde988d945c3a9504ebeb58b2ff6598c10be5be26c6cb
@@ -12,27 +12,58 @@ module Consolidate
12
12
 
13
13
  Nokogiri::XML::Node.new("w:drawing", document).tap do |drawing|
14
14
  drawing["xmlns:a"] = "http://schemas.openxmlformats.org/drawingml/2006/main"
15
- drawing << Nokogiri::XML::Node.new("wp:inline", document).tap do |inline|
16
- inline["distT"] = "0"
17
- inline["distB"] = "0"
18
- inline["distL"] = "0"
19
- inline["distR"] = "0"
20
- inline << Nokogiri::XML::Node.new("wp:extent", document).tap do |extent|
15
+ drawing << Nokogiri::XML::Node.new("wp:anchor", document).tap do |anchor|
16
+ anchor["behindDoc"] = "0"
17
+ anchor["distT"] = "0"
18
+ anchor["distB"] = "0"
19
+ anchor["distL"] = "0"
20
+ anchor["distR"] = "0"
21
+ anchor["simplePos"] = "0"
22
+ anchor["locked"] = "0"
23
+ anchor["layoutInCell"] = "0"
24
+ anchor["allowOverlap"] = "1"
25
+ anchor["relativeHeight"] = "2"
26
+ anchor << Nokogiri::XML::Node.new("wp:simplePos", document).tap do |pos|
27
+ pos["x"] = "0"
28
+ pos["y"] = "0"
29
+ end
30
+ anchor << Nokogiri::XML::Node.new("wp:positionH", document).tap do |posh|
31
+ posh["relativeFrom"] = "column"
32
+ posh << Nokogiri::XML::Node.new("wp:align", document).tap do |align|
33
+ align.content = "center"
34
+ end
35
+ end
36
+ anchor << Nokogiri::XML::Node.new("wp:positionV", document).tap do |posv|
37
+ posv["relativeFrom"] = "paragraph"
38
+ posv << Nokogiri::XML::Node.new("wp:posOffset", document).tap do |offset|
39
+ offset.content = "635"
40
+ end
41
+ end
42
+ anchor << Nokogiri::XML::Node.new("wp:extent", document).tap do |extent|
21
43
  extent["cx"] = scaled_width
22
44
  extent["cy"] = scaled_height
23
45
  end
24
- inline << Nokogiri::XML::Node.new("wp:effectExtent", document).tap do |effect_extent|
46
+ anchor << Nokogiri::XML::Node.new("wp:effectExtent", document).tap do |effect_extent|
25
47
  effect_extent["l"] = "0"
26
48
  effect_extent["t"] = "0"
27
49
  effect_extent["r"] = "0"
28
50
  effect_extent["b"] = "0"
29
51
  end
30
- inline << Nokogiri::XML::Node.new("wp:cNvGraphicFramePr", document).tap do |c_nv_graphic_frame_pr|
52
+ anchor << Nokogiri::XML::Node.new("wp:wrapSquare", document).tap do |wrap_square|
53
+ wrap_square["wrapText"] = "largest"
54
+ end
55
+ anchor << Nokogiri::XML::Node.new("wp:docPr", document).tap do |doc_pr|
56
+ doc_pr["id"] = image_number
57
+ doc_pr["name"] = image.name
58
+ doc_pr["descr"] = ""
59
+ doc_pr["title"] = ""
60
+ end
61
+ anchor << Nokogiri::XML::Node.new("wp:cNvGraphicFramePr", document).tap do |c_nv_graphic_frame_pr|
31
62
  c_nv_graphic_frame_pr << Nokogiri::XML::Node.new("a:graphicFrameLocks", document).tap do |graphic_frame_locks|
32
63
  graphic_frame_locks["noChangeAspect"] = true
33
64
  end
34
65
  end
35
- inline << Nokogiri::XML::Node.new("a:graphic", document).tap do |graphic|
66
+ anchor << Nokogiri::XML::Node.new("a:graphic", document).tap do |graphic|
36
67
  graphic["xmlns:a"] = "http://schemas.openxmlformats.org/drawingml/2006/main"
37
68
  graphic << Nokogiri::XML::Node.new("a:graphicData", document).tap do |graphic_data|
38
69
  graphic_data["uri"] = "http://schemas.openxmlformats.org/drawingml/2006/picture"
@@ -44,7 +75,12 @@ module Consolidate
44
75
  c_nv_pr["name"] = image.name
45
76
  c_nv_pr["descr"] = image.name
46
77
  c_nv_pr["hidden"] = false
47
- c_nv_pr << Nokogiri::XML::Node.new("pic:cNvPicPr", document)
78
+ c_nv_pr << Nokogiri::XML::Node.new("pic:cNvPicPr", document).tap do |c_nv_pic_pr|
79
+ c_nv_pic_pr << Nokogiri::XML::Node.new("a:picLocks", document).tap do |pic_locks|
80
+ pic_locks["noChangeAspect"] = "1"
81
+ pic_locks["noChangeArrowheads"] = "1"
82
+ end
83
+ end
48
84
  end
49
85
  end
50
86
  pic << Nokogiri::XML::Node.new("pic:blipFill", document).tap do |blip_fill|
@@ -56,6 +92,7 @@ module Consolidate
56
92
  end
57
93
  end
58
94
  pic << Nokogiri::XML::Node.new("pic:spPr", document).tap do |sp_pr|
95
+ sp_pr["bwMode"] = "auto"
59
96
  sp_pr << Nokogiri::XML::Node.new("a:xfrm", document).tap do |xfrm|
60
97
  xfrm << Nokogiri::XML::Node.new("a:off", document).tap do |off|
61
98
  off["x"] = "0"
@@ -70,6 +107,7 @@ module Consolidate
70
107
  prst_geom["prst"] = "rect"
71
108
  prst_geom << Nokogiri::XML::Node.new("a:avLst", document)
72
109
  end
110
+ sp_pr << Nokogiri::XML::Node.new("a:noFill", document)
73
111
  end
74
112
  end
75
113
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Consolidate
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.3"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard-procedure-consolidate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahoul Baruah
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-02-20 00:00:00.000000000 Z
10
+ date: 2025-02-24 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rubyzip
@@ -66,6 +66,7 @@ files:
66
66
  - checksums/standard-procedure-consolidate-0.4.0.gem.sha512
67
67
  - checksums/standard-procedure-consolidate-0.4.1.gem.sha512
68
68
  - checksums/standard-procedure-consolidate-0.4.2.gem.sha512
69
+ - checksums/standard-procedure-consolidate-0.4.3.gem.sha512
69
70
  - exe/consolidate
70
71
  - exe/examine
71
72
  - lib/consolidate.rb