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

Time input

New Here ,
May 20, 2025 May 20, 2025

Hello All,

 

I am looking at modifying a form that was origanally created in LiveCycle Designer ES 8.2. I was not the original author and as such the original author is no longer associated with this form. However, they did restrict the document to the point where I cannot modify the form without utilizing the "Print to PDF" hack, but that erased all the original data. My question is, in the original form users had the ability to type in times with no seperators, and have the field display it in the correct format, and I for the life of me cannot figure out how.

 

1635 = 4:35:00 PM.

 

Any help would be greatly appreciated.

 

Thanks,

TOPICS
Create PDFs , Edit and convert PDFs , How to , JavaScript , PDF forms
240
Translate
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 ,
May 20, 2025 May 20, 2025

So what kind of protection is on the PDF?

I believe all the scripts in a LiveCycle form are exposed in the document model. It's been too long since I've programmed for LC, for me to remember exactly how it's all arranged. But you should be able to extract them. 

 

Another method might be to export the PDF as one of the XML formats that includes all the document structure and use a text editor to find the scripts.  

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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
New Here ,
May 20, 2025 May 20, 2025

Capture 2.JPGCapture.JPG

Translate
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
New Here ,
May 20, 2025 May 20, 2025

There is no password protection. It just shows that in order to pop up the error message.

Translate
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 ,
May 20, 2025 May 20, 2025

It kinda looks like the security dialog is indicating that there is password protection. But regarless. You can still get the existing scripts from the console window. 

 

For example, this code will export the form definition, which contains the scripts associated with the fields:

this.exportXFAData({bXDP:true,aPackets:["template"]});

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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
New Here ,
May 21, 2025 May 21, 2025

So...I'm new to programming/coding. Where do I input this code line?

Translate
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 ,
May 21, 2025 May 21, 2025

Open the form in Acrobat, then press Ctrl+J to open the Javascript console. Paste in the provided code, hold down Ctrl and while pressing enter. You'll be asked to save a XDP file to the hard drive. This is the XML-based building plan of your form. You can open it with any text editor. 

 

However, without Designer (formerly LiveCycle Designer now AEM Forms Designer), you can't edit the form at all. 

Translate
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 ,
May 21, 2025 May 21, 2025
LATEST

So what is your plan for updating this form?  Are you recreating it as a regular AcroForm?  Or do you have the AEM Designer?

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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 ,
May 21, 2025 May 21, 2025

This can be achieved using a relatively simple Format script. You convert the user's input to a Date object, then format it to another pattern using the printd method of the util object, or the native methods of the Date object itself.

Translate
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