dynamicpdf_api 1.3.0 → 2.0.0
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5427fc35251fa21f680fdba436398a94022ed793ce0a614d15be5712fc5801be
|
|
4
|
+
data.tar.gz: b079a50d26fc63e33089f3145e5e5d94ca2954e0a8ece78e73321dfc39ef0110
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1d477bc4deab58568ffc065d051a020dff8621fea17ad8fc76ee16322a47df37b0b370ecdbc23f4e2a21bb361577683ff5da328ccb0925497f94746206dd017
|
|
7
|
+
data.tar.gz: 486dbe03715475af148d3684d083b4c88493df7588cff4994d0c9838e22990e4b22f8d256c27084750b12094b41d480c9c932d4ab572fc0a6d492e3ec4a3c507
|
|
@@ -16,7 +16,7 @@ module DynamicPDFApi
|
|
|
16
16
|
else
|
|
17
17
|
super(value, placement, x_offset, y_offset)
|
|
18
18
|
@_value_type = ValueType::BASE64_ENCODED_BYTES
|
|
19
|
-
@value = Base64.
|
|
19
|
+
@value = Base64.strict_encode64(value.pack('C*'))
|
|
20
20
|
@placement = placement
|
|
21
21
|
@x_offset = x_offset
|
|
22
22
|
@y_offset = y_offset
|
data/lib/ruby_client/Font.rb
CHANGED
|
@@ -10,12 +10,55 @@ module DynamicPDFApi
|
|
|
10
10
|
@load_required = true
|
|
11
11
|
@lock = Mutex.new
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
def self.init(platform_override = nil)
|
|
14
|
+
begin
|
|
15
|
+
|
|
16
|
+
# -------- Windows --------
|
|
17
|
+
if RUBY_PLATFORM =~ /mswin|mingw|cygwin/
|
|
18
|
+
windir = ENV["WINDIR"]
|
|
19
|
+
if windir && !windir.empty?
|
|
20
|
+
path = File.join(windir, "Fonts")
|
|
21
|
+
@path_to_fonts_resource_directory = path if Dir.exist?(path)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# -------- macOS --------
|
|
25
|
+
elsif RUBY_PLATFORM =~ /darwin/
|
|
26
|
+
home = Dir.home rescue nil
|
|
27
|
+
paths = [
|
|
28
|
+
"/System/Library/Fonts",
|
|
29
|
+
"/Library/Fonts",
|
|
30
|
+
home ? File.join(home, "Library", "Fonts") : nil
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
paths.each do |path|
|
|
34
|
+
next unless path
|
|
35
|
+
if Dir.exist?(path)
|
|
36
|
+
@path_to_fonts_resource_directory = path
|
|
37
|
+
break
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# -------- Linux --------
|
|
42
|
+
elsif RUBY_PLATFORM =~ /linux/
|
|
43
|
+
home = Dir.home rescue nil
|
|
44
|
+
paths = [
|
|
45
|
+
"/usr/share/fonts",
|
|
46
|
+
"/usr/local/share/fonts",
|
|
47
|
+
home ? File.join(home, ".fonts") : nil,
|
|
48
|
+
home ? File.join(home, ".local", "share", "fonts") : nil
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
paths.each do |path|
|
|
52
|
+
next unless path
|
|
53
|
+
if Dir.exist?(path)
|
|
54
|
+
@path_to_fonts_resource_directory = path
|
|
55
|
+
break
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
rescue e
|
|
60
|
+
puts "Error in getting the font: #{e.message}"
|
|
61
|
+
end
|
|
19
62
|
end
|
|
20
63
|
|
|
21
64
|
#
|
|
@@ -279,6 +322,8 @@ module DynamicPDFApi
|
|
|
279
322
|
return unless @load_required
|
|
280
323
|
loaded_any = false
|
|
281
324
|
|
|
325
|
+
init
|
|
326
|
+
|
|
282
327
|
@lock.synchronize do
|
|
283
328
|
if @path_to_fonts_resource_directory && !@path_to_fonts_resource_directory.empty?
|
|
284
329
|
dir_Info = File.join(@path_to_fonts_resource_directory.gsub("\\", "/"), "*")
|
data/lib/ruby_client/Pdf.rb
CHANGED
|
@@ -223,17 +223,20 @@ module DynamicPDFApi
|
|
|
223
223
|
#
|
|
224
224
|
# Returns a page_input object containing the input pdf.
|
|
225
225
|
#
|
|
226
|
-
# @param
|
|
227
|
-
# @param
|
|
226
|
+
# @param size [String]|[Float] The size of the page or The width of the page.
|
|
227
|
+
# @param orientation [String]|[Float] The orientation of the page or The height of the page.
|
|
228
|
+
# @param margins [Float] The margins of the page.
|
|
228
229
|
#
|
|
229
|
-
# @return
|
|
230
|
+
# @return PageInput PageInput object.
|
|
230
231
|
#
|
|
231
|
-
def add_page(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
def add_page(size = nil, orientation = nil, margins = nil)
|
|
233
|
+
if (size.is_a?(String) || size.nil?) && (orientation.is_a?(String) || orientation.nil?)
|
|
234
|
+
input = PageInput.new(size, orientation, margins)
|
|
235
|
+
elsif (size.is_a?(Numeric)) && (orientation.is_a?(Numeric))
|
|
236
|
+
input = PageInput.new(size, orientation)
|
|
237
|
+
else
|
|
238
|
+
input = PageInput.new
|
|
239
|
+
end
|
|
237
240
|
@inputs << input
|
|
238
241
|
input
|
|
239
242
|
end
|
data/lib/ruby_client/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dynamicpdf_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dynamicpdf
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-02-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A Ruby Client API that uses the DynamicPDF API to create, merge, split,
|
|
14
14
|
form fill, stamp, secure/encrypt PDF documents and convert word/Excel files to PDF.
|