二维码
找好货

扫一扫关注

当前位置: 首页 » 资讯 » 跨境电商 » 正文

支持显式设置编码Charset和BOM!Java版Aspose.Words v20.7发布

放大字体  缩小字体 发布日期:2022-07-26 22:30:29    作者:life    浏览次数:2139    评论:0
导读

随着.NET版Aspose.Words for .Net v20.7的发布,Java版也随之更新,除了一些通用功能外,也独有新改善。 主要特点如下: 通过TxtSaveOptions.setEncoding(Charset)显式设置编码Ch

随着.NET版Aspose.Words for .Net v20.7的发布,Java版也随之更新,除了一些通用功能外,也独有新改善。

主要特点如下:

  • 通过TxtSaveOptions.setEncoding(Charset)显式设置编码Charset和BOM。
  • 添加了新节点以处理多节结构化文档标签。
  • 添加了一个新的公共属性MailMerge.RetainFirstSectionStart。
  • RevisionOptions类扩展了新的属性。
  • 改进了SmartArt冷渲染的性能。

>>你可以点击文末“了解更多”下载Aspose.Words for Java v20.7测试体验

具体更新内容
  • WORDSJAVA-2327 通过TxtSaveOptions.setEncoding(Charset)显式设置编码Charset和BOM的用户选项 新功能
  • WORDSJAVA-2416 更新第三方软件版本,许可协议等。 新功能
  • WORDSNET-9500 国际字符(泰米尔语)不能正确地从MHTML转换为PDF 新功能
  • WORDSNET-7150 SDT控件在打开/保存过程中丢失 新功能
  • WORDSNET-9501 国际字符(泰卢固语)未正确从MHTML转换为PDF 新功能
  • WORDSNET-5713 包含分节符的StructureddocumentTag在加载时丢失 新功能
  • WORDSNET-20589 PDF到DOCX-脚注 新功能
  • WORDSNET-20480 提供属性以在邮件合并期间启用“严格MS Word行为合规性” 新功能
  • WORDSNET-9908 通过分节符保留RichText内容控件 新功能
  • WORDSNET-6773 设置AllowBreakAcrossPages = False时截断大于页面大小的行内容 增强功能
  • WORDSNET-20415 通过轨道更改将DOCX转换为PDF时保持修订条 增强功能
  • WORDSNET-18609 一行移至PDF的上一页 增强功能
公共API更改①添加了新的公共属性MailMerge.RetainFirstSectionStart

/// <summary>

/// Gets or sets a value indicating whether the <see cref="PageSetup.SectionStart"/> of the first document section and its copies for subsequent data source rows

/// are retained during mail merge or updated according to MS Word behaviour.

/// </summary>

/// <remarks>

/// The default value is <b>true</b>.

/// </remarks>

publicboolRetainFirstSectionStart {get;set; }

用例:

document document = new document(path); document.MailMerge.RetainFirstSectionStart = false; document.MailMerge.Execute(dataSource);②添加新值到公共枚举WarningSource

...

/// <summary>

/// Module that reads/writes Markdown files.

/// </summary>

Markdown

用例:

document doc = TestUtil.Open("input.docx"); WarningInfoCollection warnings = new WarningInfoCollection(); doc.WarningCallback = warnings; doc.Save("Output.md"); foreach (WarningInfo warningInfo in warnings) { if (warningInfo.Source == WarningSource.Markdown) Console.WriteLine(warningInfo.Description); }③在RevisionOptions中添加了公共属性MeasurementUnit

/// <summary>

/// Allows to specify the measurement unit for revision comments.

/// Default value for this property is <see cref="MeasurementUnits.Centimeters"/>

/// </summary>

public MeasurementUnits MeasurementUnit

另外,添加了新的公共枚举:

/// <summary>

/// Specifies a the unit of measurement.

/// </summary>

public enum MeasurementUnits

{

/// <summary>

/// Inches.

/// </summary>

Inches = 0,

/// <summary>

/// Centimeters.

/// </summary>

Centimeters = 1,

/// <summary>

/// Millimeters.

/// </summary>

Millimeters = 2,

/// <summary>

/// Points.

/// </summary>

Points = 3,

/// <summary>

/// Picas (commonly used in traditional typewriter font spacing).

/// </summary>

Picas = 4

}

用例:

document doc = new document(myDir +"Input.docx"); doc.LayoutOptions.RevisionOptions.MeasurementUnit = MeasurementUnits.Inches; doc.LayoutOptions.RevisionOptions.ShowInBalloons = ShowInBalloons.FormatAndDelete; doc.LayoutOptions.ShowComments = true; doc.Save(myDir +"Output.pdf");④在RevisionOptions中添加了公共属性RevisionBarsPosition

/// <summary>

/// Gets or sets rendering position of revision bars.

/// Default value is <see cref="HorizontalAlignment.Outside"/>.

/// </summary>

/// <remarks>Values of <see cref="HorizontalAlignment.Center"/> and <see cref="HorizontalAlignment.Inside"/>

/// are not allowed and will cause <see cref="ArgumentOutOfRangeException"/>.</remarks>

用例:

document doc = new document(myDir +"Input.docx"); //Renders revision bars on the right side of a page. doc.LayoutOptions.RevisionOptions.RevisionBarsPosition = HorizontalAlignment.Right; doc.Save(myDir +"Output.pdf");⑤添加了两个新节点来处理多节的结构化文档标签

public class StructureddocumentTagRangeStart : Node

{

/// <summary>

/// Gets the type of this node.

/// </summary>

public NodeType NodeType { get ; }

/// <summary>

/// Gets the level at which this <b>SDT range start</b> occurs in the document tree.

/// </summary>

public MarkupLevel Level { get ; }

/// <summary>

/// Gets type of this <b>Structured document tag</b>.

/// </summary>

public SdtType SdtType { get ; }

/// <summary>

/// <para>Specifies a unique read-only persistent numerical Id for this <b>SDT</b>.</para>

/// </summary>

public int Id { get ; }

/// <summary>

/// When set to true, this property will prohibit a user from deleting this <b>SDT</b>.

/// </summary>

public bool LockContentControl { get ; }

/// <summary>

/// When set to true, this property will prohibit a user from editing the contents of this <b>SDT</b>.

/// </summary>

public bool LockContents { get ; }

/// <summary>

/// Specifies whether the content of this <b>SDT</b> shall be interpreted to contain placeholder text

/// (as opposed to regular text contents within the SDT).

/// </summary>

public bool IsShowingPlaceholderText { get ; }

/// <summary>

/// Specifies a tag associated with the current SDT node.

/// </summary>

public string Tag { get ; }

/// <summary>

/// Specifies the friendly name associated with this <b>SDT</b>.

/// </summary>

public string Title { get ; }

/// <summary>

/// Specifies end of range if the StructureddocumentTag is a ranged structured document tag.

/// </summary>

public StructureddocumentTagRangeEnd RangeEnd { get ; }

}

public class StructureddocumentTagRangeEnd : Node

{

/// <summary>

/// Gets the type of this node.

/// </summary>

public NodeType NodeType { get ; }

/// <summary>

/// Specifies a unique read-only persistent numerical Id for this structured document tag node.

/// Corresponding range start node has the same Id.

/// </summary>

public int Id { get ; }

}

用例:

document doc = new document("document containing multi-section SDT"); Listtags = doc.GetChildNodes(NodeType.StructureddocumentTagRangeStart, true).ToList(); foreach(StructureddocumentTagRangeStart tag in tags) Console.WriteLine(tag.Title);

 
关键词: picasa3
(文/life)
打赏
免责声明
• 
本文为life原创作品,作者: life。欢迎转载,转载请注明原文出处:https://www.114618.com/news/88359.html 。本文仅代表作者个人观点,本站未对其内容进行核实,请读者仅做参考,如若文中涉及有违公德、触犯法律的内容,一经发现,立即删除,作者需自行承担相应责任。涉及到版权或其他问题,请及时联系我们。
0相关评论
 

(c)2008-2018 找好货 B2B SYSTEM All Rights Reserved

京ICP备2022008976号-2