constructor(endpoint, ssl) { const UA = pjson.name + ' v' + pjson.version const uri = endpoint || (ssl ? url_ssl : url) const req = URIjs(uri)._parts const secure = req.protocol === 'https' const opts = { host: req.hostname, port: req.port || (secure ? 443 : 80), path: req.path, headers: { 'User-Agent': UA } } this.client = secure ? xmlrpc.createSecureClient(opts) : xmlrpc.createClient(opts) }
const uri = new URI(filePath) const copyFilePath = constants.DIRECTORY.PDF + uri.filename() fs.copyFile(filePath, copyFilePath, (err) => { if (err) return callback(err) if (err) return callback(err) uri.suffix(options.imageType) const pdfBoxImageFilePath = constants.DIRECTORY.PDF + uri.filename().replace(new RegExp(`.${uri.suffix()}$`), `${options.page}.${uri.suffix()}`) const imageFilePath = constants.DIRECTORY.IMAGE + uri.filename()