Class: Pdf4me::TextStamp

Inherits:
WrapperAction show all
Defined in:
lib/pdf4me/actions/text_stamp.rb

Instance Attribute Summary collapse

Attributes inherited from WrapperAction

#client

Instance Method Summary collapse

Methods inherited from WrapperAction

#assign_attributes, #defaults, #initialize, #run, #run!

Constructor Details

This class inherits a constructor from Pdf4me::WrapperAction

Instance Attribute Details

#fileObject

Returns the value of attribute file.



3
4
5
# File 'lib/pdf4me/actions/text_stamp.rb', line 3

def file
  @file
end

#pagesObject

Returns the value of attribute pages.



3
4
5
# File 'lib/pdf4me/actions/text_stamp.rb', line 3

def pages
  @pages
end

#position_xObject

Returns the value of attribute position_x.



3
4
5
# File 'lib/pdf4me/actions/text_stamp.rb', line 3

def position_x
  @position_x
end

#position_yObject

Returns the value of attribute position_y.



3
4
5
# File 'lib/pdf4me/actions/text_stamp.rb', line 3

def position_y
  @position_y
end

#save_pathObject

Returns the value of attribute save_path.



3
4
5
# File 'lib/pdf4me/actions/text_stamp.rb', line 3

def save_path
  @save_path
end

#textObject

Returns the value of attribute text.



3
4
5
# File 'lib/pdf4me/actions/text_stamp.rb', line 3

def text
  @text
end

Instance Method Details

#call_apiObject



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/pdf4me/actions/text_stamp.rb', line 44

def call_api
  client.multipart_post(
    path,
    file: File.open(file, 'rb'),
    alignX: position_x,
    alignY: position_y,
    text: text,
    pages: pages.join(',')
  ) do |request|
    download(request, save_path)
  end
end

#pathObject



40
41
42
# File 'lib/pdf4me/actions/text_stamp.rb', line 40

def path
  '/Stamp/TextStamp'
end