phantompdf 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85d23e201ff67bfa2a2cb062598958f3e20692ac
4
- data.tar.gz: f3131136cd9d8fe3dbaa42d2035f8075181c3204
3
+ metadata.gz: 1546382213576c76cc2ac584658eb84b522af278
4
+ data.tar.gz: 46c3fe577f3bc88df12e9bb544f6db2bc8763d82
5
5
  SHA512:
6
- metadata.gz: e34b9946fa33849e77fc81da9249dbca22976d6894b8d785335de4942b3151063f3f28582e135b01ad5c52e995ebf0b69c86d1688965967262cf7b00a94a5149
7
- data.tar.gz: 6a10d61088b8d8583a33ca4182f879a49e530979a726174253df0318362a631e29248515cdf63124b190cf43cd79f32a904914907f7f1401dc393b9d4a1cf626
6
+ metadata.gz: 7ef376e13ffcfddf8913d6cfa1e4d7f03c4db57e7f12cbbcdb6f15584386f67eb339d6437fe204c4c4407d238072392ff62425bc88cf8f721cf1b829513f7287
7
+ data.tar.gz: 004000c5183f70940a722df4fc3a287000f4e4141ba9444d3c05df8fd4ab5aeead83d23a4e1e72158e3fcc781eaef294d6c88953f86026cfc2c4c51d9ee1e74c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- phantompdf (1.0.4)
4
+ phantompdf (1.0.5)
5
5
  json
6
6
  phantomjs
7
7
 
@@ -1,3 +1,3 @@
1
1
  module PhantomPDF
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -68,15 +68,22 @@ var // PhantomJS CAN NOT handle images in custom header/footer,
68
68
 
69
69
  render_pdf = function(html){
70
70
  if (!is_html(html)) {
71
- phantom.exit(1);
71
+ console.log('Invalid HTML source for rendering!');
72
72
 
73
- throw 'Invalid HTML source!';
73
+ phantom.exit(1);
74
74
  }
75
75
 
76
76
  page.content = inject_images(html);
77
77
 
78
78
  window.setTimeout(function(){
79
- page.render(output + '_tmp.pdf');
79
+ var output_tmp = output + '_tmp.pdf';
80
+
81
+ page.render(output_tmp);
82
+ if (!fs.exists(output_tmp)) {
83
+ console.log('Failed to render pdf tmp file!');
84
+
85
+ phantom.exit(1);
86
+ }
80
87
 
81
88
  if (fs.exists(output)) {
82
89
  fs.remove(output);
@@ -88,9 +95,9 @@ var // PhantomJS CAN NOT handle images in custom header/footer,
88
95
  // return pdf file path
89
96
  console.log(output);
90
97
  } catch (e) {
91
- phantom.exit(1);
98
+ console.log(e.message);
92
99
 
93
- throw e;
100
+ phantom.exit(1);
94
101
  }
95
102
 
96
103
  phantom.exit();
@@ -195,9 +202,9 @@ if (is_html(input)) { // for html string
195
202
  try {
196
203
  fs.touch(output);
197
204
  } catch (e) {
198
- phantom.exit(1);
205
+ console.log(e.message);
199
206
 
200
- throw e;
207
+ phantom.exit(1);
201
208
  }
202
209
 
203
210
  phantom.exit(1);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phantompdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spring MC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-26 00:00:00.000000000 Z
11
+ date: 2013-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phantomjs