I have pdf files with formatting applied to some of the fileds and I want to
remove that formatting.

Below I list the routine I use to inspect the format and get the javascript
name and therefore determine the type of formatting - although this is not
important as all I want to do is remove the formatting.

While I am a novice with iText and PDF in general, I see that AA's are used
to specify the format, so I guess I want to remove the AA associated with
the field, or perhaps remove the javascript, or even perhaps modify the
javascript to return the data unformatted - whatever...

How would I remove the formatting form fields?

thanks
kpg

<Code>

    Private Shared Function GetFieldFormat(ByVal item As AcroFields.Item) As
String

        'Get Additional Actions
        Dim aa As PdfDictionary =
PdfReader.GetPdfObject((item.GetMerged(0)).Get(PdfName.AA))

        If aa IsNot Nothing Then

            'Get F format
            Dim f As PdfDictionary =
PdfReader.GetPdfObject(aa.Get(PdfName.F))

            If f IsNot Nothing Then

                'Get Javascript
                Dim js As PdfString =
PdfReader.GetPdfObject(f.Get(PdfName.JS))
                If js IsNot Nothing Then

                    Dim sScriptName As String = js.ToString

                    If (sScriptName.Contains("AFNumber_Format")) Then
                        Return "Number"
                    ElseIf (sScriptName.Contains("AFDate_Format")) Then
                        Return "Date"
                    ElseIf (sScriptName.Contains("AFTime_Format")) Then
                        Return "Time"
                    ElseIf (sScriptName.Contains("AFSpecial_Format")) Then
                        Return "Special"
                    ElseIf (sScriptName.Contains("AFPercent_Format")) Then
                        Return "Percent"
                    Else
                        Return "Custom"
                    End If

                End If
            End If
        End If

        Return "None"

    End Function

</Code>
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Remove-field-level-formatting-tp3049476p3049476.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to