Skip to main content
Participating Frequently
May 31, 2019
Question

Acrobat Reader DC Javascript funktioniert nicht

  • May 31, 2019
  • 4 replies
  • 5573 views

Hallo!
Bräuchte bitte Hilfe bei einem Javascript
Habe ein Formular mit "Adobe Acrobat Pro DC" erstellt und ein Feld eingefügt in welchem beim Öffnen immer das aktuelle Datum stehen soll.
Das habe ich über Javascript-Anweisungen für Dokumente gemacht.
Der Code ist :

function UpdateDate(cFormat) {

return util.printd(cFormat, new Date());

return true;

} this.getField('Datum').value = UpdateDate('dd.mm.yyyy');

this.getField('Datum').defaultValue = UpdateDate('dd.mm.yyyy');

Im Acrobat Pro funktioniert alles super.
Aber auf meinem PC wo ich Acrobat Reader installiert habe aktualisiert sich das Datum nicht.
Habe schon die Javascript und Sicherheitseinstellungen geändert (Was meistens die Ursache in der Google Suche) aber auch das hat nichts gebracht.
Überseh ich da etwas oder geht Javascript in Reader DC gar nicht?
Bin für jede Hilfe dankbar

Danke

Liebe Grüße

This topic has been closed for replies.

4 replies

Bernd Alheit
Community Expert
Community Expert
June 1, 2019

This will work in Acrobat Reader:

Adobe Document Cloud

Jinnai4Author
Participating Frequently
June 1, 2019

Thank you, but it doesn't work either.
The document opens but Javascript not.
=(

Legend
May 31, 2019

Wann genau wird die Funktion aufgerufen? In einem Document Level-Script, oder wo sonst?

Wenn als Document Level-Script, ist es möglich, dass sie aufgerufen wird, bevor das Dokument ausreichend geladen worden ist.

Versuche (wenn nicht schon gemacht), die Funktion im Seite öffnen-Event aufzurufen.

For the monoglots:

When exactly is the function called? In a document-level script, or where else?

If it is a document-level script, it is possible that it is called before the document has been sufficiently loaded.

Try (if not already done) to call the function i the Page Open event.

try67
Community Expert
Community Expert
May 31, 2019

[The fact someone doesn't speak German doesn't mean they're a monoglot... I speak 4 languages quite fluently, just not that one]

Legend
June 1, 2019

Yeah, blast from the past, where I was in social media (way before that term existed), where the absolute majority of the users were USAns…

Watch out for the next incarnation of that text…

try67
Community Expert
Community Expert
May 31, 2019

There's no reason this code shouldn't work in Reader.

However, you should remove this line from the function, as it does nothing:

return true;

Jinnai4Author
Participating Frequently
June 1, 2019

Thank you.
I've removed it =)

Karl Heinz  Kremer
Community Expert
Community Expert
May 31, 2019

Das sollte auch im Reader funktionieren (und hat bei mir auch funktioniert). Eine einfache Methode, um zu sehen, ob ein Stück Code auch ausgefuehrt wird ist, eine Nachricht in einem Dialog anzuzeigen. Wenn die folgende Zeile am Ende des Scripts angehängt wird sollte es klar sein, ob das Programm ausgeführt wird oder nicht:

app.alert("Datum gesetzt: " + UpdateDate("dd.mm.yyyy"));

Jinnai4Author
Participating Frequently
June 1, 2019

Danke für die schnelle Antwort!

Super Idee, habe das eben gemacht
Auf dem Laptop wo die PDF ausgeführt werden soll passiert gar nichts

Habe aber extra nochmal geschaut, Javascript ist in den Einstellungen aktiviert, nur globale Sicherheit ist deaktiviert