You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Ankit Inkollu <ai...@gmail.com> on 2018/05/10 14:26:28 UTC

Accessing check-boxes in a non-acro form PDF

 Hi All,

*Scenario:*
I need to verify if the check-box for a certain field in a non-acro form
PDF is ticked or not.

*Options tried:*
1. I tried to search for any class in PDFBOX which points to the check-box
but could not find any.
2. Tried using the co-ordinates of the check-box and create an image and
then compare it against an already stored image of a check-box but this is
quite cumbersome and fails for few PDFs.


Is there a way in PDFBox which can implement the above mentioned scenario.
If this does not work out, is there an OCR API in JAVA which will help.

Do let me know if any of you have faced such a situation.

Thanks
Ankit

Re: Accessing check-boxes in a non-acro form PDF

Posted by Duff Johnson <du...@pdfa.org>.
>> *Scenario:*
>> I need to verify if the check-box for a certain field in a non-acro form
>> PDF is ticked or not.
>> 
>> *Options tried:*
>> 1. I tried to search for any class in PDFBOX which points to the check-box
>> but could not find any.
> 
> There isn't if it isn't acroform nor xfa. A box is just a box, i.e. a shape somewhere. (Unless the character for a checked box is used)

Just for completeness, it’s worth mentioning that PDF does include a construct for forms-without-widgets called “PrintField".

See ISO 32000-2, 14.8.5.6, “PrintField attributes”.

This has been around for a long time, but few bother to implement it, as it also requires significant understanding and implementation of tagged PDF (14.8).

Duff Johnson | PDF Association | duff.johnson@pdfa.org


Re: Accessing check-boxes in a non-acro form PDF

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 10.05.2018 um 16:26 schrieb Ankit Inkollu:
>   Hi All,
>
> *Scenario:*
> I need to verify if the check-box for a certain field in a non-acro form
> PDF is ticked or not.
>
> *Options tried:*
> 1. I tried to search for any class in PDFBOX which points to the check-box
> but could not find any.

There isn't if it isn't acroform nor xfa. A box is just a box, i.e. a 
shape somewhere. (Unless the character for a checked box is used)

> 2. Tried using the co-ordinates of the check-box and create an image and
> then compare it against an already stored image of a check-box but this is
> quite cumbersome and fails for few PDFs.



>
>
> Is there a way in PDFBox which can implement the above mentioned scenario.
> If this does not work out, is there an OCR API in JAVA which will help.

Tesseract has a java interface. But not PDFBox. Tika has an OCR option 
and it will use tesseract.

Tilman


>
> Do let me know if any of you have faced such a situation.
>
> Thanks
> Ankit
>


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