You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Magnus Evensberget <ma...@gmail.com> on 2015/08/19 11:25:46 UTC

Changing visability on formfield (PDFBox 2.0.0)

Hey,

I'm trying to change the visability of a field (Visable, Hidden, Visible
but doesn't print and Hidden but printable) but I can't find a way to do
this. Is there implemented a method for this?

I am using this to stikethrough text that are embedded on the pdf (by
having a border on a textfield) . Is there another more elegant way of
doing this?

Thanks
Magnus

Re: Changing visability on formfield (PDFBox 2.0.0)

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,

> Am 19.08.2015 um 11:25 schrieb Magnus Evensberget <ma...@gmail.com>:
> 
> Hey,
> 
> I'm trying to change the visability of a field (Visable, Hidden, Visible
> but doesn't print and Hidden but printable) but I can't find a way to do
> this. Is there implemented a method for this?

the visibility is set on the fields widget annotation which you can get via field.getWidgets() (a filed might have multiple widget annotations).

> 
> I am using this to stikethrough text that are embedded on the pdf (by
> having a border on a textfield) . Is there another more elegant way of
> doing this?

I've done something similar in the past (highlight a text) with annotations instead of fields as a field involves more objects (the field and the annotation(s) associated).

BR
Maruan

> 
> Thanks
> Magnus


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