<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"
><HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- Generated by javadoc - compatibility string-->
<!-- Generated by Aspose.JavaDoc 08 Apr 2014 -->
<TITLE>Document</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../javaDoc.css" TITLE="Style"></HEAD>
<BODY BGCOLOR="white">
<!-- ======== START OF CLASS DATA ======== -->
<H2><a href="package-summary.html"><FONT SIZE="-1">
com.aspose.words
</FONT></a><BR>Class Document</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="Node.html" title="class in com.aspose.words">Node</A>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="CompositeNode.html" title="class in com.aspose.words">CompositeNode</A>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="DocumentBase.html" title="class in com.aspose.words">DocumentBase</A>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.aspose.words.Document</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.lang.Iterable, java.lang.Cloneable</DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>Document </B><DT>extends <A HREF="DocumentBase.html" title="class in com.aspose.words">DocumentBase</A></DL>
</PRE>
<P>
<summary>
Represents a Word document.
</summary><remarks><p>The <b>Document</b> is a central object in the Aspose.Words library.</p><p>To load an existing document in any of the <cref><A HREF="LoadFormat.html" title="Utility class in com.aspose.words">LoadFormat</A></cref> formats, pass a file name
or a stream into one of the <b>Document</b> constructors. To create a blank document, call the
constructor without parameters.</p><p>Use one of the Save method overloads to save the document in any of the
<cref><A HREF="SaveFormat.html" title="Utility class in com.aspose.words">SaveFormat</A></cref> formats.</p><p>To draw document pages directly onto a <b>Graphics</b> object use
<cref><A HREF="#renderToScale(int,java.awt.Graphics2D,float,float,float)" title="method in class com.aspose.words.Document">renderToScale(int,java.awt.Graphics2D,float,float,float)</A></cref> or <cref><A HREF="#renderToSize(int,java.awt.Graphics2D,float,float,float,float)" title="method in class com.aspose.words.Document">renderToSize(int,java.awt.Graphics2D,float,float,float,float)</A></cref> method.</p><p>To print the document, use one of the <cref><A HREF="#print(java.lang.String)" title="method in class com.aspose.words.Document">print(java.lang.String)</A></cref> methods.</p><p><cref><A HREF="#MailMerge" title="property in class com.aspose.words.Document">MailMerge</A></cref> is the Aspose.Words's reporting engine that allows to populate
reports designed in Microsoft Word with data from various data sources quickly and easily.
The data can be from a java.sql.ResultSet or an array of values.
<b>MailMerge</b> will go through the records found in the data source and insert them into
mail merge fields in the document growing it as necessary.</p><p><b>Document</b> stores document-wide information such as <cref><A HREF="#Styles" title="property in class com.aspose.words.Document">Styles</A></cref>,
<cref><A HREF="#BuiltInDocumentProperties" title="property in class com.aspose.words.Document">BuiltInDocumentProperties</A></cref>, <cref><A HREF="#CustomDocumentProperties" title="property in class com.aspose.words.Document">CustomDocumentProperties</A></cref>, lists and macros.
Most of these objects are accessible via the corresponding properties of the <b>Document</b>.</p><p>The <b>Document</b> is a root node of a tree that contains all other nodes of the document.
The tree is a Composite design pattern and in many ways similar to XmlDocument.
The content of the document can be manipulated freely programmatically:</p><ul><li>The nodes of the document can be accessed via typed collections, for example <cref><A HREF="#Sections" title="property in class com.aspose.words.Document">Sections</A></cref>,
<cref><A HREF="ParagraphCollection.html" title="class in com.aspose.words">ParagraphCollection</A></cref> etc.</li><li>The nodes of the document can be selected by their node type using
<cref><A HREF="#getChildNodes(int,boolean,boolean)" title="method in class com.aspose.words.Document">getChildNodes(int,boolean,boolean)</A></cref>
or using an XPath query with <cref><A HREF="#selectNodes(java.lang.String)" title="method in class com.aspose.words.Document">selectNodes(java.lang.String)</A></cref> or <cref><A HREF="#selectSingleNode(java.lang.String)" title="method in class com.aspose.words.Document">selectSingleNode(java.lang.String)</A></cref>.</li><li>Content nodes can be added or removed from anywhere in the document using
<cref><A HREF="#insertBefore(com.aspose.words.Node,com.aspose.words.Node)" title="method in class com.aspose.words.Document">insertBefore(com.aspose.words.Node,com.aspose.words.Node)</A></cref>, <cref><A HREF="#insertAfter(com.aspose.words.Node,com.aspose.words.Node)" title="method in class com.aspose.words.Document">insertAfter(com.aspose.words.Node,com.aspose.words.Node)</A></cref>,
<cref><A HREF="#removeChild(com.aspose.words.Node)" title="method in class com.aspose.words.Document">removeChild(com.aspose.words.Node)</A></cref> and other
methods provided by the base class <cref><A HREF="CompositeNode.html" title="class in com.aspose.words">CompositeNode</A></cref>.</li><li>The formatting attributes of each node can be changed via the properties of that node.</li></ul><p>Consider using <cref><A HREF="DocumentBuilder.html" title="class in com.aspose.words">DocumentBuilder</A></cref> that simplifies the task of programmatically creating
or populating the document tree.</p><p>The <b>Document</b> can contain only <cref><A HREF="Section.html" title="class in com.aspose.words">Section</A></cref> objects.</p><p>In Microsoft Word, a valid document needs to have at least one section.</p></remarks><example><p><b>Example:</b></p>Converts a whole document from DOC to PDF using default options.<pre>
Document doc = new Document(getMyDir() + "Document.doc");
doc.save(getMyDir() + "Document.Doc2PdfSave Out.pdf");</pre></example><example><p><b>Example:</b></p>Executes mail merge from data stored in a ResultSet.<pre>
Document doc = new Document(getMyDir() + "MailMerge.ExecuteDataTable.doc");
// This example creates a table, but you would normally load table from a database.
java.sql.ResultSet resultSet = createCachedRowSet(new String[] {"CustomerName", "Address"});
addRow(resultSet, new String[] {"Thomas Hardy", "120 Hanover Sq., London"});
addRow(resultSet, new String[] {"Paolo Accorti", "Via Monte Bianco 34, Torino"});
com.aspose.words.DataTable table = new com.aspose.words.DataTable(resultSet, "Test");
// Field values from the table are inserted into the mail merge fields found in the document.
doc.getMailMerge().execute(table);
doc.save(getMyDir() + "MailMerge.ExecuteDataTable Out.doc");</pre></example>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" ><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="#Document()">Document</A></B>()</CODE>
<BR>
Creates a blank Word document.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
aspose-words-java-api (353个子文件)
javaDoc.css 6KB
inherit.gif 57B
Document.html 288KB
Shape.html 227KB
DocumentVisitor.html 200KB
DocumentBuilder.html 197KB
GroupShape.html 197KB
StyleIdentifier.html 193KB
ShapeBase.html 193KB
Table.html 179KB
Paragraph.html 151KB
ShapeType.html 150KB
GlossaryDocument.html 140KB
StructuredDocumentTag.html 139KB
DocumentBase.html 138KB
BuiltInDocumentProperties.html 133KB
Cell.html 132KB
Section.html 131KB
Comment.html 129KB
Body.html 128KB
HeaderFooter.html 124KB
InlineStory.html 123KB
Story.html 121KB
Row.html 121KB
Footnote.html 120KB
BuildingBlock.html 120KB
HtmlSaveOptions.html 115KB
package-summary.html 112KB
CustomXmlMarkup.html 111KB
SmartTag.html 109KB
CompositeNode.html 106KB
OfficeMath.html 102KB
CompatibilityOptions.html 92KB
Font.html 90KB
PageSetup.html 88KB
FormField.html 85KB
FieldType.html 85KB
PdfSaveOptions.html 81KB
SwfSaveOptions.html 79KB
DrawingML.html 77KB
FieldStart.html 68KB
Run.html 64KB
Inline.html 63KB
SpecialChar.html 60KB
FieldEnd.html 60KB
FieldSeparator.html 59KB
Node.html 58KB
ParagraphFormat.html 58KB
FieldChar.html 58KB
MailMerge.html 55KB
Compatibility.html 55KB
AbsolutePositionTab.html 53KB
NumberStyle.html 52KB
CommentRangeStart.html 52KB
ImageSaveOptions.html 52KB
CommentRangeEnd.html 52KB
BookmarkEnd.html 51KB
EditableRangeStart.html 50KB
EditableRangeEnd.html 50KB
BookmarkStart.html 50KB
ListLevel.html 48KB
SubDocument.html 47KB
HtmlFixedSaveOptions.html 45KB
ImageData.html 44KB
allclasses-frame.html 44KB
TextureIndex.html 43KB
NodeType.html 43KB
SvgSaveOptions.html 43KB
XpsSaveOptions.html 39KB
CellFormat.html 39KB
package-frame.html 38KB
ImageFieldMergingArgs.html 38KB
allclasses-noframe.html 37KB
FileFormatUtil.html 36KB
TableStyle.html 36KB
ListFormat.html 35KB
RowFormat.html 34KB
HeaderFooterCollection.html 34KB
MailMergeSettings.html 33KB
XamlFlowSaveOptions.html 32KB
ListCollection.html 32KB
Style.html 32KB
ListTemplate.html 32KB
PsSaveOptions.html 32KB
List.html 32KB
SaveFormat.html 31KB
TxtSaveOptions.html 31KB
IMailMergeDataSource.html 31KB
SwfViewerControlIdentifier.html 31KB
OoxmlSaveOptions.html 30KB
ControlChar.html 30KB
BuildingBlockGallery.html 30KB
CustomDocumentProperties.html 30KB
BorderCollection.html 30KB
TableCollection.html 29KB
NodeCollection.html 29KB
FieldMergingArgs.html 29KB
SectionCollection.html 28KB
DocSaveOptions.html 28KB
PageInfo.html 28KB
共 353 条
- 1
- 2
- 3
- 4
资源评论
信息安全与项目管理
- 粉丝: 88
- 资源: 543
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功