dynamicpdf_api 1.0.0.pre.beta → 1.0.0.pre.beta2

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: 31198d3de33783aad8586d0ee95f309d76af7692a8282071e2c249335ba4773b
4
- data.tar.gz: 8916af160d00fbe67d079503948d1823b7c87bb62012e9ce8c316abc4bb291fc
3
+ metadata.gz: 32136b64e58168f264140d20c960feb5fd7aacbfa6adbc97a37065abb7b15810
4
+ data.tar.gz: ece27f9446f2d49bd9f0762a4aae3373a73f1f108a3de51e15ffa13c02990055
5
5
  SHA512:
6
- metadata.gz: c861c279b7312834a3f5825eb9a671117d661d7cf430dd648272af99e5b5864c93e435f9ea04d4983fa2e82cc9f93a5ea70353954fd607baa6c7fb19370af7a5
7
- data.tar.gz: 010eb606bc82330b73d1974cfca97aaaf21480cdd8e6b674948b499180f5d7af466bfbeca60c50b74c82b55c9fb6e47a6d0ae5629788157585841c7fb943b84c
6
+ metadata.gz: 79a273699db7b348524ef19f676b8c0deefc408a536ef96affd6ea92c56be44b82b6d54db858563584dbc4ace78103f593525f11a81d14db55ec0745c330b4d7
7
+ data.tar.gz: 2197f6d713e15fe6d9f9e98a5771aa35f261e1752f1d13bf5d45b7bcdecc75a1412d5c8278b39920be40b61ffd04ea8c1b4d316d2958b7a5ef74d272fc48ea8b
@@ -6,8 +6,13 @@ require_relative 'Input'
6
6
  class ConverterInput < Input
7
7
  def initialize(resource, size, orientation, margins)
8
8
  super(resource)
9
- self.page_size = size
10
- self.page_orientation = orientation
9
+
10
+ if (size != nil)
11
+ self.page_size = size
12
+ end
13
+ if (orientation != nil)
14
+ self.page_orientation = orientation
15
+ end
11
16
 
12
17
  if (margins != nil)
13
18
  @top_margin = margins
@@ -61,12 +66,12 @@ require_relative 'Input'
61
66
  @_larger = output_size.larger
62
67
  @_smaller = output_size.smaller
63
68
 
64
- if @page_orientation == PageOrientation::PORTRAIT
65
- @page_height = @_larger
66
- @page_width = @_smaller
67
- else
69
+ if @page_orientation == PageOrientation::LANDSCAPE
68
70
  @page_height = @_smaller
69
71
  @page_width = @_larger
72
+ else
73
+ @page_height = @_larger
74
+ @page_width = @_smaller
70
75
  end
71
76
  end
72
77
 
@@ -76,20 +81,22 @@ require_relative 'Input'
76
81
  def page_orientation=(value)
77
82
  @page_orientation = value
78
83
 
79
- if @page_width > @page_height
80
- @_smaller = @page_height
81
- @_larger = @page_width
82
- else
83
- @_smaller = @page_width
84
- @_larger = @page_height
85
- end
86
-
87
- if @page_orientation == PageOrientation::PORTRAIT
88
- @page_height = @_larger
89
- @page_width = @_smaller
90
- else
91
- @page_height = @_smaller
92
- @page_width = @_larger
84
+ if(@page_width != nil && @page_height != nil)
85
+ if @page_width > @page_height
86
+ @_smaller = @page_height
87
+ @_larger = @page_width
88
+ else
89
+ @_smaller = @page_width
90
+ @_larger = @page_height
91
+ end
92
+
93
+ if @page_orientation == PageOrientation::LANDSCAPE
94
+ @page_height = @_smaller
95
+ @page_width = @_larger
96
+ else
97
+ @page_height = @_larger
98
+ @page_width = @_smaller
99
+ end
93
100
  end
94
101
  end
95
102
 
@@ -14,7 +14,7 @@ module DynamicPDFApi
14
14
  # @param name="size">The page size of the output PDF.
15
15
  # @param name="orientation">The page orientation of the output PDF.
16
16
  # @param name="margins">The page margins of the output PDF.
17
- def initialize(resource, size = PageSize::LETTER, orientation = PageOrientation::PORTRAIT, margins = nil)
17
+ def initialize(resource, size = nil, orientation = nil, margins = nil)
18
18
  super(resource, size, orientation, margins)
19
19
  @_type = InputType::EXCEL
20
20
 
@@ -13,7 +13,7 @@ module DynamicPDFApi
13
13
  # @param size [PageSize] The page size of the output PDF.
14
14
  # @param orientation [PageOrientation] The page orientation of the output PDF.
15
15
  # @param margins [float] The page margins of the output PDF.
16
- def initialize(resource, base_path = nil, size = PageSize::LETTER, orientation = PageOrientation::PORTRAIT, margins = nil)
16
+ def initialize(resource, base_path = nil, size = nil, orientation = nil, margins = nil)
17
17
  super(resource, size, orientation, margins)
18
18
 
19
19
  @_type = InputType::HTML
@@ -149,7 +149,7 @@ module DynamicPDFApi
149
149
  #
150
150
  # @return HtmlInput HtmlInput object.
151
151
  #
152
- def add_html(html, basepath = null, size = PageSize.A4, orientation = PageOrientation.PORTRAIT, margins = nil)
152
+ def add_html(html, basepath = nil, size = nil, orientation = nil, margins = nil)
153
153
  input = nil
154
154
  if file.is_a?(String)
155
155
  input = HtmlInput.new(HtmlResource.new(html), basepath, size, orientation, margins)
@@ -168,7 +168,7 @@ module DynamicPDFApi
168
168
  #
169
169
  # @return WordInput WordInput object.
170
170
  #
171
- def add_word(resource, size = PageSize.A4, orientation = PageOrientation.PORTRAIT, margins = nil)
171
+ def add_word(resource, size = nil, orientation = nil, margins = nil)
172
172
  input = WordInput.new(resource, size, orientation, margins)
173
173
  @inputs << input
174
174
  input
@@ -181,7 +181,7 @@ module DynamicPDFApi
181
181
  #
182
182
  # @return ExcelInput ExcelInput object.
183
183
  #
184
- def add_excel(resource, size = PageSize.A4, orientation = PageOrientation.PORTRAIT, margins = nil)
184
+ def add_excel(resource, size = nil, orientation = nil, margins = nil)
185
185
  input = ExcelInput.new(resource, size, orientation, margins)
186
186
  @inputs << input
187
187
  input
@@ -14,7 +14,7 @@ module DynamicPDFApi
14
14
  # @param name="size">The page size of the output PDF.
15
15
  # @param name="orientation">The page orientation of the output PDF.
16
16
  # @param name="margins">The page margins of the output PDF.
17
- def initialize(resource, size = PageSize::LETTER, orientation = PageOrientation::PORTRAIT, margins = nil)
17
+ def initialize(resource, size = nil, orientation = nil, margins = nil)
18
18
  super(resource, size, orientation, margins)
19
19
  @_type = InputType::WORD
20
20
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyClient
4
- VERSION = "1.0.0-beta"
4
+ VERSION = "1.0.0-beta2"
5
5
  end
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.0.0.pre.beta
4
+ version: 1.0.0.pre.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dynamicpdf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-17 00:00:00.000000000 Z
11
+ date: 2024-06-14 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.