Skip to content

Commit

Permalink
Support additional payload options for the API
Browse files Browse the repository at this point in the history
  • Loading branch information
apexdodge committed Nov 16, 2022
1 parent 2c56bac commit bd05366
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ typings/
.dynamodb/

test.js
test2.js
package-lock.json
22 changes: 22 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ module.exports = class Api2Pdf {

if (!('inline' in options)) {
newOptions['inline'] = true
} else {
newOptions['inline'] = options.inline
}

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

if ('useCustomStorage' in options) {
newOptions['useCustomStorage'] = options.useCustomStorage
}

if ('storage' in options) {
newOptions['storage'] = options.storage
}

if ('enableToc' in options) {
newOptions['enableToc'] = options.enableToc
}

if ('tocOptions' in options) {
newOptions['tocOptions'] = options.tocOptions
}

if ('extraHTTPHeaders' in options) {
newOptions['extraHTTPHeaders'] = options.extraHTTPHeaders
}

return newOptions
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "api2pdf",
"version": "2.0.1",
"version": "2.0.2",
"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",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit bd05366

Please sign in to comment.