|
java.lang.Object
Node
Inline
SpecialChar
com.aspose.words.FieldChar
- All Implemented Interfaces:
- java.lang.Iterable, java.lang.Cloneable
- Direct Known Subclasses:
- FieldEnd, FieldSeparator, FieldStart
public abstract class FieldChar - extends SpecialChar
Base class for nodes that represent field characters in a document.
A complete field in a Microsoft Word document is a complex structure consisting of
a field start character, field code, field separator character, field result
and field end character. Some fields only have field start, field code and field end. To easily insert a new field into a document, use the DocumentBuilder.insertField(java.lang.String, java.lang.String)
method. - See Also:
- FieldStart, FieldSeparator, FieldEnd
|
Property Getters/Setters Detail |
getFieldType | |
public int getFieldType()
|
-
Returns the type of the field.
The value of the property is FieldType integer constant.
getNodeType | → inherited from SpecialChar |
public int getNodeType()
|
-
Returns NodeType.SpecialChar.
The value of the property is NodeType integer constant.
getParentParagraph | → inherited from Inline |
public Paragraph getParentParagraph()
|
-
Returns the immediate parent paragraph.
Equivalent to
(Paragraph)ParentNode.
getFont | → inherited from Inline |
public Font getFont()
|
-
Provides access to the font formatting of this object.
Example: Creates a simple document from scratch using the Aspose.Words object model.
// Create an "empty" document. Note that like in Microsoft Word,
// the empty document has one section, body and one paragraph in it.
Document doc = new Document();
// This truly makes the document empty. No sections (not possible in Microsoft Word).
doc.removeAllChildren();
// Create a new section node.
// Note that the section has not yet been added to the document,
// but we have to specify the parent document.
Section section = new Section(doc);
// Append the section to the document.
doc.appendChild(section);
// Lets set some properties for the section.
section.getPageSetup().setSectionStart(SectionStart.NEW_PAGE);
section.getPageSetup().setPaperSize(PaperSize.LETTER);
// The section that we created is empty, lets populate it. The section needs at least the Body node.
Body body = new Body(doc);
section.appendChild(body);
// The body needs to have at least one paragraph.
// Note that the paragraph has not yet been added to the document,
// but we have to specify the parent document.
// The parent document is needed
|