Class: GrabzIt::DOCXOptions
- Inherits:
-
BaseOptions
- Object
- BaseOptions
- GrabzIt::DOCXOptions
- Defined in:
- lib/grabzit/docxoptions.rb
Overview
Represents all of the options available when creating a DOCX
Instance Method Summary collapse
-
#add_post_parameter(name, value) ⇒ Object
Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters.
-
#add_template_parameter(name, value) ⇒ Object
Define a custom template parameter and value, this method can be called multiple times to add multiple parameters.
-
#address ⇒ String
Get the URL to execute the HTML code in.
-
#address=(value) ⇒ void
Set the URL to execute the HTML code in.
-
#browserWidth ⇒ Integer
The width of the browser in pixels.
-
#browserWidth=(value) ⇒ void
Set the width of the browser in pixels.
-
#clickElement ⇒ String
Get the CSS selector of the HTML element in the web page that must clicked before the capture is performed.
-
#clickElement=(value) ⇒ void
Set the CSS selector of the HTML element in the web page that must clicked before the capture is performed.
-
#delay ⇒ Integer
The number of milliseconds to wait before creating the capture.
-
#delay=(value) ⇒ void
Set the number of milliseconds to wait before creating the capture.
-
#hideElement ⇒ String
Get the CSS selector(s) of the one or more HTML elements in the web page to hide.
-
#hideElement=(value) ⇒ void
Set the CSS selector(s) of the one or more HTML elements in the web page to hide.
-
#includeBackground ⇒ Boolean
True if the background images of the web page should be included in the DOCX.
-
#includeBackground=(value) ⇒ void
Set to true if the background images of the web page should be included in the DOCX.
-
#includeImages ⇒ Boolean
True if web page images should be included.
-
#includeImages=(value) ⇒ void
Set to true if web page images should be included.
-
#includeLinks ⇒ Boolean
True if the links should be included in the DOCX.
-
#includeLinks=(value) ⇒ void
Set to true if links should be included in the DOCX.
-
#initialize ⇒ DOCXOptions
constructor
A new instance of DOCXOptions.
-
#marginBottom ⇒ Integer
The margin that should appear at the bottom of the DOCX document page.
-
#marginBottom=(value) ⇒ void
Set the margin that should appear at the bottom of the DOCX document page.
-
#marginLeft ⇒ Integer
The margin that should appear at the left of the DOCX document page.
-
#marginLeft=(value) ⇒ void
Set the margin that should appear at the left of the DOCX document page.
-
#marginRight ⇒ Integer
The margin that should appear at the right of the DOCX document.
-
#marginRight=(value) ⇒ void
Set the margin that should appear at the right of the DOCX document.
-
#marginTop ⇒ Integer
The margin that should appear at the top of the DOCX document page.
-
#marginTop=(value) ⇒ void
Set the margin that should appear at the top of the DOCX document page.
-
#mergeId ⇒ String
Get the ID of a capture that should be merged at the beginning of the new DOCX document.
-
#mergeId=(value) ⇒ void
Set the ID of a capture that should be merged at the beginning of the new DOCX document.
-
#noAds ⇒ Boolean
Get if adverts should be automatically hidden.
-
#noAds=(value) ⇒ void
Set to true if adverts should be automatically hidden.
-
#noCookieNotifications ⇒ Boolean
Get if cookie notifications should be automatically hidden.
-
#noCookieNotifications=(value) ⇒ void
Set to true if cookie notifications should be automatically hidden.
-
#orientation ⇒ String
The orientation of the DOCX to be returned.
-
#orientation=(value) ⇒ void
Set the orientation of the DOCX to be returned: ‘Landscape’ or ‘Portrait’.
-
#pageHeight ⇒ Integer
Get the page height of the resulting DOCX in mm.
-
#pageHeight=(value) ⇒ void
Set the page height of the resulting DOCX in mm.
-
#pagesize ⇒ String
The page size of the DOCX to be returned.
-
#pagesize=(value) ⇒ void
Set the page size of the DOCX to be returned: ‘A3’, ‘A4’, ‘A5’, ‘A6’, ‘B3’, ‘B4’, ‘B5’, ‘B6’, ‘Letter’.
-
#pageWidth ⇒ Integer
Get the page width of the resulting DOCX in mm.
-
#pageWidth=(value) ⇒ void
Set the page width of the resulting DOCX in mm.
-
#password ⇒ String
Get the password that protects the DOCX document.
-
#password=(value) ⇒ void
Set the password that protects the DOCX document.
-
#quality ⇒ Integer
The quality of the DOCX.
-
#quality=(value) ⇒ void
Set the quality of the DOCX where 0 is poor and 100 excellent.
-
#requestAs ⇒ Integer
Get which user agent type should be used.
-
#requestAs=(value) ⇒ void
Set which user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3.
-
#targetElement ⇒ String
Get the CSS selector of the only HTML element in the web page to capture.
-
#targetElement=(value) ⇒ void
Set the CSS selector of the only HTML element in the web page to capture.
-
#templateId ⇒ String
The template ID that specifies the header and footer of the DOCX document.
-
#templateId=(value) ⇒ void
Set a template ID that specifies the header and footer of the DOCX document.
-
#title ⇒ String
A title for the DOCX document.
-
#title=(value) ⇒ void
Set a title for the DOCX document.
-
#waitForElement ⇒ String
Get the CSS selector of the HTML element in the web page that must be visible before the capture is performed.
-
#waitForElement=(value) ⇒ void
Set the CSS selector of the HTML element in the web page that must be visible before the capture is performed.
Methods inherited from BaseOptions
#country, #country=, #customId, #customId=, #encryptionKey, #encryptionKey=, #exportURL, #exportURL=, #proxy, #proxy=
Constructor Details
#initialize ⇒ DOCXOptions
Returns a new instance of DOCXOptions.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/grabzit/docxoptions.rb', line 8 def initialize() super() @includeBackground = true @pagesize = 'A4' @orientation = 'Portrait' @includeLinks = true @includeImages = true @title = nil @marginTop = 10 @marginLeft = 10 @marginBottom = 10 @marginRight = 10 @requestAs = 0 @quality = -1 @hideElement = nil @waitForElement = nil @noAds = false @browserWidth = nil @templateVariables = nil @width = nil @height = nil @templateId = nil @targetElement = nil @mergeId = nil @noCookieNotifications = false @address = nil @password = nil @clickElement = nil end |
Instance Method Details
#add_post_parameter(name, value) ⇒ Object
Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force GrabzIt to perform a HTTP post.
384 385 386 |
# File 'lib/grabzit/docxoptions.rb', line 384 def add_post_parameter(name, value) @post = appendParameter(@post, name, value) end |
#add_template_parameter(name, value) ⇒ Object
Define a custom template parameter and value, this method can be called multiple times to add multiple parameters.
392 393 394 |
# File 'lib/grabzit/docxoptions.rb', line 392 def add_template_parameter(name, value) @templateVariables = appendParameter(@templateVariables, name, value) end |
#address ⇒ String
Returns get the URL to execute the HTML code in.
354 355 356 |
# File 'lib/grabzit/docxoptions.rb', line 354 def address @address end |
#address=(value) ⇒ void
This method returns an undefined value.
Set the URL to execute the HTML code in
362 363 364 |
# File 'lib/grabzit/docxoptions.rb', line 362 def address=(value) @address = value end |
#browserWidth ⇒ Integer
Returns the width of the browser in pixels.
171 172 173 |
# File 'lib/grabzit/docxoptions.rb', line 171 def browserWidth @browserWidth end |
#browserWidth=(value) ⇒ void
This method returns an undefined value.
Set the width of the browser in pixels
179 180 181 |
# File 'lib/grabzit/docxoptions.rb', line 179 def browserWidth=(value) @browserWidth = value end |
#clickElement ⇒ String
Returns get the CSS selector of the HTML element in the web page that must clicked before the capture is performed.
301 302 303 |
# File 'lib/grabzit/docxoptions.rb', line 301 def clickElement @clickElement end |
#clickElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector of the HTML element in the web page that must clicked before the capture is performed
309 310 311 |
# File 'lib/grabzit/docxoptions.rb', line 309 def clickElement=(value) @clickElement = value end |
#delay ⇒ Integer
Returns the number of milliseconds to wait before creating the capture.
210 211 212 |
# File 'lib/grabzit/docxoptions.rb', line 210 def delay @delay end |
#delay=(value) ⇒ void
This method returns an undefined value.
Set the number of milliseconds to wait before creating the capture
218 219 220 |
# File 'lib/grabzit/docxoptions.rb', line 218 def delay=(value) @delay = value end |
#hideElement ⇒ String
Returns get the CSS selector(s) of the one or more HTML elements in the web page to hide.
275 276 277 |
# File 'lib/grabzit/docxoptions.rb', line 275 def hideElement @hideElement end |
#hideElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector(s) of the one or more HTML elements in the web page to hide
283 284 285 |
# File 'lib/grabzit/docxoptions.rb', line 283 def hideElement=(value) @hideElement = value end |
#includeBackground ⇒ Boolean
Returns true if the background images of the web page should be included in the DOCX.
39 40 41 |
# File 'lib/grabzit/docxoptions.rb', line 39 def includeBackground @includeBackground end |
#includeBackground=(value) ⇒ void
This method returns an undefined value.
Set to true if the background images of the web page should be included in the DOCX
47 48 49 |
# File 'lib/grabzit/docxoptions.rb', line 47 def includeBackground=(value) @includeBackground = value end |
#includeImages ⇒ Boolean
Returns true if web page images should be included.
93 94 95 |
# File 'lib/grabzit/docxoptions.rb', line 93 def includeImages @includeImages end |
#includeImages=(value) ⇒ void
This method returns an undefined value.
Set to true if web page images should be included
101 102 103 |
# File 'lib/grabzit/docxoptions.rb', line 101 def includeImages=(value) @includeImages = value end |
#includeLinks ⇒ Boolean
Returns true if the links should be included in the DOCX.
80 81 82 |
# File 'lib/grabzit/docxoptions.rb', line 80 def includeLinks @includeLinks end |
#includeLinks=(value) ⇒ void
This method returns an undefined value.
Set to true if links should be included in the DOCX
88 89 90 |
# File 'lib/grabzit/docxoptions.rb', line 88 def includeLinks=(value) @includeLinks = value end |
#marginBottom ⇒ Integer
Returns the margin that should appear at the bottom of the DOCX document page.
145 146 147 |
# File 'lib/grabzit/docxoptions.rb', line 145 def marginBottom @marginBottom end |
#marginBottom=(value) ⇒ void
This method returns an undefined value.
Set the margin that should appear at the bottom of the DOCX document page
153 154 155 |
# File 'lib/grabzit/docxoptions.rb', line 153 def marginBottom=(value) @marginBottom = value end |
#marginLeft ⇒ Integer
Returns the margin that should appear at the left of the DOCX document page.
132 133 134 |
# File 'lib/grabzit/docxoptions.rb', line 132 def marginLeft @marginLeft end |
#marginLeft=(value) ⇒ void
This method returns an undefined value.
Set the margin that should appear at the left of the DOCX document page
140 141 142 |
# File 'lib/grabzit/docxoptions.rb', line 140 def marginLeft=(value) @marginLeft = value end |
#marginRight ⇒ Integer
Returns the margin that should appear at the right of the DOCX document.
158 159 160 |
# File 'lib/grabzit/docxoptions.rb', line 158 def marginRight @marginRight end |
#marginRight=(value) ⇒ void
This method returns an undefined value.
Set the margin that should appear at the right of the DOCX document
166 167 168 |
# File 'lib/grabzit/docxoptions.rb', line 166 def marginRight=(value) @marginRight = value end |
#marginTop ⇒ Integer
Returns the margin that should appear at the top of the DOCX document page.
119 120 121 |
# File 'lib/grabzit/docxoptions.rb', line 119 def marginTop @marginTop end |
#marginTop=(value) ⇒ void
This method returns an undefined value.
Set the margin that should appear at the top of the DOCX document page
127 128 129 |
# File 'lib/grabzit/docxoptions.rb', line 127 def marginTop=(value) @marginTop = value end |
#mergeId ⇒ String
Returns get the ID of a capture that should be merged at the beginning of the new DOCX document.
314 315 316 |
# File 'lib/grabzit/docxoptions.rb', line 314 def mergeId @mergeId end |
#mergeId=(value) ⇒ void
This method returns an undefined value.
Set the ID of a capture that should be merged at the beginning of the new DOCX document
322 323 324 |
# File 'lib/grabzit/docxoptions.rb', line 322 def mergeId=(value) @mergeId = value end |
#noAds ⇒ Boolean
Returns get if adverts should be automatically hidden.
327 328 329 |
# File 'lib/grabzit/docxoptions.rb', line 327 def noAds @noAds end |
#noAds=(value) ⇒ void
This method returns an undefined value.
Set to true if adverts should be automatically hidden
335 336 337 |
# File 'lib/grabzit/docxoptions.rb', line 335 def noAds=(value) @noAds = value end |
#noCookieNotifications ⇒ Boolean
Returns get if cookie notifications should be automatically hidden.
341 342 343 |
# File 'lib/grabzit/docxoptions.rb', line 341 def noCookieNotifications @noCookieNotifications end |
#noCookieNotifications=(value) ⇒ void
This method returns an undefined value.
Set to true if cookie notifications should be automatically hidden
349 350 351 |
# File 'lib/grabzit/docxoptions.rb', line 349 def noCookieNotifications=(value) @noCookieNotifications = value end |
#orientation ⇒ String
Returns the orientation of the DOCX to be returned.
66 67 68 |
# File 'lib/grabzit/docxoptions.rb', line 66 def orientation @orientation end |
#orientation=(value) ⇒ void
This method returns an undefined value.
Set the orientation of the DOCX to be returned: ‘Landscape’ or ‘Portrait’
74 75 76 77 |
# File 'lib/grabzit/docxoptions.rb', line 74 def orientation=(value) value = GrabzIt::Utility.nil_check(value).capitalize @orientation = value end |
#pageHeight ⇒ Integer
Returns get the page height of the resulting DOCX in mm.
197 198 199 |
# File 'lib/grabzit/docxoptions.rb', line 197 def pageHeight @height end |
#pageHeight=(value) ⇒ void
This method returns an undefined value.
Set the page height of the resulting DOCX in mm
205 206 207 |
# File 'lib/grabzit/docxoptions.rb', line 205 def pageHeight=(value) @height = value end |
#pagesize ⇒ String
Returns the page size of the DOCX to be returned.
52 53 54 |
# File 'lib/grabzit/docxoptions.rb', line 52 def pagesize @pagesize end |
#pagesize=(value) ⇒ void
This method returns an undefined value.
Set the page size of the DOCX to be returned: ‘A3’, ‘A4’, ‘A5’, ‘A6’, ‘B3’, ‘B4’, ‘B5’, ‘B6’, ‘Letter’
60 61 62 63 |
# File 'lib/grabzit/docxoptions.rb', line 60 def pagesize=(value) value = GrabzIt::Utility.nil_check(value).upcase @pagesize = value end |
#pageWidth ⇒ Integer
Returns get the page width of the resulting DOCX in mm.
184 185 186 |
# File 'lib/grabzit/docxoptions.rb', line 184 def pageWidth @width end |
#pageWidth=(value) ⇒ void
This method returns an undefined value.
Set the page width of the resulting DOCX in mm
192 193 194 |
# File 'lib/grabzit/docxoptions.rb', line 192 def pageWidth=(value) @width = value end |
#password ⇒ String
Returns get the password that protects the DOCX document.
367 368 369 |
# File 'lib/grabzit/docxoptions.rb', line 367 def password @password end |
#password=(value) ⇒ void
This method returns an undefined value.
Set the password that protects the DOCX document
375 376 377 |
# File 'lib/grabzit/docxoptions.rb', line 375 def password=(value) @password = value end |
#quality ⇒ Integer
Returns the quality of the DOCX.
249 250 251 |
# File 'lib/grabzit/docxoptions.rb', line 249 def quality @quality end |
#quality=(value) ⇒ void
This method returns an undefined value.
Set the quality of the DOCX where 0 is poor and 100 excellent. The default is -1 which uses the recommended quality
257 258 259 |
# File 'lib/grabzit/docxoptions.rb', line 257 def quality=(value) @quality = value end |
#requestAs ⇒ Integer
Returns get which user agent type should be used.
223 224 225 |
# File 'lib/grabzit/docxoptions.rb', line 223 def requestAs @requestAs end |
#requestAs=(value) ⇒ void
This method returns an undefined value.
Set which user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3
231 232 233 |
# File 'lib/grabzit/docxoptions.rb', line 231 def requestAs=(value) @requestAs = value end |
#targetElement ⇒ String
Returns get the CSS selector of the only HTML element in the web page to capture.
262 263 264 |
# File 'lib/grabzit/docxoptions.rb', line 262 def targetElement @targetElement end |
#targetElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector of the only HTML element in the web page to capture
270 271 272 |
# File 'lib/grabzit/docxoptions.rb', line 270 def targetElement=(value) @targetElement = value end |
#templateId ⇒ String
Returns the template ID that specifies the header and footer of the DOCX document.
236 237 238 |
# File 'lib/grabzit/docxoptions.rb', line 236 def templateId @templateId end |
#templateId=(value) ⇒ void
This method returns an undefined value.
Set a template ID that specifies the header and footer of the DOCX document
244 245 246 |
# File 'lib/grabzit/docxoptions.rb', line 244 def templateId=(value) @templateId = value end |
#title ⇒ String
Returns a title for the DOCX document.
106 107 108 |
# File 'lib/grabzit/docxoptions.rb', line 106 def title @title end |
#title=(value) ⇒ void
This method returns an undefined value.
Set a title for the DOCX document
114 115 116 |
# File 'lib/grabzit/docxoptions.rb', line 114 def title=(value) @title = value end |
#waitForElement ⇒ String
Returns get the CSS selector of the HTML element in the web page that must be visible before the capture is performed.
288 289 290 |
# File 'lib/grabzit/docxoptions.rb', line 288 def waitForElement @waitForElement end |
#waitForElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector of the HTML element in the web page that must be visible before the capture is performed
296 297 298 |
# File 'lib/grabzit/docxoptions.rb', line 296 def waitForElement=(value) @waitForElement = value end |