Highlighted

como puedo obtener ejemplos de un pdf o comparar fechas

New Here ,
Oct 29, 2020

Copy link to clipboard

Copied

hola quiero bajar algun ejemplo que pueda estudiar para ver como se hace isertar un script en un docuemneto pdf , la verdad solo necesito tener dos campos una con la fecha actual y el otro una fecha limite que se pone manual para compararlas y si es mayor solo cerrar el pdf y no se pueda seguir leyendo, gracias por la ayuda que me puedan prestar.

TOPICS
Comment review and collaborate PDF, General troubleshooting, PDF forms

Views

40

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

como puedo obtener ejemplos de un pdf o comparar fechas

New Here ,
Oct 29, 2020

Copy link to clipboard

Copied

hola quiero bajar algun ejemplo que pueda estudiar para ver como se hace isertar un script en un docuemneto pdf , la verdad solo necesito tener dos campos una con la fecha actual y el otro una fecha limite que se pone manual para compararlas y si es mayor solo cerrar el pdf y no se pueda seguir leyendo, gracias por la ayuda que me puedan prestar.

TOPICS
Comment review and collaborate PDF, General troubleshooting, PDF forms

Views

41

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 29, 2020 0
Adobe Community Professional ,
Oct 30, 2020

Copy link to clipboard

Copied

Hi, 

 

You can do this by creating two date fields.

 

In my example I will use "DATE1" for the field that will be populating the current date automatically, and "DATE2" which is the field that I will run my calculation script from.

 

So first, to insert a script in a field object you need to select the "Prepare Form" tool in order to be able to edit the field properties of any field objects in your PDF. Then right-click on the desired field and select from the context menu "Properties". This will open up the field properties dialogue box.

 

Go ahead and click on the "Calculate" tab of "DATE1" , you may copy the following script below and paste it in the "Custom Calculation Script Section" as shown in the slide below: 

 

 

event.value = util.printd("mmmm d, yyyy", new Date());

 

calculate tab.png

 

Then add the following script to the "DATE2" field:

 

 

var strStart = this.getField("DATE1").value;
var strEnd = this.getField("DATE2").value;

if (strStart.length && strEnd.length) {

  var dateStart = util.scand("mmmm d, yyyy",strStart);
  var dateEnd = util.scand("mmmm d, yyyy",strEnd);


if  (dateEnd.getTime() < dateStart.getTime() ) {

app.alert("The end date can't be earlier than the start date. This document will close now.!");

this.resetForm(["DATE2"]);

this.closeDoc();

this.dirty = false;

  }
}

 

 

Let me know if this script(s) meet your intent.

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 30, 2020 0
New Here ,
Nov 02, 2020

Copy link to clipboard

Copied

hola amigo,

primeramente estoy muy agradecido por su atención a responder y aclarar mis
dudas, realice el script que me envió , pero algo no me resulta, le
envío adjunto el documento para que lo pueda revisar.

atentamente
juan vargas

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2020 0
New Here ,
Nov 02, 2020

Copy link to clipboard

Copied

amigo, si funciona se lo agradezco mucho

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2020 0
ls_rbls LATEST
Adobe Community Professional ,
Nov 02, 2020

Copy link to clipboard

Copied

I don't see the link to your document.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2020 0