spire.doc免费版生成水印文件。一天有限制生成多少份嘛
时间: 2023-09-06 19:04:13 浏览: 68
根据我所了解的信息,Spire.Doc免费版在生成文件时会添加水印。对于免费版,据我所知,生成的文件数量是有限制的,但具体限制数量可能因不同的版本和使用条件而有所不同。
一般来说,免费版可能会设置每天生成文件的数量限制,以鼓励用户购买付费版本以解除限制。限制的具体数量可能取决于软件开发商的决策,可能是每天生成50份、100份或者其他数字。
如果您需要大量生成文件而不想受到限制,您可能需要考虑购买Spire.Doc付费版或升级到更高级别的许可证。付费版本通常会解除生成文件数量的限制,并提供更多的功能和更好的支持。
请注意,以上信息可能会随着软件版本的更新而有所变动,建议您查看软件官方网站或联系软件厂商获取最新的限制信息。
相关问题
java 使用免费版spire.doc.free:5.2.0生成doc文件中1~3级目录
使用 Spire.Doc.Free:5.2.0 生成 Word 文档中的目录,可以按照以下步骤进行操作:
1. 安装 Spire.Doc.Free:5.2.0
在 Java 项目中使用 Spire.Doc.Free:5.2.0,需要先将其安装到项目中。可以在 Spire.Doc.Free 官网下载相应的 jar 包,然后将其引入到项目中。
2. 创建 Word 文档
在 Java 代码中,可以使用 Spire.Doc.Free 的 API 创建 Word 文档。例如:
```
Document document = new Document();
Section section = document.addSection();
Paragraph para = section.addParagraph();
para.setText("This is the content of the document.");
```
这段代码创建了一个新的 Word 文档,并在其中添加了一段文本。
3. 添加目录
使用 Spire.Doc.Free,可以通过以下代码向 Word 文档中添加目录:
```
document.addSection();
Paragraph tableOfContents = section.addParagraph();
tableOfContents.appendTOC(3);
```
这段代码创建了一个新的章节,并在其中添加了一个段落。`appendTOC(3)` 方法用于向段落中添加目录,其中参数 3 表示目录级别为 1 到 3 级。
4. 保存 Word 文档
最后,可以使用以下代码将 Word 文档保存到本地文件系统中:
```
document.saveToFile("output.docx", FileFormat.Docx_2013);
```
这段代码将文档保存为 output.docx 文件,使用 Docx_2013 格式。
java 使用免费版spire.doc.free:5.2.0生成doc文件中1~3级目录 完整代码
以下是使用Spire.Doc.Free生成doc文件并添加1~3级目录的Java代码示例:
```java
import com.spire.doc.*;
import com.spire.doc.documents.*;
import com.spire.doc.fields.*;
public class GenerateDocWithTOC {
public static void main(String[] args) {
// 创建一个新的Word文档
Document doc = new Document();
// 添加标题
Paragraph title = doc.addSection().addParagraph();
TextRange titleText = title.appendText("这是一个示例文档");
titleText.getCharacterFormat().setBold(true);
titleText.getCharacterFormat().setTextSize(18f);
titleText.getCharacterFormat().setTextColor(Color.BLUE);
title.getFormat().setHorizontalAlignment(HorizontalAlignment.Center);
// 添加正文内容
Section section = doc.addSection();
Paragraph para1 = section.addParagraph();
TextRange text1 = para1.appendText("这是第一段落");
Paragraph para2 = section.addParagraph();
TextRange text2 = para2.appendText("这是第二段落");
Paragraph para3 = section.addParagraph();
TextRange text3 = para3.appendText("这是第三段落");
// 添加目录
Paragraph tocTitle = doc.addParagraph();
TextRange tocTitleText = tocTitle.appendText("目录");
tocTitleText.getCharacterFormat().setBold(true);
tocTitleText.getCharacterFormat().setTextSize(14f);
tocTitleText.getCharacterFormat().setTextColor(Color.BLACK);
// 设置目录样式
doc.getStyles().get("Normal").getParagraphFormat().setStyleName("TOC 1");
doc.getStyles().get("Heading 1").getParagraphFormat().setStyleName("TOC 2");
doc.getStyles().get("Heading 2").getParagraphFormat().setStyleName("TOC 3");
// 添加目录域
Paragraph toc = doc.addParagraph();
Field tocField = toc.appendField("TOC", FieldType.Field_Toc);
TocFieldSettings tocSettings = new TocFieldSettings();
tocSettings.setIncludePageNumbers(true);
tocSettings.setLowerHeadingLevel(1);
tocSettings.setUpperHeadingLevel(3);
tocField.setFieldSettings(tocSettings);
// 保存文档
doc.saveToFile("GenerateDocWithTOC.docx", FileFormat.Docx);
}
}
```
这个示例代码将会创建一个包含标题、正文内容和目录的Word文档,并将1~3级标题自动添加到目录中。你可以根据需要自定义样式和设置。注意,Spire.Doc.Free只支持doc和docx格式,因此在保存文档时需要指定文件格式。