• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

como puedo obtener ejemplos de un pdf o comparar fechas

Community Beginner ,
Oct 29, 2020 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
General troubleshooting , PDF forms

Views

425

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
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 30, 2020 Oct 30, 2020

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 wil

...

Votes

Translate

Translate
Community Expert ,
Oct 30, 2020 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.

 

 

Votes

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
community guidelines
Community Beginner ,
Nov 02, 2020 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

Votes

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
community guidelines
Community Beginner ,
Nov 02, 2020 Nov 02, 2020

Copy link to clipboard

Copied

amigo, si funciona se lo agradezco mucho

Votes

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
community guidelines
Community Expert ,
Nov 02, 2020 Nov 02, 2020

Copy link to clipboard

Copied

LATEST

I don't see the link to your document.

Votes

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
community guidelines