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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cef9f7203d05d0d116b4e5294f4b7e2cd8682d2926fd1fd84373eb096a9b5ea9
4
- data.tar.gz: 00f5792d27ce1726a3c182a9426bcaf51b6aba78e3c4d8255031abd693b0c642
3
+ metadata.gz: 3ae377666e9721fcf26fda08d4791500e0d8e28e6eaddcbac702e1238c5815d9
4
+ data.tar.gz: e749a87289fa44a1ce4e47c7549855932400512b0877bd72e9e32eb606652ce1
5
5
  SHA512:
6
- metadata.gz: 6a758ed6a2a8130eefd19c76a11fa56ae25789a5aff73d0ea7278644dc96041081a411f9a8f63c5cfbf6ab40ab28bd6cfb1845ccabf266a6a016778922218447
7
- data.tar.gz: bb4033abcfb6ddb00357ec2e6e7e6104edabd2555d459be36fd785dabec197c95601f7a835c34ab646316e180dcec6f4ca0979eb90026bced6a1777aaa2f5bcb
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).
@@ -1,3 +1,3 @@
1
1
  module PdfGem
2
- VERSION = '1.0.8'
2
+ VERSION = '1.0.9'
3
3
  end
@@ -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.8
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-27 00:00:00.000000000 Z
11
+ date: 2020-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails