Closed ChrisMagnuson closed 3 years ago
@PrzemyslawKlys I agree, though just to be sure we are on the same page, the value is actually the full iText object, not just the type name, so all the properties/methods that are needed to read all the acrobat form field information about that form field are there.
There is some ambiguity about what the "Value" of the form field actually is as in my brief experience working with this there can be a difference between its Presentation value, the value that is returned by .GetValue(), the value returned by .GetValueAsString(), etc.
At this point the least opinionated thing is to hand back the object itself and then allow the caller to determine which of those represents the "Value" that is relevant to them in their context.
I do like the workflow your describing and eventually will keep adding things that get closer to being able to get the state of the form as a PSCustomObject, modify the PSCustomObject, and then write it back into the form to update the pdf even if that means making some opinionated assumptions.
I do understand your point. Maybe there could be a switch -Resolve or something that would provide a sort of "readable" form? I can accept it as is (to be later optimized), but as a standard user, I would like to see what my document has rather than simply stating its types. I'm trying to be "pro user". Do the user work for him.
I've merged it, but it would be great if at some point in time that can be enhanced. Thank you!
This is amazing ;-D
One thought - would it be possible to have visibility of current settings?
We are given types as values, but not what it's set currently and I guess the user would like to be able to tell.
For example right now you predefined Hashtable with values that you want to fill in by hand, but what if the user would like to read Forms first, and then based if it's set to true/false or some text, overwrite it with something else? Maybe you could add some easy translation?
So maybe a PSCustomobject Key, Type, Value, RealValue or something that makes sense