Class: Pdf4me::CreateThumbnail
- Inherits:
-
WrapperAction
- Object
- WrapperAction
- Pdf4me::CreateThumbnail
- Defined in:
- lib/pdf4me/actions/create_thumbnail.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#image_format ⇒ Object
Returns the value of attribute image_format.
-
#page_number ⇒ Object
Returns the value of attribute page_number.
-
#save_path ⇒ Object
Returns the value of attribute save_path.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from WrapperAction
Instance Method Summary collapse
Methods inherited from WrapperAction
#assign_attributes, #initialize, #run, #run!
Constructor Details
This class inherits a constructor from Pdf4me::WrapperAction
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/pdf4me/actions/create_thumbnail.rb', line 3 def file @file end |
#image_format ⇒ Object
Returns the value of attribute image_format.
3 4 5 |
# File 'lib/pdf4me/actions/create_thumbnail.rb', line 3 def image_format @image_format end |
#page_number ⇒ Object
Returns the value of attribute page_number.
3 4 5 |
# File 'lib/pdf4me/actions/create_thumbnail.rb', line 3 def page_number @page_number end |
#save_path ⇒ Object
Returns the value of attribute save_path.
3 4 5 |
# File 'lib/pdf4me/actions/create_thumbnail.rb', line 3 def save_path @save_path end |
#width ⇒ Object
Returns the value of attribute width.
3 4 5 |
# File 'lib/pdf4me/actions/create_thumbnail.rb', line 3 def width @width end |
Instance Method Details
#call_api ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/pdf4me/actions/create_thumbnail.rb', line 44 def call_api client.multipart_post( path, file: File.open(file, 'rb'), pageNr: page_number, width: width, imageFormat: image_format ) do |request| download(request, save_path) end end |
#defaults ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/pdf4me/actions/create_thumbnail.rb', line 30 def defaults { width: 100, image_format: 'png', page_number: 1 } end |
#path ⇒ Object
26 27 28 |
# File 'lib/pdf4me/actions/create_thumbnail.rb', line 26 def path '/Image/CreateThumbnail' end |