pdf4me
Version:
Provides expert functionality to convert, optimize, compress, produce, merge, split, ocr, enrich, archive, print documents and PDFs.
35 lines (34 loc) • 845 B
JavaScript
module.exports = {
createClient: apiClient => {
const api = apiClient
return {
repair: repairReq => {
return new Promise((resolve, reject) => {
api
.postJson('/PdfA/Repair', repairReq)
.then(res => {
resolve(res)
})
.catch(error => {
reject(error)
})
})
},
repairDocument: (file, integrationConfig = {}) => {
return new Promise((resolve, reject) => {
api
.postFormData('/PdfA/RepairDocument', {
file,
integrationConfig: JSON.stringify(integrationConfig),
})
.then(res => {
resolve(res)
})
.catch(error => {
reject(error)
})
})
},
}
},
}