On Fri, Apr 25, 2014 at 10:09 AM, Dennis Jenkins <
dennis.jenkins...@gmail.com> wrote:

>
> On Fri, Apr 25, 2014 at 6:56 AM, Leonard Rosenthol <lrose...@adobe.com>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.
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to