Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading fields from PDF
Message
De
11/11/2011 17:20:22
 
 
À
11/11/2011 17:12:55
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01528652
Message ID:
01528702
Vues:
38
Did you try the syntax in the code I posted?
( where pdfform is fully qualified path and name to the pdfform )

Dim PdfReader As PdfReader = New PdfReader(pdfform)

Dim fieldlist As New ArrayList(PdfReader.AcroFields.Fields.Keys)


>>Yes that is very much like the situation I had and this worked very well.
>
>I tried that earlier on and was unable to make it work. It seems to be related to the same problem I have in this example:
>
>
>    ' Get all the fields from a PDF file
>    ' expC1 File
>    Private Function GetFields(ByVal tcFile As String) As Boolean
>        Dim loAcroFields As iTextSharp.text.pdf.AcroFields = Nothing
>        Dim loDictionaryEntry As DictionaryEntry = Nothing
>        Dim loPdfReader As iTextSharp.text.pdf.PdfReader = Nothing
>
>        ' Get the file
>        loPdfReader = New iTextSharp.text.pdf.PdfReader(tcFile)
>
>        ' Get the fields
>        loAcroFields = loPdfReader.AcroFields
>
>        ' For each field
>        For Each loDictionaryEntry In loAcroFields.Fields
>
>        Next
>
>        Return True
>    End Function
>
>
>As you can see, this example is very sample. But, the designer doesn't like the loAcroFields.Fields in the For/Next loop. It says:
>
>"Value of type 'System.Collections.Generic.KeyValuePair(Of String, iTextSharp.text.pdf.AcroFields.Item)' cannot be converted to 'System.Collections.DictionaryEntry'."
>
>I also tried with all the imports. This has no effect. In my code, I include the namespace as is where needed.
>
>This is an example I took from http://blog.pagesd.info/post/2008/09/25/Lister-les-champs-d-un-formulaire-PDF.


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform