Class: DynamicPDFApi::PdfInstructions

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_client/PdfInstructions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePdfInstructions

Returns a new instance of PdfInstructions.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ruby_client/PdfInstructions.rb', line 10

def initialize
  @_author = ''
  @_title = ''
  @_subject = ''
  @_creator = ''
  @_producer = ''
  @_tag = nil
  @_keywords = ''
  @_form_fields = []
  @_templates = {}
  @_fonts = {}
  @_out_lines = []
  @_inputs = []
  @_security = nil
  @_flatten_all_form_fields = nil
  @_retain_signature_form_fields = nil
end

Instance Attribute Details

#_authorObject

Returns the value of attribute _author.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _author
  @_author
end

#_creatorObject

Returns the value of attribute _creator.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _creator
  @_creator
end

#_flatten_all_form_fieldsObject

Returns the value of attribute _flatten_all_form_fields.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _flatten_all_form_fields
  @_flatten_all_form_fields
end

#_fontsObject

Returns the value of attribute _fonts.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _fonts
  @_fonts
end

#_form_fieldsObject

Returns the value of attribute _form_fields.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _form_fields
  @_form_fields
end

#_inputsObject

Returns the value of attribute _inputs.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _inputs
  @_inputs
end

#_keywordsObject

Returns the value of attribute _keywords.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _keywords
  @_keywords
end

#_out_linesObject

Returns the value of attribute _out_lines.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _out_lines
  @_out_lines
end

#_producerObject

Returns the value of attribute _producer.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _producer
  @_producer
end

#_retain_signature_form_fieldsObject

Returns the value of attribute _retain_signature_form_fields.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _retain_signature_form_fields
  @_retain_signature_form_fields
end

#_securityObject

Returns the value of attribute _security.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _security
  @_security
end

#_subjectObject

Returns the value of attribute _subject.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _subject
  @_subject
end

#_tagObject

Returns the value of attribute _tag.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _tag
  @_tag
end

#_templatesObject

Returns the value of attribute _templates.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _templates
  @_templates
end

#_titleObject

Returns the value of attribute _title.



7
8
9
# File 'lib/ruby_client/PdfInstructions.rb', line 7

def _title
  @_title
end

Instance Method Details

#to_json(indented = false) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/ruby_client/PdfInstructions.rb', line 28

def to_json( indented = false)
  # @inputJsonArray = []

  # @_Inputs.each do |input|
  #   if(input != nil)
  #   @inputJsonArray << input
  #   end
  # end

  fonts_json = []
  @_fonts.each_value do |font|
    fonts_json << font
  end

  templates_json = []
  @_templates.each_value do |template|
    templates_json << template unless template.nil?
  end

  json_array = {}

  if(templates_json.length > 0)
    json_array['templates'] = templates_json
  end

  if(fonts_json.length > 0)
    json_array['fonts'] = fonts_json
  end

  if(@_author != nil)
    json_array['author'] = @_author
  end

  if(@_title != nil)
    json_array['title'] = @_title
  end

  json_array['subject'] = @_subject unless @_subject.nil?

  json_array['creator'] = @_creator unless @_creator.nil?

  json_array['producer'] = @_producer unless @_producer.nil?

  json_array['tag'] = @_tag unless @_tag.nil?

  json_array['keywords'] = @_keywords unless @_keywords.nil?

  json_array['security'] = @_security unless @_security.nil?

  json_array['flattenAllFormFields'] = @_flatten_all_form_fields unless @_flatten_all_form_fields.nil?

  json_array['retainSignatureFormFields'] = @_retain_signature_form_fields unless @_retain_signature_form_fields.nil?

  json_array['inputs'] = @_inputs

  if(@_form_fields.length > 0)
    json_array['formFields'] = @_form_fields
  end

  if(!@_out_lines._out_lines.empty?)
    json_array['outlines'] = @_out_lines
  end
  if(indented)
    JSON.pretty_generate(json_array)
  else
    JSON.generate(json_array)
  end
end