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

How to insert form field into PDF document.

Community Beginner ,
Feb 15, 2024 Feb 15, 2024

Greetings, Community!

Nowadays, I've been working with AcroJS and faced one big problem.

During a few days, I tried to insert new date form field and signature form field into PDF document with AcroJS but failed every time.

I want to display standard date picker and popup dialog for signature with it but I feel suffering how to perform this.

Please let me know if you are familiar to this.

TOPICS
How to , Modern Acrobat , PDF , PDF forms
999
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 ,
Feb 15, 2024 Feb 15, 2024

What have you done so far?

 

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 Beginner ,
Feb 15, 2024 Feb 15, 2024

Actually, AcroJS didn't support built-in date form field.

So, I tried to add textfield first and then display embed date picker when I hit that field.

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 ,
Feb 15, 2024 Feb 15, 2024

The date picker is a feature of the application. You can't apply it to a field yourself, but if you apply the correct code to make it into a Date field then it should appear, just like when you do so manually.

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 ,
Feb 15, 2024 Feb 15, 2024

you'll find a calendar popup (date picker) example here:

https://www.pdfscripting.com/public/Free-Sample-PDF-Files-with-scripts.cfm

 

This example is built entirely with form fields and JavaScript. It will only operate in PDF viewers that support both.  

 

Alternatively you can create a text field with date formatting, which if supported by the application (as noted by try67), will automatically display a date picker. Formatting in PDF form fields is controlled with a script in the format event.  The viewer recognizes  a field as a date field when a specific built-in Acrobat JavaScript function is used in the custom format script. This function is "AFDate_Format".   

 

But again, this only works in PDF viewers that support such a feature. 

 

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 Beginner ,
Feb 15, 2024 Feb 15, 2024

Thanks for your kind supports.

I am not sure that I can implement this feature but I want to do.

Best example of this is PSPDFKit.com.

Features of creating form are perfect, I think.

Is it possible?

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 ,
Feb 15, 2024 Feb 15, 2024
LATEST

You do know that this is the "Adobe Acrobat" forum. We cover solutions in Adobe Acrobat. 

 

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