Use POST https://api.docuseal.com/templates/pdf
API to create interactive document form template from the given PDF with field text tags.
API request body should contain JSON payload with "file": '...'
encoded as base64 string value.
Upon a successful request, you'll receive a "id"
of the new template to be used in the signature request process.
Learn more:
const docuseal = require("@docuseal/api");
const fs = require('fs')
const filePath = 'path/to/your/file.pdf';
const fileData = fs.readFileSync(filePath, { encoding: 'base64' });
docuseal.configure({ key: "API_KEY", url: "https://api.docuseal.com" });
const template = await docuseal.createTemplateFromPdf({
name: 'Rental Agreement',
file: fileData
});