简体   繁体   English

使用 GemBox 文档激活自动断字

[英]Activate automatic hyphenation with GemBox Document

How can one activate the automatic hyphenation for created word documents?如何为创建的word文档激活自动断字?
In word, the option is under Layout->Hyphenation (Group "Page Setup"), however I was not able to find this setting in the document model.在 Word 中,该选项位于Layout->Hyphenation (组“页面设置”)下,但是我无法在文档模型中找到此设置。

EDIT (2020-05-22)编辑 (2020-05-22)

In the current latest version (GemBox.Document 3.1), there is API support for AutoHyphenation .在当前的最新版本 (GemBox.Document 3.1) 中,有对AutoHyphenation 的API 支持。
For example, try using this:例如,尝试使用这个:

var document = DocumentModel.Load("Input.docx");
document.HyphenationOptions.AutoHyphenation = true;

ORIGINAL原来的

In the current version (GemBox.Document 2.5) this is not supported through an API, it's supported only through preservation.在当前版本 (GemBox.Document 2.5) 中,API 不支持此功能,只能通过保留来支持。

In other words, when loading a DOCX file, which has this option enabled, into a DocumentModel and then saving that DocumentModel into a DOCX file, the resulting output DOCX file will have that option enabled as well.换句话说,当将启用了此选项的 DOCX 文件加载到 DocumentModel 中,然后将该 DocumentModel 保存到 DOCX 文件中时,生成的输出 DOCX 文件也将启用该选项。 But when changing the output file's format into something other than the input format (for example to PDF, XPS, HTML, etc.) then the preserved information is lost.但是,当将输出文件的格式更改为输入格式以外的其他格式时(例如更改为 PDF、XPS、HTML 等),保留的信息就会丢失。

Last as a feedback reference can you specify exactly for what output file format do you require this?最后作为反馈参考,您能否准确指定您需要什么输出文件格式?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM