dynamicpdf_api 1.1.2 → 1.2.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 +4 -4
- data/lib/ruby_client/Imaging/PdfImage.rb +2 -1
- data/lib/ruby_client/Pdf.rb +1 -1
- data/lib/ruby_client/PdfText.rb +10 -4
- data/lib/ruby_client/PdfTextResponse.rb +6 -6
- data/lib/ruby_client/Security.rb +11 -11
- data/lib/ruby_client/TextOrder.rb +21 -0
- data/lib/ruby_client/version.rb +1 -1
- data/lib/ruby_client.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4032069e887ac6170c27e3e62b6c53937012fc0fc532bcc1ee078db7cc699279
|
4
|
+
data.tar.gz: '079b748ab778f13fe486b969f371f563456f7ad2aaebdcea1161b04be0d01d91'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87516c46b99ab12217f99c0997f9b64dc65f2636d3117aae776a941208bc5c758cc3a4d48e4c2b2e4b6370ace9938b6708d77365f1c9e70a54bbdb08c0c255e9
|
7
|
+
data.tar.gz: 79cec9da77a1828a018a1865caa6f6d99c5278973c191a991e4132c2ea46d4dfa5e9f20f3524d41c21da18cca25c69296b380ad76465c597eb15d95fc9f267c4
|
data/lib/ruby_client/Pdf.rb
CHANGED
@@ -170,7 +170,7 @@ module DynamicPDFApi
|
|
170
170
|
#
|
171
171
|
def add_html(html, basepath = nil, size = nil, orientation = nil, margins = nil)
|
172
172
|
input = nil
|
173
|
-
if
|
173
|
+
if html.is_a?(String)
|
174
174
|
input = HtmlInput.new(HtmlResource.new(html), basepath, size, orientation, margins)
|
175
175
|
else
|
176
176
|
input = HtmlInput.new(resource, basepath, size, orientation, margins)
|
data/lib/ruby_client/PdfText.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module DynamicPDFApi
|
2
2
|
require_relative 'Endpoint'
|
3
3
|
require_relative 'PdfTextResponse'
|
4
|
+
require_relative 'TextOrder'
|
4
5
|
|
5
6
|
#
|
6
7
|
# Represents the pdf text endpoint.
|
@@ -12,15 +13,15 @@ module DynamicPDFApi
|
|
12
13
|
# @param resource [PdfResource] The image resource of type PdfResource.
|
13
14
|
# @param start_page [int] The start page.
|
14
15
|
# @param page_count [int] The page count.
|
16
|
+
# @param text_order The text extraction order.
|
15
17
|
#
|
16
|
-
def initialize(resource, start_page = 1, page_count = 0)
|
18
|
+
def initialize(resource, start_page = 1, page_count = 0, text_order = TextOrder::STREAM)
|
17
19
|
@_endpoint_name = 'pdf-text'
|
18
|
-
@start_page = 1
|
19
|
-
@page_count = 0
|
20
20
|
super()
|
21
21
|
@resource = resource
|
22
22
|
@start_page = start_page
|
23
23
|
@page_count = page_count
|
24
|
+
@text_order = text_order
|
24
25
|
end
|
25
26
|
|
26
27
|
#
|
@@ -33,6 +34,11 @@ module DynamicPDFApi
|
|
33
34
|
#
|
34
35
|
attr_accessor :page_count
|
35
36
|
|
37
|
+
#
|
38
|
+
# Gets or sets the text extraction order.
|
39
|
+
#
|
40
|
+
attr_accessor :text_order
|
41
|
+
|
36
42
|
#
|
37
43
|
# Process the pdf resource to get pdf's text.
|
38
44
|
# @return PdfTextResponse Returns collection of PdfTextResponse.
|
@@ -45,7 +51,7 @@ module DynamicPDFApi
|
|
45
51
|
'Content-Type': 'application/pdf'
|
46
52
|
}
|
47
53
|
uri = URI.parse("#{@base_url}/v1.0/#{@_endpoint_name}")
|
48
|
-
params = { 'startPage' => @start_page, 'pageCount' => @page_count }
|
54
|
+
params = { 'startPage' => @start_page, 'pageCount' => @page_count, 'textOrder' => @text_order }
|
49
55
|
uri.query = URI.encode_www_form(params)
|
50
56
|
|
51
57
|
request = Net::HTTP::Post.new(uri.request_uri, header)
|
@@ -10,13 +10,13 @@ module DynamicPDFApi
|
|
10
10
|
#
|
11
11
|
# @param json_content [String] The json content
|
12
12
|
#
|
13
|
-
def initialize(json_content)
|
14
|
-
|
15
|
-
|
16
|
-
)
|
17
|
-
|
13
|
+
def initialize(json_content = nil)
|
14
|
+
|
15
|
+
@content = nil
|
16
|
+
super(json_content) unless json_content.nil?
|
17
|
+
|
18
|
+
@content = JSON.parse(json_content)
|
18
19
|
|
19
|
-
super(json_content)
|
20
20
|
end
|
21
21
|
|
22
22
|
#
|
data/lib/ruby_client/Security.rb
CHANGED
@@ -6,18 +6,18 @@ module DynamicPDFApi
|
|
6
6
|
#
|
7
7
|
class Security
|
8
8
|
def initialize(user_pwd = nil, owner_pwd = nil)
|
9
|
-
@
|
10
|
-
@
|
11
|
-
@
|
12
|
-
@
|
13
|
-
@
|
14
|
-
@
|
9
|
+
@user_password = user_pwd
|
10
|
+
@owner_password = owner_pwd
|
11
|
+
@allow_copy = nil
|
12
|
+
@allow_edit = nil
|
13
|
+
@allow_print = nil
|
14
|
+
@allow_update_annots_and_fields = nil
|
15
15
|
|
16
|
-
@
|
17
|
-
@
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@
|
16
|
+
@allow_accessibility = nil
|
17
|
+
@allow_form_filling = nil
|
18
|
+
@allow_high_resolution_printing = nil
|
19
|
+
@allow_document_assembly = nil
|
20
|
+
@type = nil
|
21
21
|
end
|
22
22
|
|
23
23
|
#
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
#
|
4
|
+
# Specifies text extraction order.
|
5
|
+
#
|
6
|
+
#
|
7
|
+
class TextOrder
|
8
|
+
#
|
9
|
+
# Stream text extraction order.
|
10
|
+
#
|
11
|
+
STREAM = "Stream".freeze
|
12
|
+
#
|
13
|
+
# Visible text extraction order.
|
14
|
+
#
|
15
|
+
VISIBLE = "Visible".freeze
|
16
|
+
#
|
17
|
+
# VisibleExtraSpace text extraction order.
|
18
|
+
#
|
19
|
+
VISIBLE_EXTRA_SPACE = "VisibleExtraSpace".freeze
|
20
|
+
end
|
21
|
+
end
|
data/lib/ruby_client/version.rb
CHANGED
data/lib/ruby_client.rb
CHANGED
@@ -72,6 +72,7 @@ require_relative "ruby_client/SecurityType.rb"
|
|
72
72
|
require_relative "ruby_client/SignatureFieldInformation.rb"
|
73
73
|
require_relative "ruby_client/Template.rb"
|
74
74
|
require_relative "ruby_client/TextFieldInformation.rb"
|
75
|
+
require_relative "ruby_client/TextOrder.rb"
|
75
76
|
require_relative "ruby_client/TextReplace.rb"
|
76
77
|
require_relative "ruby_client/UrlAction.rb"
|
77
78
|
require_relative "ruby_client/UnitConverter.rb"
|
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: 1.
|
4
|
+
version: 1.2.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: 2025-05-20 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.
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- lib/ruby_client/SignatureFieldInformation.rb
|
160
160
|
- lib/ruby_client/Template.rb
|
161
161
|
- lib/ruby_client/TextFieldInformation.rb
|
162
|
+
- lib/ruby_client/TextOrder.rb
|
162
163
|
- lib/ruby_client/TextReplace.rb
|
163
164
|
- lib/ruby_client/UnitConverter.rb
|
164
165
|
- lib/ruby_client/UrlAction.rb
|