This is the first time I use PDFNet.
I can iterate all form fields but there is no method to show/hide.
EraseAppearance does not seem to have any effect.
FieldIterator itr = doc.GetFieldIterator();
for (; itr.HasNext(); itr.Next())
{
Field field = itr.Current();
if (field.GetName() == "MyButton0")
{
?????????
doc.Save("newsaved.pdf", SDFDoc.SaveOptions.e_remove_unused);
}
}
So that we can best assist, could you elaborate on why hiding form fields is important for you?
Can you just delete the Button?
Or you want to runtime toggle the Button Hide/Show?
I want to show and hide a text covered by a form field.
It can be easily done with Javascript but it’s not permanent and I do not want to use OCGs either.
Deleting the field manually in an editor works fine, but I’d like to do it in a way described in
my previous post.
What viewer(s) do you expect this show/hide to work?
When exactly do you switch show/hide?
What is wrong with OCGs (which is how you would normally show/hide text).