Hi,
I need to get information from acroforms. I need to read an PDF and identify
textfield and buttonfiled. This I can do following the examples and I can get
informations from positions.
But I need get some extra information like rotation, text color, font name,
font size, etc for textfield, and rotation, etc for buttonfield.
At iTextSharp we have a class named TextField that I think can be filled with
information from a textfiled form, but I don't know how to do this.
I'm using PdfReader to open the document.
Here is a peace of the code:
PdfReader reader = new PdfReader("c:\\temp\\form.pdf");
AcroFields form = reader.AcroFields;
Hashtable fields = form.Fields;
String key;
foreach (DictionaryEntry de in fields)
{
key = de.Key.ToString();
switch (form.GetFieldType(key))
{
case AcroFields.FIELD_TYPE_PUSHBUTTON:
Console.WriteLine("Pushbutton");
float[] positions2 = form.GetFieldPositions(key);
for (int i = 0; i < positions2.Length; i++)
{
Console.WriteLine(positions2[i].ToString());
}
//I need more information here
break;
case AcroFields.FIELD_TYPE_TEXT:
Console.WriteLine("Text");
float[] positions = form.GetFieldPositions(key);
for (int i = 0; i < positions.Length; i++)
{
Console.WriteLine(positions[i].ToString());
}
//I need more information here
}
}
Thanks
Rodrigo
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/