Many appologies for sending directly to you.

I develop a solution for this (in C# though), I'm interesting in other's 
thoughts.

Best Regards,
Pete Mourfield

// Get's the field "special" format (i.e. Date, Time, etc)
string GetFieldFormat(AcroFields.Item item)
{
    PdfDictionary aa = 
(PdfDictionary)PdfReader.GetPdfObject(((PdfDictionary)item.merged[0]).Get(PdfName.AA));
    if (null != aa)
    {
        PdfDictionary f = 
(PdfDictionary)PdfReader.GetPdfObject(aa.Get(PdfName.F));
        if (null != f)
        {
            PdfString js = (PdfString)PdfReader.GetPdfObject(f.Get(PdfName.JS));
            if (null != js)
            {
                string sScriptName = js.ToString();
                if (sScriptName.Contains("AFNumber_Format"))
                    return "Number";
                else if (sScriptName.Contains("AFDate_Format"))
                    return "Date";
                else if (sScriptName.Contains("AFTime_Format"))
                    return "Time";
                else if (sScriptName.Contains("AFSpecial_Format"))
                    return "Special";
                else if (sScriptName.Contains("AFPercent_Format"))
                    return "Percent";
                else
                    return "Custom";
            }
        }
    }
    return "None";
}


---------- Original Message ----------------------------------
From: bruno <[EMAIL PROTECTED]>
Date:  Thu, 29 Jun 2006 15:45:05 +0200

>Peter Mourfield wrote:
>
>>Bruno,
>>
>>I'm hoping that you can help me. I'm trying to use iText to determine the 
>>format (text, date, etc) of a field in an existing pdf document. So far I've 
>>been unable to figure out how to do this.
>>
>>Any help would be greatly appreciated.
>>  
>>
>Please don't send mail to iText developers personally,
>use the mailinglist instead: http://itext.ugent.be/info/contact.php
>
>As for your question: it is possible to determine the type
>of a field with method AcroFields.getFieldType, this will
>return one of the following values:
>AcroFields.FIELD_TYPE_NONE
>AcroFields.FIELD_TYPE_TEXT
>AcroFields.FIELD_TYPE_PUSHBUTTON
>AcroFields.FIELD_TYPE_RADIOBUTTON
>AcroFields.FIELD_TYPE_CHECKBOX
>AcroFields.FIELD_TYPE_COMBO
>AcroFields.FIELD_TYPE_LIST
>AcroFields.FIELD_TYPE_SIGNATURE
>However, if a field is a text field (FIELD_TYPE_TEXT),
>there is no way to tell if it should contain a name, a date,...
>or any other construct.
>br,
>Bruno
>
 




________________________________________________________________
Sent via the WebMail system at mourfield.com


 
                   


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to