@adobe/pdftools-extract-node-sdk
Version:
The Document Services PDF Tools Extract Node.js SDK provides APIs for extracting elements and renditions from PDF
37 lines (32 loc) • 1 kB
JavaScript
/*
* Copyright 2019 Adobe
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in
* accordance with the terms of the Adobe license agreement accompanying
* it. If you have received this file from a source other than Adobe,
* then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*/
const RANDOM_STRING_LENGTH = 12;
module.exports = {
getRandomStringName: () => {
let result = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
charactersLength = characters.length;
for (let i = 0; i < RANDOM_STRING_LENGTH; i += 1) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
},
getRequestIdFromLocation: (location) => {
return location.split('/').pop()
},
buildMap: (arr1, arr2) => {
const map = new Map();
for(let i = 0; i < arr1.length; i++){
map.set(arr1[i], arr2[i]);
};
return map;
},
};