Class: Ilovepdf::Tool::Pagenumber
- Inherits:
-
Ilovepdf::Task
- Object
- Ilovepdf
- Ilovepdf::Task
- Ilovepdf::Tool::Pagenumber
- Defined in:
- lib/ilovepdf/tool/pagenumber.rb
Constant Summary collapse
- API_PARAMS =
[ :facing_pages, :first_cover, :pages, :starting_number, :vertical_position, :horizontal_position, :vertical_position_adjustment, :horizontal_position_adjustment, :font_family, :font_style, :font_size, :font_color, :text ]
- VERTICAL_POSITION_VALUES =
['bottom', 'middle' ,'top']
- HORIZONTAL_POSITION_VALUES =
['left', 'center', 'right']
- FONT_FAMILY_VALUES =
[ 'Arial', 'Arial Unicode MS', 'Verdana', 'Courier', 'Times New Roman', 'Comic Sans MS', 'WenQuanYi Zen Hei', 'Lohit Marathi' ]
Constants inherited from Ilovepdf::Task
Constants included from Ilovepdf
Instance Attribute Summary
Attributes inherited from Ilovepdf::Task
#ignore_errors, #ignore_password, #output_filename, #packaged_filename, #result, #task_id, #tool, #try_pdf_repair
Instance Method Summary collapse
- #font_family=(new_val) ⇒ Object
- #horizontal_position=(new_val) ⇒ Object
-
#initialize(public_key, secret_key, make_start = true) ⇒ Pagenumber
constructor
A new instance of Pagenumber.
- #vertical_position=(new_val) ⇒ Object
Methods inherited from Ilovepdf::Task
#add_file, #add_file_from_url, #assign_meta_value, #blob, #chained_task?, #delete!, #delete_file, #download, #download_info, #enable_file_encryption, #execute, #files, #next, #status
Methods included from Ilovepdf
Constructor Details
#initialize(public_key, secret_key, make_start = true) ⇒ Pagenumber
Returns a new instance of Pagenumber.
19 20 21 22 |
# File 'lib/ilovepdf/tool/pagenumber.rb', line 19 def initialize(public_key, secret_key, make_start=true) self.tool = :pagenumber super(public_key, secret_key, make_start) end |
Instance Method Details
#font_family=(new_val) ⇒ Object
34 35 36 37 |
# File 'lib/ilovepdf/tool/pagenumber.rb', line 34 def font_family=(new_val) raise Errors::ArgumentEnumError.new(FONT_FAMILY_VALUES) unless FONT_FAMILY_VALUES.include? new_val @font_family = new_val end |
#horizontal_position=(new_val) ⇒ Object
29 30 31 32 |
# File 'lib/ilovepdf/tool/pagenumber.rb', line 29 def horizontal_position=(new_val) raise Errors::ArgumentEnumError.new(HORIZONTAL_POSITION_VALUES) unless HORIZONTAL_POSITION_VALUES.include? new_val @horizontal_position = new_val end |
#vertical_position=(new_val) ⇒ Object
24 25 26 27 |
# File 'lib/ilovepdf/tool/pagenumber.rb', line 24 def vertical_position=(new_val) raise Errors::ArgumentEnumError.new(VERTICAL_POSITION_VALUES) unless VERTICAL_POSITION_VALUES.include? new_val @vertical_position = new_val end |