Skip to content

Commit bd05366

Browse files
committed
Support additional payload options for the API
1 parent 2c56bac commit bd05366

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,5 @@ typings/
8080
.dynamodb/
8181

8282
test.js
83+
test2.js
8384
package-lock.json

index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ module.exports = class Api2Pdf {
137137

138138
if (!('inline' in options)) {
139139
newOptions['inline'] = true
140+
} else {
141+
newOptions['inline'] = options.inline
140142
}
141143

142144
if ('filename' in options) {
@@ -147,6 +149,26 @@ module.exports = class Api2Pdf {
147149
newOptions['options'] = options.options
148150
}
149151

152+
if ('useCustomStorage' in options) {
153+
newOptions['useCustomStorage'] = options.useCustomStorage
154+
}
155+
156+
if ('storage' in options) {
157+
newOptions['storage'] = options.storage
158+
}
159+
160+
if ('enableToc' in options) {
161+
newOptions['enableToc'] = options.enableToc
162+
}
163+
164+
if ('tocOptions' in options) {
165+
newOptions['tocOptions'] = options.tocOptions
166+
}
167+
168+
if ('extraHTTPHeaders' in options) {
169+
newOptions['extraHTTPHeaders'] = options.extraHTTPHeaders
170+
}
171+
150172
return newOptions
151173
}
152174

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api2pdf",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "This client library is a wrapper for the Api2Pdf.com REST API. See full REST api documentation at https://www.api2pdf.com/documentation/v2. Api2Pdf is a powerful API that supports HTML to PDF, URL to PDF, HTML to Image, URL to Image, Thumbnail / image preview of an Office file, Office files (Word to PDF), HTML to Docx, HTML to excel, PDF to HTML, merge PDFs together, add bookmarks to PDFs, add passwords to PDFs",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)