This product is retired as of September 2020 See PDFTon WebView
===
// On document load you can add additional options such as
// adding annotations, populating form fields and controlling
// elements of the user interface
readerplus.Document.addEventListener("load", function () {
// Populate form field prior to opening
var page = readerplus.Document.getPage(1);
var fields = page.getAllFields();
for (var i = 0; i < fields.length; i++) {
// first name
if (fields[i].name === 'FirstName') {
var field = readerplus.Document.getField(fields[i].id);
field.setFieldProperties({ value: "Jonathon", readOnly: true });
}
// last name
if (fields[i].name === 'LastName') {
var field = readerplus.Document.getField(fields[i].id);
field.setFieldProperties({ value: "Smithabcdefghijklmn", color: "#f44268", readOnly: true});
}
// address
if (fields[i].name === 'Add1') {
var field = readerplus.Document.getField(fields[i].id);
field.setFieldProperties({ value: "123 Happy Street" });
}
});
Comments
0 comments
Please sign in to leave a comment.