Class: Pdfcrowd::ConnectionHelper

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

Instance Method Summary collapse

Constructor Details

#initialize(user_name, api_key) ⇒ ConnectionHelper

Returns a new instance of ConnectionHelper.



536
537
538
539
540
541
542
543
544
545
546
547
548
# File 'lib/pdfcrowd.rb', line 536

def initialize(user_name, api_key)
    @user_name = user_name
    @api_key = api_key

    reset_response_data()

    setProxy(nil, nil, nil, nil)
    setUseHttp(false)
    setUserAgent('pdfcrowd_ruby_client/5.13.1 (https://pdfcrowd.com)')

    @retry_count = 1
    @converter_version = '20.10'
end

Instance Method Details

#getConsumedCreditCountObject



588
589
590
# File 'lib/pdfcrowd.rb', line 588

def getConsumedCreditCount()
    @consumed_credits
end

#getConverterVersionObject



608
609
610
# File 'lib/pdfcrowd.rb', line 608

def getConverterVersion()
    @converter_version
end

#getDebugLogUrlObject



580
581
582
# File 'lib/pdfcrowd.rb', line 580

def getDebugLogUrl()
    @debug_log_url
end

#getJobIdObject



592
593
594
# File 'lib/pdfcrowd.rb', line 592

def getJobId()
    @job_id
end

#getOutputSizeObject



604
605
606
# File 'lib/pdfcrowd.rb', line 604

def getOutputSize()
    @output_size
end

#getPageCountObject



596
597
598
# File 'lib/pdfcrowd.rb', line 596

def getPageCount()
    @page_count
end

#getRemainingCreditCountObject



584
585
586
# File 'lib/pdfcrowd.rb', line 584

def getRemainingCreditCount()
    @credits
end

#getTotalPageCountObject



600
601
602
# File 'lib/pdfcrowd.rb', line 600

def getTotalPageCount()
    @total_page_count
end

#post(fields, files, raw_data, out_stream = nil) ⇒ Object



550
551
552
553
554
555
# File 'lib/pdfcrowd.rb', line 550

def post(fields, files, raw_data, out_stream = nil)
    request = create_request()
    request.body = ConnectionHelper.encode_multipart_post_data(fields, files, raw_data)
    request.content_type = 'multipart/form-data; boundary=' + MULTIPART_BOUNDARY
    do_post(request, out_stream)
end

#setConverterVersion(converter_version) ⇒ Object



569
570
571
# File 'lib/pdfcrowd.rb', line 569

def setConverterVersion(converter_version)
    @converter_version = converter_version
end

#setProxy(host, port, user_name, password) ⇒ Object



573
574
575
576
577
578
# File 'lib/pdfcrowd.rb', line 573

def setProxy(host, port, user_name, password)
    @proxy_host = host
    @proxy_port = port
    @proxy_user_name = user_name
    @proxy_password = password
end

#setRetryCount(retry_count) ⇒ Object



565
566
567
# File 'lib/pdfcrowd.rb', line 565

def setRetryCount(retry_count)
    @retry_count = retry_count
end

#setUseHttp(use_http) ⇒ Object



557
558
559
# File 'lib/pdfcrowd.rb', line 557

def setUseHttp(use_http)
    @use_http = use_http
end

#setUserAgent(user_agent) ⇒ Object



561
562
563
# File 'lib/pdfcrowd.rb', line 561

def setUserAgent(user_agent)
    @user_agent = user_agent
end