Java Doc for PushbuttonField.java in  » PDF » pdf-itext » com » lowagie » text » pdf » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » PDF » pdf itext » com.lowagie.text.pdf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.lowagie.text.pdf.BaseField
      com.lowagie.text.pdf.PushbuttonField

PushbuttonField
public class PushbuttonField extends BaseField (Code)
Creates a pushbutton field. It supports all the text and icon alignments. The icon may be an image or a template.

Example usage:

 Document document = new Document(PageSize.A4, 50, 50, 50, 50);
 PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("output.pdf"));
 document.open();
 PdfContentByte cb = writer.getDirectContent();
 Image img = Image.getInstance("image.png");
 PushbuttonField bt = new PushbuttonField(writer, new Rectangle(100, 100, 200, 200), "Button1");
 bt.setText("My Caption");
 bt.setFontSize(0);
 bt.setImage(img);
 bt.setLayout(PushbuttonField.LAYOUT_ICON_TOP_LABEL_BOTTOM);
 bt.setBackgroundColor(Color.cyan);
 bt.setBorderStyle(PdfBorderDictionary.STYLE_SOLID);
 bt.setBorderColor(Color.red);
 bt.setBorderWidth(3);
 PdfFormField ff = bt.getField();
 PdfAction ac = PdfAction.createSubmitForm("http://www.submit-site.com", null, 0);
 ff.setAction(ac);
 writer.addAnnotation(ff);
 document.close();
 

author:
   Paulo Soares (psoares@consiste.pt)


Field Summary
final public static  intLAYOUT_ICON_LEFT_LABEL_RIGHT
    
final public static  intLAYOUT_ICON_ONLY
    
final public static  intLAYOUT_ICON_TOP_LABEL_BOTTOM
    
final public static  intLAYOUT_LABEL_LEFT_ICON_RIGHT
    
final public static  intLAYOUT_LABEL_ONLY
    
final public static  intLAYOUT_LABEL_OVER_ICON
    
final public static  intLAYOUT_LABEL_TOP_ICON_BOTTOM
    
final public static  intSCALE_ICON_ALWAYS
    
final public static  intSCALE_ICON_IS_TOO_BIG
    
final public static  intSCALE_ICON_IS_TOO_SMALL
    
final public static  intSCALE_ICON_NEVER
    

Constructor Summary
public  PushbuttonField(PdfWriter writer, Rectangle box, String fieldName)
     Creates a new instance of PushbuttonField
Parameters:
  writer - the document PdfWriter
Parameters:
  box - the field location and dimensions
Parameters:
  fieldName - the field name.

Method Summary
public  PdfAppearancegetAppearance()
     Gets the button appearance.
public  PdfFormFieldgetField()
     Gets the pushbutton field.
public  floatgetIconHorizontalAdjustment()
     Getter for property iconHorizontalAdjustment.
public  PRIndirectReferencegetIconReference()
     Gets the reference to an existing icon.
public  floatgetIconVerticalAdjustment()
     Getter for property iconVerticalAdjustment.
public  ImagegetImage()
     Getter for property image.
public  intgetLayout()
     Getter for property layout.
public  intgetScaleIcon()
     Getter for property scaleIcon.
public  PdfTemplategetTemplate()
     Getter for property template.
public  booleanisIconFitToBounds()
     Getter for property iconFitToBounds.
public  booleanisProportionalIcon()
     Getter for property proportionalIcon.
public  voidsetIconFitToBounds(boolean iconFitToBounds)
     If true the icon will be scaled to fit fully within the bounds of the annotation, if false the border width will be taken into account.
public  voidsetIconHorizontalAdjustment(float iconHorizontalAdjustment)
     A number between 0 and 1 indicating the fraction of leftover space to allocate at the left of the icon. A value of 0 positions the icon at the left of the annotation rectangle. A value of 0.5 centers it within the rectangle.
public  voidsetIconReference(PRIndirectReference iconReference)
     Sets the reference to an existing icon.
public  voidsetIconVerticalAdjustment(float iconVerticalAdjustment)
     A number between 0 and 1 indicating the fraction of leftover space to allocate at the bottom of the icon. A value of 0 positions the icon at the bottom of the annotation rectangle. A value of 0.5 centers it within the rectangle.
public  voidsetImage(Image image)
     Sets the icon as an image.
public  voidsetLayout(int layout)
     Sets the icon and label layout.
public  voidsetProportionalIcon(boolean proportionalIcon)
     Sets the way the icon is scaled.
public  voidsetScaleIcon(int scaleIcon)
     Sets the way the icon will be scaled.
public  voidsetTemplate(PdfTemplate template)
     Sets the icon as a template.

Field Detail
LAYOUT_ICON_LEFT_LABEL_RIGHT
final public static int LAYOUT_ICON_LEFT_LABEL_RIGHT(Code)
A layout option



LAYOUT_ICON_ONLY
final public static int LAYOUT_ICON_ONLY(Code)
A layout option



LAYOUT_ICON_TOP_LABEL_BOTTOM
final public static int LAYOUT_ICON_TOP_LABEL_BOTTOM(Code)
A layout option



LAYOUT_LABEL_LEFT_ICON_RIGHT
final public static int LAYOUT_LABEL_LEFT_ICON_RIGHT(Code)
A layout option



LAYOUT_LABEL_ONLY
final public static int LAYOUT_LABEL_ONLY(Code)
A layout option



LAYOUT_LABEL_OVER_ICON
final public static int LAYOUT_LABEL_OVER_ICON(Code)
A layout option



LAYOUT_LABEL_TOP_ICON_BOTTOM
final public static int LAYOUT_LABEL_TOP_ICON_BOTTOM(Code)
A layout option



SCALE_ICON_ALWAYS
final public static int SCALE_ICON_ALWAYS(Code)
An icon scaling option



SCALE_ICON_IS_TOO_BIG
final public static int SCALE_ICON_IS_TOO_BIG(Code)
An icon scaling option



SCALE_ICON_IS_TOO_SMALL
final public static int SCALE_ICON_IS_TOO_SMALL(Code)
An icon scaling option



SCALE_ICON_NEVER
final public static int SCALE_ICON_NEVER(Code)
An icon scaling option




Constructor Detail
PushbuttonField
public PushbuttonField(PdfWriter writer, Rectangle box, String fieldName)(Code)
Creates a new instance of PushbuttonField
Parameters:
  writer - the document PdfWriter
Parameters:
  box - the field location and dimensions
Parameters:
  fieldName - the field name. If null only the widget keyswill be included in the field allowing it to be used as a kid field.




Method Detail
getAppearance
public PdfAppearance getAppearance() throws IOException, DocumentException(Code)
Gets the button appearance.
throws:
  IOException - on error
throws:
  DocumentException - on error the button appearance



getField
public PdfFormField getField() throws IOException, DocumentException(Code)
Gets the pushbutton field.
throws:
  IOException - on error
throws:
  DocumentException - on error the pushbutton field



getIconHorizontalAdjustment
public float getIconHorizontalAdjustment()(Code)
Getter for property iconHorizontalAdjustment. Value of property iconHorizontalAdjustment.



getIconReference
public PRIndirectReference getIconReference()(Code)
Gets the reference to an existing icon. the reference to an existing icon.



getIconVerticalAdjustment
public float getIconVerticalAdjustment()(Code)
Getter for property iconVerticalAdjustment. Value of property iconVerticalAdjustment.



getImage
public Image getImage()(Code)
Getter for property image. Value of property image.



getLayout
public int getLayout()(Code)
Getter for property layout. Value of property layout.



getScaleIcon
public int getScaleIcon()(Code)
Getter for property scaleIcon. Value of property scaleIcon.



getTemplate
public PdfTemplate getTemplate()(Code)
Getter for property template. Value of property template.



isIconFitToBounds
public boolean isIconFitToBounds()(Code)
Getter for property iconFitToBounds. Value of property iconFitToBounds.



isProportionalIcon
public boolean isProportionalIcon()(Code)
Getter for property proportionalIcon. Value of property proportionalIcon.



setIconFitToBounds
public void setIconFitToBounds(boolean iconFitToBounds)(Code)
If true the icon will be scaled to fit fully within the bounds of the annotation, if false the border width will be taken into account. The default is false.
Parameters:
  iconFitToBounds - if true the icon will be scaled to fit fully within the bounds of the annotation,if false the border width will be taken into account



setIconHorizontalAdjustment
public void setIconHorizontalAdjustment(float iconHorizontalAdjustment)(Code)
A number between 0 and 1 indicating the fraction of leftover space to allocate at the left of the icon. A value of 0 positions the icon at the left of the annotation rectangle. A value of 0.5 centers it within the rectangle. The default is 0.5.
Parameters:
  iconHorizontalAdjustment - a number between 0 and 1 indicating the fraction of leftover space to allocate at the left of the icon



setIconReference
public void setIconReference(PRIndirectReference iconReference)(Code)
Sets the reference to an existing icon.
Parameters:
  iconReference - the reference to an existing icon



setIconVerticalAdjustment
public void setIconVerticalAdjustment(float iconVerticalAdjustment)(Code)
A number between 0 and 1 indicating the fraction of leftover space to allocate at the bottom of the icon. A value of 0 positions the icon at the bottom of the annotation rectangle. A value of 0.5 centers it within the rectangle. The default is 0.5.
Parameters:
  iconVerticalAdjustment - a number between 0 and 1 indicating the fraction of leftover space to allocate at the bottom of the icon



setImage
public void setImage(Image image)(Code)
Sets the icon as an image.
Parameters:
  image - the image



setLayout
public void setLayout(int layout)(Code)
Sets the icon and label layout. Possible values are LAYOUT_LABEL_ONLY, LAYOUT_ICON_ONLY, LAYOUT_ICON_TOP_LABEL_BOTTOM, LAYOUT_LABEL_TOP_ICON_BOTTOM, LAYOUT_ICON_LEFT_LABEL_RIGHT, LAYOUT_LABEL_LEFT_ICON_RIGHT and LAYOUT_LABEL_OVER_ICON. The default is LAYOUT_LABEL_ONLY.
Parameters:
  layout - New value of property layout.



setProportionalIcon
public void setProportionalIcon(boolean proportionalIcon)(Code)
Sets the way the icon is scaled. If true the icon is scaled proportionally, if false the scaling is done anamorphicaly.
Parameters:
  proportionalIcon - the way the icon is scaled



setScaleIcon
public void setScaleIcon(int scaleIcon)(Code)
Sets the way the icon will be scaled. Possible values are SCALE_ICON_ALWAYS, SCALE_ICON_NEVER, SCALE_ICON_IS_TOO_BIG and SCALE_ICON_IS_TOO_SMALL. The default is SCALE_ICON_ALWAYS.
Parameters:
  scaleIcon - the way the icon will be scaled



setTemplate
public void setTemplate(PdfTemplate template)(Code)
Sets the icon as a template.
Parameters:
  template - the template



Fields inherited from com.lowagie.text.pdf.BaseField
final public static float BORDER_WIDTH_MEDIUM(Code)(Java Doc)
final public static float BORDER_WIDTH_THICK(Code)(Java Doc)
final public static float BORDER_WIDTH_THIN(Code)(Java Doc)
final public static int COMB(Code)(Java Doc)
final public static int DO_NOT_SCROLL(Code)(Java Doc)
final public static int DO_NOT_SPELL_CHECK(Code)(Java Doc)
final public static int EDIT(Code)(Java Doc)
final public static int FILE_SELECTION(Code)(Java Doc)
final public static int HIDDEN(Code)(Java Doc)
final public static int HIDDEN_BUT_PRINTABLE(Code)(Java Doc)
final public static int MULTILINE(Code)(Java Doc)
final public static int PASSWORD(Code)(Java Doc)
final public static int READ_ONLY(Code)(Java Doc)
final public static int REQUIRED(Code)(Java Doc)
final public static int VISIBLE(Code)(Java Doc)
final public static int VISIBLE_BUT_DOES_NOT_PRINT(Code)(Java Doc)
protected int alignment(Code)(Java Doc)
protected Color backgroundColor(Code)(Java Doc)
protected Color borderColor(Code)(Java Doc)
protected int borderStyle(Code)(Java Doc)
protected float borderWidth(Code)(Java Doc)
protected Rectangle box(Code)(Java Doc)
protected String fieldName(Code)(Java Doc)
protected BaseFont font(Code)(Java Doc)
protected float fontSize(Code)(Java Doc)
protected int maxCharacterLength(Code)(Java Doc)
protected int options(Code)(Java Doc)
protected int rotation(Code)(Java Doc)
protected String text(Code)(Java Doc)
protected Color textColor(Code)(Java Doc)
protected int visibility(Code)(Java Doc)
protected PdfWriter writer(Code)(Java Doc)

Methods inherited from com.lowagie.text.pdf.BaseField
protected static ArrayList breakLines(ArrayList breaks, BaseFont font, float fontSize, float width)(Code)(Java Doc)
public int getAlignment()(Code)(Java Doc)
public Color getBackgroundColor()(Code)(Java Doc)
protected PdfAppearance getBorderAppearance()(Code)(Java Doc)
public Color getBorderColor()(Code)(Java Doc)
public int getBorderStyle()(Code)(Java Doc)
public float getBorderWidth()(Code)(Java Doc)
public Rectangle getBox()(Code)(Java Doc)
public String getFieldName()(Code)(Java Doc)
public BaseFont getFont()(Code)(Java Doc)
public float getFontSize()(Code)(Java Doc)
protected static ArrayList getHardBreaks(String text)(Code)(Java Doc)
public int getMaxCharacterLength()(Code)(Java Doc)
public int getOptions()(Code)(Java Doc)
protected BaseFont getRealFont() throws IOException, DocumentException(Code)(Java Doc)
public int getRotation()(Code)(Java Doc)
public String getText()(Code)(Java Doc)
public Color getTextColor()(Code)(Java Doc)
public int getVisibility()(Code)(Java Doc)
public PdfWriter getWriter()(Code)(Java Doc)
public static void moveFields(PdfDictionary from, PdfDictionary to)(Code)(Java Doc)
public void setAlignment(int alignment)(Code)(Java Doc)
public void setBackgroundColor(Color backgroundColor)(Code)(Java Doc)
public void setBorderColor(Color borderColor)(Code)(Java Doc)
public void setBorderStyle(int borderStyle)(Code)(Java Doc)
public void setBorderWidth(float borderWidth)(Code)(Java Doc)
public void setBox(Rectangle box)(Code)(Java Doc)
public void setFieldName(String fieldName)(Code)(Java Doc)
public void setFont(BaseFont font)(Code)(Java Doc)
public void setFontSize(float fontSize)(Code)(Java Doc)
public void setMaxCharacterLength(int maxCharacterLength)(Code)(Java Doc)
public void setOptions(int options)(Code)(Java Doc)
public void setRotation(int rotation)(Code)(Java Doc)
public void setRotationFromPage(Rectangle page)(Code)(Java Doc)
public void setText(String text)(Code)(Java Doc)
public void setTextColor(Color textColor)(Code)(Java Doc)
public void setVisibility(int visibility)(Code)(Java Doc)
public void setWriter(PdfWriter writer)(Code)(Java Doc)
protected static void trimRight(StringBuffer buf)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.