const apiToken: string = "YOUR TOKEN";
const base64: string = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTG..."
const signer1: Signer = new SignerBuilder()
.withName("My First Signer")
.build();
const signer2: Signer = new SignerBuilder()
.withName("My Second Signer")
.withEmail("test@test.com")
.withLockEmail(true)
.withLockPhone(true)
.withPhoneCountry("55")
.withPhoneNumber("99999999999")
.withAuthMode("assinaturaTela") // draw on screen
.withSendAutomaticEmail(false)
.withSendAutomaticWhatsapp(false)
.build();
let signers: Signer[] = [];
signers.push(signer1, signer2);
const docFromPdfBase64 = DocFromPdfBase64Builder()
.withSandbox(false)
.withName("My Contract")
.withBrandPrimaryColor("#000000")
.withBase64Pdf(base64)
.build();
try {
docResponse = new DocRequests(apiToken).createDocFromPdfBase64(docFromPdfBase64);
jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
console.log(jsonDocResponse);
} catch {
console.log(Err);
}
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
const apiToken: string = "YOUR TOKEN";
const base64: string = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKP...";
const signer1: Signer = new SignerBuilder()
.withName("My First Signer")
.build();
const signer2: Signer = new SignerBuilder()
.withName("My Second Signer")
.withEmail("test@test.com")
.withLockEmail(true)
.withLockPhone(true)
.withPhoneCountry("55")
.withPhoneNumber("99999999999")
.withAuthMode("assinaturaTela") // draw on screen
.withSendAutomaticEmail(false)
.withSendAutomaticWhatsapp(false)
.build();
let signers: Signer[] = [];
signers.push(signer1, signer2);
const docFromPdfBase64 = DocFromPdfBase64Builder()
.withSandbox(false)
.withName("My Contract")
.withBrandPrimaryColor("#000000")
.build();
async function exempleDocFRomPdfBase64() {
try {
docResponse: DocResponse = await new DocRequests(apiToken).createDocFromPdfBase64(docFromPdfBase64);
jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
console.log(jsonDocResponse);
} catch(Err) {
console.log(Err);
}
}
}