You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Bharat Bhatt <bh...@gmail.com> on 2017/01/17 06:52:10 UTC

Date component in PDF

Hi,

How to create Date component in PDF ? Which api I can use it?

Thanks,
Bharat

Re: Date component in PDF

Posted by Bharat Bhatt <bh...@gmail.com>.
Thanks a lot. I tried this solution and its working fine for me.

Thanks,
Bharat

On Tue, Jan 17, 2017 at 10:37 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> Am 17.01.2017 um 17:40 schrieb Karl Heinz Kremer:
>
>> The latest update to Adobe Acrobat and Adobe Reader DC does now finally
>> support a data picker. The way this works is that you create a normal date
>> field - meaning a text field with a date format applied - and when such a
>> field is displayed in the latest version of Acrobat/Reader, a date picker
>> is shown. See here for more information:
>> http://khkonsulting.com/2017/01/new-form-field-types-in-acro
>> bat-dc-image-field-and-date-picker/
>>
>> This means all you need to do is mimic what a date field created in
>> Acrobat
>> looks like. You would do that by creating one, and then analyzing what the
>> field format and validation options look like (e.g. using the PDFBox
>> Debugger). If you need a sample, you can download one from here:
>> http://khkonsulting.com/files/AUC/date_image_field.pdf
>>
>
> Yeah, it's really just a text field. Plus two AA entries (F and K) that
> call this:
> AFDate_FormatEx("m/d/yy");
> AFDate_KeystrokeEx("m/d/yy");
>
> Tilman
>
>
>
>> There are other date pickers, which are implemented as JavaScript in the
>> PDF form. If you want to implement something like that, you would have to
>> get such a date picker, apply it to a document, and then again reverse
>> engineer how this information is stored inside the field object.
>>
>>
>> Karl Heinz Kremer
>> PDF Acrobatics Without a Net
>> PDF Software Development, Training and More...
>>
>> khk@khk.net
>> http://www.khkonsulting.com
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: Date component in PDF

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 17.01.2017 um 17:40 schrieb Karl Heinz Kremer:
> The latest update to Adobe Acrobat and Adobe Reader DC does now finally
> support a data picker. The way this works is that you create a normal date
> field - meaning a text field with a date format applied - and when such a
> field is displayed in the latest version of Acrobat/Reader, a date picker
> is shown. See here for more information:
> http://khkonsulting.com/2017/01/new-form-field-types-in-acrobat-dc-image-field-and-date-picker/
>
> This means all you need to do is mimic what a date field created in Acrobat
> looks like. You would do that by creating one, and then analyzing what the
> field format and validation options look like (e.g. using the PDFBox
> Debugger). If you need a sample, you can download one from here:
> http://khkonsulting.com/files/AUC/date_image_field.pdf

Yeah, it's really just a text field. Plus two AA entries (F and K) that 
call this:
AFDate_FormatEx("m/d/yy");
AFDate_KeystrokeEx("m/d/yy");

Tilman


>
> There are other date pickers, which are implemented as JavaScript in the
> PDF form. If you want to implement something like that, you would have to
> get such a date picker, apply it to a document, and then again reverse
> engineer how this information is stored inside the field object.
>
>
> Karl Heinz Kremer
> PDF Acrobatics Without a Net
> PDF Software Development, Training and More...
>
> khk@khk.net
> http://www.khkonsulting.com
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Date component in PDF

Posted by Karl Heinz Kremer <kh...@khk.net>.
The latest update to Adobe Acrobat and Adobe Reader DC does now finally
support a data picker. The way this works is that you create a normal date
field - meaning a text field with a date format applied - and when such a
field is displayed in the latest version of Acrobat/Reader, a date picker
is shown. See here for more information:
http://khkonsulting.com/2017/01/new-form-field-types-in-acrobat-dc-image-field-and-date-picker/

This means all you need to do is mimic what a date field created in Acrobat
looks like. You would do that by creating one, and then analyzing what the
field format and validation options look like (e.g. using the PDFBox
Debugger). If you need a sample, you can download one from here:
http://khkonsulting.com/files/AUC/date_image_field.pdf

There are other date pickers, which are implemented as JavaScript in the
PDF form. If you want to implement something like that, you would have to
get such a date picker, apply it to a document, and then again reverse
engineer how this information is stored inside the field object.


Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...

khk@khk.net
http://www.khkonsulting.com

Re: Date component in PDF

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,
> Am 17.01.2017 um 10:16 schrieb Bharat Bhatt <bh...@gmail.com>:
> 
> I am using PDFBOX api to create the PDF document. I have to show DatePicker
> in PDF with same feature as in any form.

there is no such thing like a DatePicker in PDF as well as there is no date field type. You can add JavaScript to a field to ensure that only valid dates can be entered but this will be regular text input.

You might have seen a DatePicker in a PDF but thats very likely an XFA form done using Adobe LiveCycle Designer. In this case PDF is only a shell with an embedded XML Form Object in it (XFA). XFA does provide a date field and Adobe Reader/Acrobat will show a date picker component for that. But this would mean that you have to create an XFA Form whch is something totally different to a PDF form.

BR
Maruan

> 
> 
> Thanks,
> Bharat
> 
> On Tue, Jan 17, 2017 at 1:41 PM, Tilman Hausherr <TH...@t-online.de>
> wrote:
> 
>> Am 17.01.2017 um 08:12 schrieb Bharat Bhatt:
>> 
>>> Thanks for quick response. Some input or direction or example I can refer
>>> to create Date component.
>>> 
>> 
>> One can only guess what you mean. You didn't tell whether it is input or
>> output. I'd assume you mean input. You can use an ordinary text field as
>> shown in the CreateSimpleForm.java example. Or use three text fields
>> separated by "." or "/" or whatever you want.
>> 
>> If you want more, then you'd have to know and tell what you want. Or link
>> to an existing PDF that has what you want.
>> 
>> Tilman
>> 
>> 
>> 
>> 
>>> Thanks,
>>> Bharat
>>> 
>>> On Tue, Jan 17, 2017 at 12:31 PM, Tilman Hausherr <TH...@t-online.de>
>>> wrote:
>>> 
>>> Am 17.01.2017 um 07:52 schrieb Bharat Bhatt:
>>>> 
>>>> Hi,
>>>>> 
>>>>> How to create Date component in PDF ? Which api I can use it?
>>>>> 
>>>>> Thanks,
>>>>> Bharat
>>>>> 
>>>>> 
>>>>> There isn't. You have to do this yourself.
>>>> 
>>>> Tilman
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>> 
>>>> 
>>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Date component in PDF

Posted by Bharat Bhatt <bh...@gmail.com>.
I am using PDFBOX api to create the PDF document. I have to show DatePicker
in PDF with same feature as in any form.


Thanks,
Bharat

On Tue, Jan 17, 2017 at 1:41 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> Am 17.01.2017 um 08:12 schrieb Bharat Bhatt:
>
>> Thanks for quick response. Some input or direction or example I can refer
>> to create Date component.
>>
>
> One can only guess what you mean. You didn't tell whether it is input or
> output. I'd assume you mean input. You can use an ordinary text field as
> shown in the CreateSimpleForm.java example. Or use three text fields
> separated by "." or "/" or whatever you want.
>
> If you want more, then you'd have to know and tell what you want. Or link
> to an existing PDF that has what you want.
>
> Tilman
>
>
>
>
>> Thanks,
>> Bharat
>>
>> On Tue, Jan 17, 2017 at 12:31 PM, Tilman Hausherr <TH...@t-online.de>
>> wrote:
>>
>> Am 17.01.2017 um 07:52 schrieb Bharat Bhatt:
>>>
>>> Hi,
>>>>
>>>> How to create Date component in PDF ? Which api I can use it?
>>>>
>>>> Thanks,
>>>> Bharat
>>>>
>>>>
>>>> There isn't. You have to do this yourself.
>>>
>>> Tilman
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: Date component in PDF

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 17.01.2017 um 08:12 schrieb Bharat Bhatt:
> Thanks for quick response. Some input or direction or example I can refer
> to create Date component.

One can only guess what you mean. You didn't tell whether it is input or 
output. I'd assume you mean input. You can use an ordinary text field as 
shown in the CreateSimpleForm.java example. Or use three text fields 
separated by "." or "/" or whatever you want.

If you want more, then you'd have to know and tell what you want. Or 
link to an existing PDF that has what you want.

Tilman


>
> Thanks,
> Bharat
>
> On Tue, Jan 17, 2017 at 12:31 PM, Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> Am 17.01.2017 um 07:52 schrieb Bharat Bhatt:
>>
>>> Hi,
>>>
>>> How to create Date component in PDF ? Which api I can use it?
>>>
>>> Thanks,
>>> Bharat
>>>
>>>
>> There isn't. You have to do this yourself.
>>
>> Tilman
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Date component in PDF

Posted by Bharat Bhatt <bh...@gmail.com>.
Thanks for quick response. Some input or direction or example I can refer
to create Date component.

Thanks,
Bharat

On Tue, Jan 17, 2017 at 12:31 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> Am 17.01.2017 um 07:52 schrieb Bharat Bhatt:
>
>> Hi,
>>
>> How to create Date component in PDF ? Which api I can use it?
>>
>> Thanks,
>> Bharat
>>
>>
> There isn't. You have to do this yourself.
>
> Tilman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: Date component in PDF

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 17.01.2017 um 07:52 schrieb Bharat Bhatt:
> Hi,
>
> How to create Date component in PDF ? Which api I can use it?
>
> Thanks,
> Bharat
>

There isn't. You have to do this yourself.

Tilman


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org