React Native
React Native
PDF List Unsigned Signature Fields
See more PDF Signatures Examples
Demonstrates how to list the unsigned signature fields in a PDF.Note: This example requires Chilkat v9.5.0.90 or greater.
Chilkat React Native Downloads
import { JsonObject, Pdf } from '@chilkat/react-native'
function chilkatExample() {
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const pdf = new Pdf();
// Load a PDF containing 2 remaining unsigned signature fields:
try {
pdf.loadFile('qa_data/pdf/doctor_patient_parent.pdf');
} catch {
console.log(pdf.lastErrorText);
return;
}
// Note: This example requires Chilkat v9.5.0.90 or greater.
const json = new JsonObject();
pdf.getUnsignedSigFields(json);
json.emitCompact = false;
console.log(json.emit());
// Result:
// {
// "unsignedSigField": [
// "doctor_signature",
// "parent_signature"
// ]
// }
// To iterate over the field names:
let strVal = '';
let i = 0;
const countI = json.sizeOfArray('unsignedSigField');
while (i < countI) {
json.i = i;
strVal = json.stringOf('unsignedSigField[i]');
console.log(strVal);
i++;
}
}