On Sat, Mar 23, 2019 at 7:25 PM Michal Sudolsky <[email protected]> wrote:

>
>
> On Thu, Mar 21, 2019 at 4:09 AM [email protected] <[email protected]>
> wrote:
>
>> Thanks for pointing this out Michal!
>>
>>
>>
>> > To read acroforms correctly using current podofo
>>
>> > you need to check whether has annotation Parent key
>>
>> > and if yes then create PdfField instance from it instead
>>
>> > of from annotation itself. As also states pdf reference
>>
>> > Ff key is inheritable like FT and some other keys.
>>
>>
>>
>> Do you have some pseudo or can you point to some example code that
>> demonstrates how to do this?
>>
>
> For example:
>
> ```
> PdfAnnotation *annot = page->GetAnnotation(i);
> PdfObject *parent = annot->GetObject()->GetIndirectKey("Parent");
> if(parent) // or maybe also add "&&
> !annot->GetObject()->GetDictionary().HasKey("Ff")" or check for "FT" key or
> "T" key
> {
> use PdfField curField(parent, annot)
> }
> else
> {
> use PdfField curField(annot->GetObject(), annot)
> }
> ```
>
>
Or similarly using field:

```
PdfField *field = page->GetField(i);
PdfObject *parent = field->GetFieldObject()->GetIndirectKey("Parent");
if(parent) // or maybe also add "&&
!field->GetFieldObject()->GetDictionary().HasKey("Ff")" or check for "FT"
key or "T" key
{
use PdfField curField(parent, field)
}
else
{
use PdfField curField(field->GetFieldObject(), field)
}
```


> In this way can be used curField.GetType() or one can manually read FT, Ff
> and other keys by traversing through "Parent path" if specified key in
> actual node is missing (as pdf reference does not says that also Parent
> cannot have another Parent and so on).
>
>
>>
>> > Either podofopdfinfo info is wrongly reading
>>
>> > acroforms or bug is in podofo depending on point of view
>>
>>
>>
>> Do you think it makes sense to file a bug report for this issue?
>>
>
> Yes podofopdfinfo is incorrect and podofo function GetType should return
> correct annotation type (at least).
>
>
>>
>> Stefan
>>
>>
>> 
>>
>
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to