martedì 13 novembre 2012

Disabilitare tutti gli oggetti in un pdf con un click

Con questo esempio è possibile disabilitare tutti gli oggetti posizionati su di una form con un "solo colpo".
Provare ad inserire queste righe di codice nell'evento onclick di un pulsante Button.
for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {
 var oFields = xfa.layout.pageContent(nPageCount, "field");
 var nNodesLength = oFields.length;
 for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
  oFields.item(nNodeCount).access = "readOnly";
 }
}
Designer:

Output: