Skip to content

n8n and Stirling API #490

Closed Answered by user90210
user90210 asked this question in Q&A
Discussion options

You must be logged in to vote

const FormData = require('form-data');
const formData = new FormData();

formData.append('fitOption','fitDocumentToImage');
formData.append('colorType','color');
formData.append('autoRotate','true');

for (let i = 0; i < items.length; i++) {

formData.append('fileInput', await this.helpers.getBinaryDataBuffer(i, 'data'), 'image.jpg');
}

const request_options = {
url: 'http://192.168.144.68:8081/api/v1/convert/img/pdf',
headers: {
'accept': '/',
//'Content-Type': 'multipart/form-data',
},
method: 'POST',
body : formData,
returnFullResponse: true,
encoding: 'arraybuffer'
}
console.log(request_options);

const response = await this.helpers.httpRequest(request_options);
//console.log(response);

r…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by user90210
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant