phantompdf 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/phantompdf/version.rb +1 -1
- data/vendor/assets/javascripts/rasterize.js +14 -7
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1546382213576c76cc2ac584658eb84b522af278
|
|
4
|
+
data.tar.gz: 46c3fe577f3bc88df12e9bb544f6db2bc8763d82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ef376e13ffcfddf8913d6cfa1e4d7f03c4db57e7f12cbbcdb6f15584386f67eb339d6437fe204c4c4407d238072392ff62425bc88cf8f721cf1b829513f7287
|
|
7
|
+
data.tar.gz: 004000c5183f70940a722df4fc3a287000f4e4141ba9444d3c05df8fd4ab5aeead83d23a4e1e72158e3fcc781eaef294d6c88953f86026cfc2c4c51d9ee1e74c
|
data/Gemfile.lock
CHANGED
data/lib/phantompdf/version.rb
CHANGED
|
@@ -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
|
-
|
|
71
|
+
console.log('Invalid HTML source for rendering!');
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
phantom.exit(1);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
page.content = inject_images(html);
|
|
77
77
|
|
|
78
78
|
window.setTimeout(function(){
|
|
79
|
-
|
|
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
|
-
|
|
98
|
+
console.log(e.message);
|
|
92
99
|
|
|
93
|
-
|
|
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
|
-
|
|
205
|
+
console.log(e.message);
|
|
199
206
|
|
|
200
|
-
|
|
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
|
+
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-
|
|
11
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: phantomjs
|