acro_that 1.0.2 → 1.0.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: e18f96c8c68c8c55a6081ebd91d6e5e45b49901f74224b1a192f0ddae567b097
4
- data.tar.gz: 30b26260b600358b0be4bc2f212b175a3ec32c928d38f413a6aa92a7fe267707
3
+ metadata.gz: 31a0652c9e6d834244b0a296b017d82a1a77ef07666c3e4e1b482b622e1c80cd
4
+ data.tar.gz: 3af1db0522ab1a9a754afb6c1b297184c49ed05547093611d6f3dce838b1e782
5
5
  SHA512:
6
- metadata.gz: fb17fbe00e0f1ada261e12bc8025242a7a6884ff30a3aa9bbb12d86255bb3af8a1705e6e6621d2b2a2147cb432ed6b35b4228d1ffbf5795ab49e751ccb23f228
7
- data.tar.gz: 1005a449cf42d39404c04667939dbba672325ee84437836a2bea5d40db02598ee8063acb9bd5a0fc902f3167cdde636a784436d98ed07c11a9aed67a08cc17e7
6
+ metadata.gz: f2265b5ee6e1ae3ffd9421b0c3944bbe59c52f4e4d1c437a0a555764a36aa7ed23f8c7b0189eb4b7c4aa3703889f7eb58e8cd44232826060fc4bc7599b84504a
7
+ data.tar.gz: 9c90530b5041bd419f28a7c4f9f82829897bbb0a83bb2527ab93e0c90af862ddeed7f4a070f133daf1ab0a149faabf1b7b517c8bf5e11f5719f36050804d9ec3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- acro_that (1.0.1)
4
+ acro_that (1.0.2)
5
5
  chunky_png (~> 1.4)
6
6
 
7
7
  GEM
@@ -77,7 +77,13 @@ module AcroThat
77
77
  field_flags = @metadata[:Ff] || 0
78
78
  dict += " /Ff #{field_flags}\n"
79
79
 
80
- dict += " /DA (/Helv 0 Tf 0 g)\n"
80
+ # Apply /DA from metadata for text fields only, or use default
81
+ if type == "/Tx" && @metadata[:DA]
82
+ da_value = DictScan.format_pdf_value(@metadata[:DA])
83
+ dict += " /DA #{da_value}\n"
84
+ else
85
+ dict += " /DA (/Helv 0 Tf 0 g)\n"
86
+ end
81
87
 
82
88
  # Check if this is a radio button (has Radio flag set)
83
89
  is_radio_field = field_flags.anybits?(32_768)
@@ -125,9 +131,10 @@ module AcroThat
125
131
  end
126
132
  end
127
133
 
128
- # Apply other metadata entries (excluding Ff which we handled above)
134
+ # Apply other metadata entries (excluding Ff and DA which we handled above)
129
135
  @metadata.each do |key, val|
130
136
  next if key == :Ff
137
+ next if key == :DA && type == "/Tx"
131
138
 
132
139
  pdf_key = DictScan.format_pdf_key(key)
133
140
  pdf_value = DictScan.format_pdf_value(val)
@@ -174,17 +181,23 @@ module AcroThat
174
181
  widget += " /Rect #{rect_array}\n"
175
182
  widget += " /F 4\n"
176
183
 
177
- widget += if is_radio
178
- " /MK << /BC [0.0] /BG [1.0] >>\n"
179
- else
180
- " /DA (/Helv 0 Tf 0 g)\n"
181
- end
184
+ # Apply /DA from metadata for text fields only, otherwise use default behavior
185
+ if is_radio
186
+ widget += " /MK << /BC [0.0] /BG [1.0] >>\n"
187
+ elsif type == "/Tx" && @metadata[:DA]
188
+ da_value = DictScan.format_pdf_value(@metadata[:DA])
189
+ widget += " /DA #{da_value}\n"
190
+ else
191
+ widget += " /DA (/Helv 0 Tf 0 g)\n"
192
+ end
182
193
 
183
194
  @metadata.each do |key, val|
184
195
  pdf_key = DictScan.format_pdf_key(key)
185
196
  pdf_value = DictScan.format_pdf_value(val)
186
197
  next if ["/F", "/V"].include?(pdf_key)
187
198
  next if is_radio && ["/Ff", "/DA"].include?(pdf_key)
199
+ # Skip /DA for text fields since we already handled it above
200
+ next if pdf_key == "/DA" && type == "/Tx"
188
201
 
189
202
  widget += " #{pdf_key} #{pdf_value}\n"
190
203
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AcroThat
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acro_that
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Wynkoop
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-11-06 00:00:00.000000000 Z
11
+ date: 2025-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chunky_png