pdfcrowd 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pdfcrowd.rb +7 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- data.tar.gz: 5562a39162351e15148ecf1ffbc6fe7bd2c7f039
4
- metadata.gz: 330aeca5d18142d232dd63431f35c74bc8221d80
3
+ data.tar.gz: 900f4ab01a2c350cec4d9eb0826f4963ed12b2a3
4
+ metadata.gz: dc46743745d821923d5b11ba9a8662373b48bdb4
5
5
  SHA512:
6
- data.tar.gz: d98fc1713d73e1818760af9ce050385abf2961e4eebb262e2605d77efdf1056aa1296d1c3d8b381ddc17c5becf188e35806c414a9eab34fa558142662bc8d5aa
7
- metadata.gz: bbd5c20891097d095e1c567a4da82e55f978913d0cc90bc74cd60691d3558f8e5207adfee2444a3d1dd8393aef25f4433d4430d7b7ce1d19b82f08d8027ca925
6
+ data.tar.gz: a0e9e3fe62e1dda21bbe693d53c59885134c1cd626c9694e2e8d1d1c7a0ad147756d85c44c7df3ed8321df04eabbb0cfbd47ef92ad6c0f843b2cf47fa65a0924
7
+ metadata.gz: 5a59d70d4325c1fc56aeea620fab2164acaa9f82c94bbeeba2468344f986843b317cac4655b28238bc2b00f2aa7892a904cfccb0f37fe581633779d61c3bd1dc
data/lib/pdfcrowd.rb CHANGED
@@ -66,7 +66,7 @@ module Pdfcrowd
66
66
  # username -- your username at Pdfcrowd
67
67
  # apikey -- your API key
68
68
  #
69
- def initialize(username, apikey)
69
+ def initialize(username, apikey, hostname=nil)
70
70
  useSSL(false)
71
71
  @fields = {
72
72
  'username' => username,
@@ -74,6 +74,7 @@ module Pdfcrowd
74
74
  'html_zoom' => 200,
75
75
  'pdf_scaling_factor' => 1
76
76
  }
77
+ @hostname = hostname || $api_hostname;
77
78
  end
78
79
 
79
80
  #
@@ -309,13 +310,13 @@ module Pdfcrowd
309
310
  def create_http_obj()
310
311
  if @use_ssl
311
312
  require 'net/https' #apt-get install libopenssl-ruby
312
- http = Net::HTTP.new($api_hostname, $api_https_port)
313
+ http = Net::HTTP.new(@hostname, $api_https_port)
313
314
  # OpenSSL::SSL::VERIFY_PEER fails here:
314
315
  # ... certificate verify failed ...
315
316
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
316
317
  http.use_ssl = @use_ssl
317
318
  else
318
- http = Net::HTTP.new($api_hostname, $api_http_port)
319
+ http = Net::HTTP.new(@hostname, $api_http_port)
319
320
  end
320
321
  return http
321
322
  end
@@ -483,10 +484,10 @@ if __FILE__ == $0
483
484
  [:enablePdfcrowdLogo, true],
484
485
  [:setInitialPdfZoomType, Pdfcrowd::FIT_PAGE],
485
486
  [:setInitialPdfExactZoom, 113],
486
- [:setFooterHtml, '<b>bold</b> and <i>italic</i> <img src="http://pdfcrowd.com/static/images/logo175x30.png" />'],
487
- [:setFooterUrl, 'http://pdfcrowd.com/hub/random/footer.html'],
487
+ [:setFooterHtml, '<b>bold</b> and <i>italic</i> <img src="http://s3.pdfcrowd.com/test-resources/logo175x30.png" />'],
488
+ [:setFooterUrl, 'http://s3.pdfcrowd.com/test-resources/footer.html'],
488
489
  [:setHeaderHtml, 'page %p out of %n'],
489
- [:setHeaderUrl, 'http://pdfcrowd.com/hub/random/header.html'],
490
+ [:setHeaderUrl, 'http://s3.pdfcrowd.com/test-resources/header.html'],
490
491
  [:setPdfScalingFactor, 0.5],
491
492
  [:setPageBackgroundColor, 'ee82EE'],
492
493
  [:setTransparentBackground, true]]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfcrowd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pdfcrowd Team
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2013-03-13 00:00:00 Z
12
+ date: 2013-08-05 00:00:00 Z
13
13
  dependencies: []
14
14
 
15
15
  description: It lets you easily convert web pages and raw HTML code to PDF in your Ruby applications.