pdfgen 0.1.0 → 0.2.0

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: 60fe8cc6f4d47c8fd5af37261f7fe11079bbbf6d
4
- data.tar.gz: e099bdd44342ddcfd71a767bf2fc5a31d3667a6f
3
+ metadata.gz: a11f131adef22537c617dbbebbd341b532a0073e
4
+ data.tar.gz: ba17d559c083c1295bd7bf5f6148ef498f0c1fff
5
5
  SHA512:
6
- metadata.gz: dc69f4ea62cfd5e666a9102bee591621e1dd69c3cb51700bbf215abe9707945b105836cec3f4d07601cf9e42baf387bd647e16ed780059dc35851ec34c401f19
7
- data.tar.gz: 5ac4dd0db6eabbf2f162c5eba4ea99de47b59a107d78c92a08884a248fd28ff7d527d1b449faeb0043f788597da4c5946b2b2f88c86a86b91722d173ae6ace98
6
+ metadata.gz: 0ea013f074727de44cca622a744e8c9f40d563d4b5e34ae120d4820d36ef71cc401bfb7f163e08c2f458acd7f632a68d36a0cf33ed966e9c2e6ec018ed9fce43
7
+ data.tar.gz: 625a99d4b4a7f064998c655c31235dc6181de4a2dbf80c541f8d944b4d432e41ea6bfb27919cead776cbe3fd899fb551122e12c0d7eb85cc21431cee51ad2ee7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -17,6 +17,7 @@ stdin.on('end', function () {
17
17
  var current_path = options['current_path'];
18
18
  var viewport_options = options['viewport_options'];
19
19
  var media_type = options['emulate_media'];
20
+ var launch_options = options['launch_options'];
20
21
 
21
22
  module.paths.push(current_path + '/node_modules');
22
23
 
@@ -25,7 +26,7 @@ stdin.on('end', function () {
25
26
  var html = fs.readFileSync(process.argv[2], 'utf8');
26
27
 
27
28
  (async() => {
28
- const browser = await puppeteer.launch();
29
+ const browser = await puppeteer.launch(launch_options);
29
30
  const page = await browser.newPage();
30
31
 
31
32
  await page.setContent(html);
@@ -13,6 +13,7 @@ class Pdfgen
13
13
  @html = html
14
14
  @viewport_options = nil
15
15
  @emulate_media = nil
16
+ @launch_options = nil
16
17
  end
17
18
 
18
19
  def set_viewport(viewport_options)
@@ -25,10 +26,16 @@ class Pdfgen
25
26
  self
26
27
  end
27
28
 
29
+ def launch_options(launch_options)
30
+ @launch_options = launch_options
31
+ self
32
+ end
33
+
28
34
  def to_pdf(opts = {})
29
35
  stdin_options = { pdf_options: opts, current_path: Dir.pwd }
30
36
  stdin_options = stdin_options.merge(viewport_options: @viewport_options) if @viewport_options
31
37
  stdin_options = stdin_options.merge(emulate_media: @emulate_media) if @emulate_media
38
+ stdin_options = stdin_options.merge(launch_options: @launch_options) if @launch_options
32
39
  file = Tempfile.new('input_html')
33
40
  file.write(@html)
34
41
  file.close
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Fox