pdf_gem 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -9
- data/lib/pdf_gem/version.rb +1 -1
- data/lib/pdf_generator.js +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ae377666e9721fcf26fda08d4791500e0d8e28e6eaddcbac702e1238c5815d9
|
4
|
+
data.tar.gz: e749a87289fa44a1ce4e47c7549855932400512b0877bd72e9e32eb606652ce1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3dac5f68aa57d4f32781b7937b27b5dadb7cda557e6d802c9c1015bf23a78a4db952a797ca9e15a5f4db142a34de6b3a6fae48cae229a6358c7140a3df0811b
|
7
|
+
data.tar.gz: 78bb021dcac458206a562b8dc6a423823765f591d69a86f76dd1eb7cca10e5141e733a0fd8e40bb4f43c38b1e98a0c70c2d9fdfa64edcbf399f0e2df04cb5b2f
|
data/README.md
CHANGED
@@ -25,15 +25,6 @@ Or install it yourself as:
|
|
25
25
|
$ gem install pdf_gem
|
26
26
|
```
|
27
27
|
|
28
|
-
Add this lines to `application.rb`
|
29
|
-
```ruby
|
30
|
-
ActionController::Renderers.add :pdf do |template, options|
|
31
|
-
PdfGem.renderer(template, options)
|
32
|
-
end
|
33
|
-
```
|
34
|
-
> **NOTE** You can change the :pdf in some other name if you have conflicts with other similar libraries
|
35
|
-
|
36
|
-
|
37
28
|
You may need to add
|
38
29
|
```ruby
|
39
30
|
Mime::Type.register "application/pdf", :pdf
|
@@ -79,6 +70,7 @@ PdfGem.pdf_from_string(options)
|
|
79
70
|
|
80
71
|
- `options` <[Object]> Options object which might have the following properties:
|
81
72
|
- `url` <[string]> (Used only for PdfGem.pdf_from_url) This is the url to render.
|
73
|
+
- `timeout` <[number]> Maximum navigation time in ms, default is 3000 ms.
|
82
74
|
- `html` <[string]> (Used only for PdfGem.pdf_from_string) This is the html string to render.
|
83
75
|
- `disposition` <[string]> (Use only for controller render) Disposition string (inline/attachment).
|
84
76
|
- `formats` <[string]> (Use only for controller render) Force to load view of a particular format (pdf, html, xml).
|
data/lib/pdf_gem/version.rb
CHANGED
data/lib/pdf_generator.js
CHANGED
@@ -11,7 +11,7 @@ const path = require('path');
|
|
11
11
|
try{
|
12
12
|
const params = {...JSON.parse(Buffer.from(stdinBuffer.toString(), 'base64').toString('utf-8')), ...{path: filename}};
|
13
13
|
const page = await browser.newPage();
|
14
|
-
await page.goto(params.url, {waitUntil: 'networkidle2'});
|
14
|
+
await page.goto(params.url, {waitUntil: 'networkidle2', timeout: (params.timeout == null ? 30000 : params.timeout)});
|
15
15
|
await page.pdf(params);
|
16
16
|
process.stdout.write(filename)
|
17
17
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdf_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Blasina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|