pdfgen 0.5.0 → 0.6.0
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/CHANGELOG.md +13 -7
- data/VERSION +1 -1
- data/lib/pdfgen.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46f2787d1d479c943502fde607fb660011b872b4
|
|
4
|
+
data.tar.gz: 0eeb3181ea2b9e49f32aa3aee96e09a4524ab0fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7fdad867f3e1b0a8a59382c77c68a6b10cbf8354a5f798074fae44b9e4b971e07fa55d28fca7b4868d1ad054ca478f4cc5140f37a91b5992c7c27d1f5a1564d9
|
|
7
|
+
data.tar.gz: 90fdc2ad7bfb56d8dfee04712a79ba00c9cb46bd5dabbb872db2f92a38115332a4715f763123b0856f79e28091f777333997b7ee6d36610e6ff0decd544f286f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## Pdfgen 0.6.0 (June 14, 2019)
|
|
2
|
+
|
|
3
|
+
* Use capture3 to also capture stderror which is where Node error messages are output.
|
|
4
|
+
|
|
5
|
+
This allows Pdfgen to include the error from Node in the exception that is raised.
|
|
6
|
+
|
|
1
7
|
## Pdfgen 0.5.0 (September 3, 2018)
|
|
2
8
|
|
|
3
9
|
* Changes how the wait for timeout works slightly.
|
|
@@ -26,25 +32,25 @@
|
|
|
26
32
|
Need to soon add testing for different versions of Node to discover what the
|
|
27
33
|
compatible versions are.
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
- Adds handling of any unhandled rejection by logging the error and then exiting.
|
|
30
36
|
|
|
31
37
|
This change provides better error messaged from Node and also prevents the process
|
|
32
38
|
from hanging and not exiting when there was an error.
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
- Fixes bug where launch options were no longer being passed to the Javascript.
|
|
35
41
|
|
|
36
42
|
## Pdfgen 0.4.1 (May 15, 2018)
|
|
37
43
|
|
|
38
|
-
|
|
44
|
+
- Fixes bug with regex that checks if a URL was passed.
|
|
39
45
|
|
|
40
46
|
## Pdfgen 0.4.0 (May 12, 2018)
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
- Can now provide a URL to the initializer.
|
|
43
49
|
|
|
44
50
|
Providing a URL to the initializer will now nagivate to the URL and then render the
|
|
45
51
|
page to a PDF.
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
- Adds a debug mode.
|
|
48
54
|
|
|
49
55
|
Calling debug_mode and passing in a time in milliseconds to wait with the browser
|
|
50
56
|
not headless. This may change to be forever in the future but that would cause weird
|
|
@@ -54,11 +60,11 @@
|
|
|
54
60
|
|
|
55
61
|
## Pdfgen 0.3.1 (April 23, 2018)
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
- Fixes bug by passing the wait_for_timeout to the Javascript script.
|
|
58
64
|
|
|
59
65
|
## Pdfgen 0.3.0 (April 23, 2018)
|
|
60
66
|
|
|
61
|
-
|
|
67
|
+
- Allows optional period in milliseconds to wait for the page to finish rendering.
|
|
62
68
|
|
|
63
69
|
A new optional wait timeout that will occur after the content has been set,
|
|
64
70
|
the media emulation set, and the viewport has been set to allow for javascript
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.6.0
|
data/lib/pdfgen.rb
CHANGED
|
@@ -74,21 +74,22 @@ class Pdfgen
|
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
pdf_output = nil
|
|
77
|
+
error_output = nil
|
|
77
78
|
status = nil
|
|
78
79
|
if @html
|
|
79
80
|
file = Tempfile.new('input_html')
|
|
80
81
|
file.write(@html)
|
|
81
82
|
file.close
|
|
82
|
-
pdf_output, status = Open3.
|
|
83
|
+
pdf_output, error_output, status = Open3.capture3(MAKE_PDF_COMMAND, file.path, stdin_data: stdin_options.to_json)
|
|
83
84
|
file.unlink
|
|
84
85
|
else
|
|
85
86
|
stdin_options = stdin_options.merge(url: @url)
|
|
86
87
|
stdin_options = stdin_options.merge(url_options: @url_options)
|
|
87
|
-
pdf_output, status = Open3.
|
|
88
|
+
pdf_output, error_output, status = Open3.capture3(MAKE_PDF_COMMAND, stdin_data: stdin_options.to_json)
|
|
88
89
|
end
|
|
89
90
|
|
|
90
91
|
unless status.success?
|
|
91
|
-
raise
|
|
92
|
+
raise "This error was encountered running node to create the pdf: #{error_output}"
|
|
92
93
|
end
|
|
93
94
|
unless pdf_output
|
|
94
95
|
raise 'There was an error creating the temporary file used to pass the HTML to node.'
|
|
@@ -98,4 +99,4 @@ class Pdfgen
|
|
|
98
99
|
end
|
|
99
100
|
|
|
100
101
|
|
|
101
|
-
# Use a new API that uses method chaining to configure the PDF and that queues up strings to put in a js file to run puppeteer
|
|
102
|
+
# Use a new API that uses method chaining to configure the PDF and that queues up strings to put in a js file to run puppeteer
|