JAVASCRIPT CODE ON COUNTDOWNING PDF FORM

New Here ,
Jul 20, 2018

Copy link to clipboard

Copied

Hello,

I put a JavaScript code at my pdf form. This JavaScript code its use for countdown.

I would like to know is its possible to insert in my JavaScript code:

- When the user download my PDF Form, the " Begin Time" starts ( todays date )

- And i would like to put a " End Time" example  a 1 year, 6 months, etc.. after the Begin Time automatically

This is my actually javacript code:

function Expire ()

{

// Obtém a data e hora atuais

var rightNow = new Date ();

// Setup End Date

var rightNow = new Date ();

var beginDate = new Date ();

var endDate = new Date ("5 minutos");

if (rightNow <beginDate || rightNow> endDate)

{

app.alert ("Passou do limite de tempo. Você não pode usar mais este documento.Entre em contato para continuar a usar este documento. Obrigado.", 0, 0);

this.closeDoc ()

}

}

// executa o código de expiração de verificação

Expire ();

Can you help me please??!

Thank You!!!

TOPICS
Acrobat SDK and JavaScript

Views

54

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

JAVASCRIPT CODE ON COUNTDOWNING PDF FORM

New Here ,
Jul 20, 2018

Copy link to clipboard

Copied

Hello,

I put a JavaScript code at my pdf form. This JavaScript code its use for countdown.

I would like to know is its possible to insert in my JavaScript code:

- When the user download my PDF Form, the " Begin Time" starts ( todays date )

- And i would like to put a " End Time" example  a 1 year, 6 months, etc.. after the Begin Time automatically

This is my actually javacript code:

function Expire ()

{

// Obtém a data e hora atuais

var rightNow = new Date ();

// Setup End Date

var rightNow = new Date ();

var beginDate = new Date ();

var endDate = new Date ("5 minutos");

if (rightNow <beginDate || rightNow> endDate)

{

app.alert ("Passou do limite de tempo. Você não pode usar mais este documento.Entre em contato para continuar a usar este documento. Obrigado.", 0, 0);

this.closeDoc ()

}

}

// executa o código de expiração de verificação

Expire ();

Can you help me please??!

Thank You!!!

TOPICS
Acrobat SDK and JavaScript

Views

55

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
Jul 20, 2018 0
Adobe Community Professional ,
Jul 20, 2018

Copy link to clipboard

Copied

There are a number of problems with trying to implement this sort of thing reliably with JavaScript. Your first hurdle will be establishing the begin date and storing it somewhere. If you do manage to store it somewhere, it has to be saved in a location that can be accessed each time the document is opened. There are just too many uncertainties with this approach that makes it unviable. Such a scheme could be very easily defeated.

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...
Jul 20, 2018 0