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.
-
#hoverElement ⇒ String
Get the CSS selector of the HTML element in the web page that must hovered over before the capture is performed.
-
#hoverElement=(value) ⇒ void
Set the CSS selector of the HTML element in the web page that must hovered over before the capture is performed.
-
#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.
-
#jsCode ⇒ String
Get the JavaScript code that will be execute in the web page before the capture is performed.
-
#jsCode=(value) ⇒ void
Set the JavaScript code that will be execute in the web page before the capture is performed.
-
#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.
-
#scrollElement ⇒ String
Get the CSS selector of the HTML element in the web page that must scroll to before the capture is performed.
-
#scrollElement=(value) ⇒ void
Set the CSS selector of the HTML element in the web page that must scroll to before the capture is performed.
-
#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 37 38 39 |
# 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 @jsCode = nil @scrollElement = nil @hoverElement = 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.
413 414 415 |
# File 'lib/grabzit/docxoptions.rb', line 413 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.
421 422 423 |
# File 'lib/grabzit/docxoptions.rb', line 421 def add_template_parameter(name, value) @templateVariables = appendParameter(@templateVariables, name, value) end |
#address ⇒ String
Returns get the URL to execute the HTML code in.
383 384 385 |
# File 'lib/grabzit/docxoptions.rb', line 383 def address @address end |
#address=(value) ⇒ void
This method returns an undefined value.
Set the URL to execute the HTML code in
391 392 393 |
# File 'lib/grabzit/docxoptions.rb', line 391 def address=(value) @address = value end |
#browserWidth ⇒ Integer
Returns the width of the browser in pixels.
174 175 176 |
# File 'lib/grabzit/docxoptions.rb', line 174 def browserWidth @browserWidth end |
#browserWidth=(value) ⇒ void
This method returns an undefined value.
Set the width of the browser in pixels
182 183 184 |
# File 'lib/grabzit/docxoptions.rb', line 182 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.
304 305 306 |
# File 'lib/grabzit/docxoptions.rb', line 304 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
312 313 314 |
# File 'lib/grabzit/docxoptions.rb', line 312 def clickElement=(value) @clickElement = value end |
#delay ⇒ Integer
Returns the number of milliseconds to wait before creating the capture.
213 214 215 |
# File 'lib/grabzit/docxoptions.rb', line 213 def delay @delay end |
#delay=(value) ⇒ void
This method returns an undefined value.
Set the number of milliseconds to wait before creating the capture
221 222 223 |
# File 'lib/grabzit/docxoptions.rb', line 221 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.
278 279 280 |
# File 'lib/grabzit/docxoptions.rb', line 278 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
286 287 288 |
# File 'lib/grabzit/docxoptions.rb', line 286 def hideElement=(value) @hideElement = value end |
#hoverElement ⇒ String
Returns get the CSS selector of the HTML element in the web page that must hovered over before the capture is performed.
330 331 332 |
# File 'lib/grabzit/docxoptions.rb', line 330 def hoverElement @hoverElement end |
#hoverElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector of the HTML element in the web page that must hovered over before the capture is performed
338 339 340 |
# File 'lib/grabzit/docxoptions.rb', line 338 def hoverElement=(value) @hoverElement = value end |
#includeBackground ⇒ Boolean
Returns true if the background images of the web page should be included in the DOCX.
42 43 44 |
# File 'lib/grabzit/docxoptions.rb', line 42 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
50 51 52 |
# File 'lib/grabzit/docxoptions.rb', line 50 def includeBackground=(value) @includeBackground = value end |
#includeImages ⇒ Boolean
Returns true if web page images should be included.
96 97 98 |
# File 'lib/grabzit/docxoptions.rb', line 96 def includeImages @includeImages end |
#includeImages=(value) ⇒ void
This method returns an undefined value.
Set to true if web page images should be included
104 105 106 |
# File 'lib/grabzit/docxoptions.rb', line 104 def includeImages=(value) @includeImages = value end |
#includeLinks ⇒ Boolean
Returns true if the links should be included in the DOCX.
83 84 85 |
# File 'lib/grabzit/docxoptions.rb', line 83 def includeLinks @includeLinks end |
#includeLinks=(value) ⇒ void
This method returns an undefined value.
Set to true if links should be included in the DOCX
91 92 93 |
# File 'lib/grabzit/docxoptions.rb', line 91 def includeLinks=(value) @includeLinks = value end |
#jsCode ⇒ String
Returns get the JavaScript code that will be execute in the web page before the capture is performed.
426 427 428 |
# File 'lib/grabzit/docxoptions.rb', line 426 def jsCode @jsCode end |
#jsCode=(value) ⇒ void
This method returns an undefined value.
Set the JavaScript code that will be execute in the web page before the capture is performed
434 435 436 |
# File 'lib/grabzit/docxoptions.rb', line 434 def jsCode=(value) @jsCode = value end |
#marginBottom ⇒ Integer
Returns the margin that should appear at the bottom of the DOCX document page.
148 149 150 |
# File 'lib/grabzit/docxoptions.rb', line 148 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
156 157 158 |
# File 'lib/grabzit/docxoptions.rb', line 156 def marginBottom=(value) @marginBottom = value end |
#marginLeft ⇒ Integer
Returns the margin that should appear at the left of the DOCX document page.
135 136 137 |
# File 'lib/grabzit/docxoptions.rb', line 135 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
143 144 145 |
# File 'lib/grabzit/docxoptions.rb', line 143 def marginLeft=(value) @marginLeft = value end |
#marginRight ⇒ Integer
Returns the margin that should appear at the right of the DOCX document.
161 162 163 |
# File 'lib/grabzit/docxoptions.rb', line 161 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
169 170 171 |
# File 'lib/grabzit/docxoptions.rb', line 169 def marginRight=(value) @marginRight = value end |
#marginTop ⇒ Integer
Returns the margin that should appear at the top of the DOCX document page.
122 123 124 |
# File 'lib/grabzit/docxoptions.rb', line 122 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
130 131 132 |
# File 'lib/grabzit/docxoptions.rb', line 130 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.
343 344 345 |
# File 'lib/grabzit/docxoptions.rb', line 343 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
351 352 353 |
# File 'lib/grabzit/docxoptions.rb', line 351 def mergeId=(value) @mergeId = value end |
#noAds ⇒ Boolean
Returns get if adverts should be automatically hidden.
356 357 358 |
# File 'lib/grabzit/docxoptions.rb', line 356 def noAds @noAds end |
#noAds=(value) ⇒ void
This method returns an undefined value.
Set to true if adverts should be automatically hidden
364 365 366 |
# File 'lib/grabzit/docxoptions.rb', line 364 def noAds=(value) @noAds = value end |
#noCookieNotifications ⇒ Boolean
Returns get if cookie notifications should be automatically hidden.
370 371 372 |
# File 'lib/grabzit/docxoptions.rb', line 370 def noCookieNotifications @noCookieNotifications end |
#noCookieNotifications=(value) ⇒ void
This method returns an undefined value.
Set to true if cookie notifications should be automatically hidden
378 379 380 |
# File 'lib/grabzit/docxoptions.rb', line 378 def noCookieNotifications=(value) @noCookieNotifications = value end |
#orientation ⇒ String
Returns the orientation of the DOCX to be returned.
69 70 71 |
# File 'lib/grabzit/docxoptions.rb', line 69 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’
77 78 79 80 |
# File 'lib/grabzit/docxoptions.rb', line 77 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.
200 201 202 |
# File 'lib/grabzit/docxoptions.rb', line 200 def pageHeight @height end |
#pageHeight=(value) ⇒ void
This method returns an undefined value.
Set the page height of the resulting DOCX in mm
208 209 210 |
# File 'lib/grabzit/docxoptions.rb', line 208 def pageHeight=(value) @height = value end |
#pagesize ⇒ String
Returns the page size of the DOCX to be returned.
55 56 57 |
# File 'lib/grabzit/docxoptions.rb', line 55 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’
63 64 65 66 |
# File 'lib/grabzit/docxoptions.rb', line 63 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.
187 188 189 |
# File 'lib/grabzit/docxoptions.rb', line 187 def pageWidth @width end |
#pageWidth=(value) ⇒ void
This method returns an undefined value.
Set the page width of the resulting DOCX in mm
195 196 197 |
# File 'lib/grabzit/docxoptions.rb', line 195 def pageWidth=(value) @width = value end |
#password ⇒ String
Returns get the password that protects the DOCX document.
396 397 398 |
# File 'lib/grabzit/docxoptions.rb', line 396 def password @password end |
#password=(value) ⇒ void
This method returns an undefined value.
Set the password that protects the DOCX document
404 405 406 |
# File 'lib/grabzit/docxoptions.rb', line 404 def password=(value) @password = value end |
#quality ⇒ Integer
Returns the quality of the DOCX.
252 253 254 |
# File 'lib/grabzit/docxoptions.rb', line 252 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
260 261 262 |
# File 'lib/grabzit/docxoptions.rb', line 260 def quality=(value) @quality = value end |
#requestAs ⇒ Integer
Returns get which user agent type should be used.
226 227 228 |
# File 'lib/grabzit/docxoptions.rb', line 226 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
234 235 236 |
# File 'lib/grabzit/docxoptions.rb', line 234 def requestAs=(value) @requestAs = value end |
#scrollElement ⇒ String
Returns get the CSS selector of the HTML element in the web page that must scroll to before the capture is performed.
317 318 319 |
# File 'lib/grabzit/docxoptions.rb', line 317 def scrollElement @scrollElement end |
#scrollElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector of the HTML element in the web page that must scroll to before the capture is performed
325 326 327 |
# File 'lib/grabzit/docxoptions.rb', line 325 def scrollElement=(value) @scrollElement = value end |
#targetElement ⇒ String
Returns get the CSS selector of the only HTML element in the web page to capture.
265 266 267 |
# File 'lib/grabzit/docxoptions.rb', line 265 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
273 274 275 |
# File 'lib/grabzit/docxoptions.rb', line 273 def targetElement=(value) @targetElement = value end |
#templateId ⇒ String
Returns the template ID that specifies the header and footer of the DOCX document.
239 240 241 |
# File 'lib/grabzit/docxoptions.rb', line 239 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
247 248 249 |
# File 'lib/grabzit/docxoptions.rb', line 247 def templateId=(value) @templateId = value end |
#title ⇒ String
Returns a title for the DOCX document.
109 110 111 |
# File 'lib/grabzit/docxoptions.rb', line 109 def title @title end |
#title=(value) ⇒ void
This method returns an undefined value.
Set a title for the DOCX document
117 118 119 |
# File 'lib/grabzit/docxoptions.rb', line 117 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.
291 292 293 |
# File 'lib/grabzit/docxoptions.rb', line 291 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
299 300 301 |
# File 'lib/grabzit/docxoptions.rb', line 299 def waitForElement=(value) @waitForElement = value end |