  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | JSP - A mailing list about Java Server Pages specification and reference | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Best way to determine if an existing form field has the multil | Best way to determine if an existing form field has the multil 2006-07-20 - By Malloy, James
Back I have a process that fills forms. I want to do a specific action if a form field is multiline. What is the best way to determine if the field is multiline? Previously I have done: com.lowagie.text.pdf.AcroFields item = form.getFieldItem(field);
PdfDictionary dict = (PdfDictionary) item.merged.get(0);
Object multiline = dict.get(PdfName.FF);
if (multiline == null) {
//Do something
}
This no long seems to work as I intended because fields that do not have the multiline property checked return an integer value rather than a null like it used to. it seems like I am missing something and there should be an easier way.
I am using the latest version of Itext on JDK 1.3.1_10
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- This e-mail transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusively for the person(s) to whom it is addressed. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designees is strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately by return e-mail and delete all copies.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=us-ascii"> <META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD> <BODY> <DIV><FONT face=Arial><SPAN class=641342415-20072006>I have a process that fills forms. I want to do a specific action if a form field is multiline. What is the best way to determine if the field is multiline?</SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN class=641342415-20072006></SPAN></FONT> </DIV> <DIV><FONT face=Arial size=2><SPAN class=641342415-20072006>Previously I have done:</SPAN></FONT></DIV> <DIV><FONT size=2><SPAN class=641342415-20072006> <P align=left><FONT face=Arial size=3>com.lowagie.text.pdf.AcroFields item = form.getFieldItem(field);</FONT></P> <P align=left><FONT size=3><FONT face=Arial>PdfDictionary dict = (PdfDictionary ) item.</FONT><FONT face=Arial color=#0000c0>merged</FONT><FONT face=Arial>.get(0);</FONT></FONT></P> <P align=left><FONT size=3><FONT face=Arial>Object multiline = dict.get(PdfName.</FONT><I><FONT color=#0000c0><FONT face=Arial>FF</FONT></I></FONT></FONT><FONT face=Arial size=3>);</FONT></P> <P align=left><B><FONT color=#7f0055><FONT face=Arial size=3>if</FONT></B></FONT><FONT face=Arial><FONT size=3> (multiline == <B> <FONT color=#7f0055>null</B></FONT></FONT></FONT><FONT face=Arial size=3>) {</FONT></P> <P align=left><FONT face=Arial><SPAN class=641342415-20072006>   ; //Do something</SPAN></FONT></P> <P><FONT face=Arial size=3>}</FONT></P> <P><FONT face=Arial size=3></FONT> </P> <P><SPAN class=641342415-20072006><FONT face=Arial size=3>This no long seems to work as I intended because fields that do not have the multiline property checked return an integer value rather than a null like it used to. it seems like I am missing something and there should be an easier way.</FONT></SPAN></P> <P><SPAN class=641342415-20072006><FONT face=Arial size=3></FONT></SPAN> </P> <P><SPAN class=641342415-20072006><FONT face=Arial size=3>I am using the latest version of Itext on JDK 1.3.1_10</FONT></SPAN></P></SPAN></FONT></DIV> <P>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----<br> This e-mail transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusively for the person(s) to whom it is addressed. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designees is strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately by return e-mail and delete all copies. <br> <br> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----<br> </P></BODY></HTML>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- 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@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions
|
|
 |