您的位置 首页 > 娱乐休闲

如何使用Aspose.Words for .NET设置语言首选项和删除个人信息?

A For .Net是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。此外,API支持所有流行的Word处理文件格式,并允许将Word文档导出或转换为固定布局文件格式和最常用的图像/多媒体格式。

设置语言首选项


在MS Word中显示文档取决于在该文档的默认值中设置的语言。但是,如果没有语言设置为默认值,该怎么办?在这种情况下,Word从“ 设置Office语言首选项 ”对话框中获取信息,例如,可以在Word 2016中的“文件 - >选项 - >语言”菜单下找到。使用A,您可以设置语言首选项使用LanguagePreferences类。

下面的代码示例显示了如何将日语添加到编辑语言中:

//文档目录的路径。 LoadOptions loadOptions = new LoadOptions(); loadO); Document doc = new Document(dataDir + @ "language; , loadOptions); int localeIdFarEast = doc.S; if (localeIdFarEast == ( int ) Con( "The document either has no any FarEast language set in defaults or it was set to Japanese originally." ); else Con( "The document default FarEast language was set to another than Japanese language originally, so it is not overridden." );

下面的代码示例显示如何将俄语设置为默认编辑语言:

//文档目录的路径。 LoadOptions loadOptions = new LoadOptions(); loadO); Document doc = new Document(dataDir + @ "language; , loadOptions); int localeId = doc.S; if (localeId == ( int ) Con( "The document either has no any language set in defaults or it was set to Russian originally." ); else Con( "The document default language was set to another than Russian language originally, so it is not overridden." );

从文档中删除个人信息


如果要与其他人共享Word文档,可以删除个人信息,例如作者姓名和公司。您可以使用Document.RemovePersonalInformation属性设置标志,指示Microsoft Word将在保存文档时从注释,修订和文档属性中删除所有用户信息。

注意:在A中处理文档时,设置此选项实际上不会删除个人信息,并且仅影响Microsoft Word行为。

Document doc = new Document(dataDir + "Pro; ); doc.RemovePersonalInformation = true ; dataDir = dataDir + "RemovePer; ; doc.Save(dataDir);

ASPOSE技术交流QQ群(642018183)已开通,各类资源及时分享,欢迎交流讨论!(扫描下方二维码加入群聊)

点击下方“了解更多”,免费下载A For .Net

↓↓↓

责任编辑: 鲁达

1.内容基于多重复合算法人工智能语言模型创作,旨在以深度学习研究为目的传播信息知识,内容观点与本网站无关,反馈举报请
2.仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证;
3.本站属于非营利性站点无毒无广告,请读者放心使用!

“word如何安装选择语言工具并进行”边界阅读