with PDF-app.net and MEXC?
Convert an image from a URL to a PDF File with PDF-app.net. See the documentation
Split a PDF into multiple PDFs containing the specified number of pages. See the documentation
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
pdf_app_net: {
type: "app",
app: "pdf_app_net",
}
},
async run({steps, $}) {
const data = {
"fileUrl": `https://www.learningcontainer.com/wp-content/uploads/2019/09/sample-pdf-file.pdf`,
"pagesPerSplit": `1`,
"async": `false`,
"fileName": `MyPDF`,
}
return await axios($, {
method: "post",
url: `https://api.pdf-app.net/splitt_PDF`,
headers: {
"Authorization": `${this.pdf_app_net.$auth.api_key}`,
},
data,
})
},
})
import { axios } from "@pipedream/platform";
import crypto from "crypto";
export default defineComponent({
props: {
mexc: {
type: "app",
app: "mexc",
}
},
async run({ steps, $ }) {
// Build query string
const timestamp = Date.now()
const recvWindow = 5000
const queryString = `recvWindow=${recvWindow}×tamp=${timestamp}`
// Generate signature
const signature = crypto
.createHmac('sha256', this.mexc.$auth.secret_key)
.update(queryString)
.digest('hex')
// Make authenticated request
return await axios($, {
method: 'GET',
url: 'https://api.mexc.com/api/v3/account',
headers: {
'X-MEXC-APIKEY': this.mexc.$auth.access_key
},
params: {
recvWindow,
timestamp,
signature
}
})
},
})