Re: [Podofo-users] PDF Forms with non-standard annotations
A PDF parsing, modification and creation library.
Brought to you by:
domseichter
|
From: Dennis J. <den...@gm...> - 2014-04-28 03:39:13
|
On Fri, Apr 25, 2014 at 10:09 AM, Dennis Jenkins <
den...@gm...> wrote:
>
> On Fri, Apr 25, 2014 at 6:56 AM, Leonard Rosenthol <lro...@ad...>wrote:
>
>> The FT key can be inherited from it’s parent when they are organized in
>> a hierarchy (ISO 32000-1, 12.7.3.1).
>>
>> Yes, checking the Subtype is the correct way to identify a form field.
>> HOWEVER, you should probably also look at adding inheritance support (as a
>> generalization) to some/all of the field related APIs.
>>
>> Leonard
>>
>>
>>
Adjusting PoDoFo to handle the "inherited" fields in the A1-QRT form is not
going to be as easy as I had hoped. I tweaked PdfPage::GetNumFields() and
PdfPage::GetField() to ignore the check on the "FT" dictionary key.
"PdfPage::GetField()" now segfaults in the constructor to PdfField()
(PdfField.cpp, line #172) because 'GetKey('FT')' returns NULL, which is
passed as the 'this' pointer into 'GetName()'.
PdfField::PdfField( PdfObject* pObject, PdfAnnotation* pWidget )
: m_pObject( pObject ), m_pWidget( pWidget ), m_eField(
ePdfField_Unknown )
{
PdfName fieldType = m_pObject->GetDictionary().GetKey( PdfName("FT")
)->GetName();
if( fieldType == PdfName("Btn") )
{
PdfButton button( *this );
So, as Leonard pointed out, we will need to implement proper inheritance.
I see in PoDoFoBrowser that required dictionary keys are in the "->Parent"
dictionary of field 7 of page 0. The represents of the 'Parent' dictionary
as mentioned in the ISO document section 12.7.3.1, Table 220, page #432.
I'll take a stab at modifying PoDoFo to properly handle field inheritance.
I'll post something in the near future.
|