Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/06/2008, 15:46
Avatar de Jorge_Mota
Jorge_Mota
 
Fecha de Ingreso: diciembre-2002
Ubicación: Chapinlandia :-D
Mensajes: 725
Antigüedad: 21 años, 5 meses
Puntos: 11
Respuesta: Como Agrego Numero De Folio En Adobe Acrobat

podrías programar un web service, agregar una nueva conexión de datos y en el *initialize del control de #de folio leer el siguiente número. o bien usar un archivo xml e irlo actualizando por código. te pongo algo de lo segundo.


Cita:
// Some E4X code to create a database of info
x = <employees/>;
function popXML(x,id,fname,lname)
{
y = <a/>;
y.employee.@id = id;
y.employee.name.first = fname;
y.employee.name.last = lname;
x.employee += y.employee;
}
popXML(x,"334234", "John", "Public");
popXML(x,"324234", "Jane", "Doe");
popXML(x,"452342", "Davey", "Jones");
popXML(x,"634583", "Tom", "Jefferson");

var thisPath = this.path.replace(/\.pdf$/, ".xml");
try { this.importDataObject("employees", thisPath); }
catch(e) { console.println(e) };
y leerlo sería un tanto fácil si adaptas según tu necesidad el ejemplo:
if (event.willCommit) {
try {
// Get the data contents of the "employees" attachment
var oDB = this.getDataObjectContents("employees");
// Convert to a string
var cDB = util.stringFromStream(oDB);
// Use the eval method to evaluate the string, you get an XML variable
var employees = eval(cDB);
// Retrieve record with the id input in the employee.id field
var record = employees.employee.(@id == event.value);
// If the record is an empty string, or there was nothing entered...
if ( event.value != "" && record.toString() == "" ) {
app.alert("Record not found");
event.rc = false;

}
// Populate the two other fields
this.getField("employee.name.first").value = record.name.first;
this.getField("employee.name.last").value = record.name.last;
} catch(e) {
app.alert("The DB is not attached to this document!");
event.rc = false;
}}
__________________
Jorge Mota
Blog
Gubiz estafa