I have found the answer on how to extract properties of acrofields at  http://itext.ugent.be/library/question.php?id=31
 
The properties which I want to extract are
 
textfont
textcolor
textsize
text alignment
 
I printed the properties of two acrofields and the output was
 
1.  /FT -- /Tx
/RV -- <?xml version="1.0"?><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa
=" http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="Acrobat:7.0.0" xfa:sp
ec="2.0.2"  style="font-size:32.0pt;text-align:center;font-weight:bold;font-fami
ly:Arial,sans-serif"><p>TEST VALUE</p></body>
/Rect -- System.Collections.ArrayList
/Subtype -- /Widget
/V -- TEST VALUE
/T -- f4
/Q -- 1
/P -- 18 0 R
/DV -- 68 0 R
/DS -- 67 0 R
/DR -- Dictionary of type:
/Type -- /Annot
/F -- 4
/MK -- Dictionary of type:
/Ff -- 46137344
/Fields -- System.Collections.ArrayList
/DA -- /Arial,Bold 32 Tf 0 g
/AP -- Dictionary of type:
 
2. /Rect -- System.Collections.ArrayList
/AP -- Dictionary of type:
/P -- 18 0 R
/FT -- /Tx
/Fields -- System.Collections.ArrayList
/Ff -- 12582912
/MK -- Dictionary of type:
/F -- 4
/DR -- Dictionary of type:
/DA -- /Arial,Bold 22 Tf 0 g
/Subtype -- /Widget
/DV -- 65 0 R
/Q -- 1
/V -- Certificate of Professional Competence
/Type -- /Annot
/T -- f9
 
I can see that tokenizing /DA will give me font, font size and font-weight. however how about text alignment?
 
For field 1, the text alignment is present in /RV tag, but this tag doesn't appear for all other fields. For fields which don't have /RV tag, how to extract text alignment?
 
The second risk which I see is that I have to do string tokenization to extract the values of font name, font-weight and font size. However this may be error prone. Can I assme that the format of /DA will always be <font-name>,<font-weight> <font-size>?
 
regards,
Abhishek.
 
 
how do I extract the 4 properties mentioned above?
 
 
 


On 8/7/06, Abhishek Srivastava <[EMAIL PROTECTED]> wrote:
Hello All,
 
I am reading an Pdf document which contains AcroFields.
 
I am able to read the fields correctly. However I also want to find out what are the properties of the field. For example, what font has been used, font size etc.
 
I can see that AcroFields class provides a setFieldProperty method but there is not a getFieldsProperty method.
 
How can I get the properties assosiated with an AcroField.
 
regards,
Abhishek.

-------------------------------------------------------------------------
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