赞
踩
随着.NET版Aspose.Words for .Net v20.7的发布,Java版也随之更新,除了一些通用功能外,也独有新改善。
主要特点如下:
>>你可以点击文末“了解更多”下载Aspose.Words for Java v20.7测试体验
///
/// Gets or sets a value indicating whether the 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.
///
///
/// The default value is true.
///
publicboolRetainFirstSectionStart {get;set; }
用例:
Document document = new Document(path);document.MailMerge.RetainFirstSectionStart = false;document.MailMerge.Execute(dataSource);
...
///
/// Module that reads/writes Markdown files.
///
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);}
///
/// Allows to specify the measurement unit for revision comments.
/// Default value for this property is
///
public MeasurementUnits MeasurementUnit
另外,添加了新的公共枚举:
///
/// Specifies a the unit of measurement.
///
public enum MeasurementUnits
{
///
/// Inches.
///
Inches = 0,
///
/// Centimeters.
///
Centimeters = 1,
///
/// Millimeters.
///
Millimeters = 2,
///
/// Points.
///
Points = 3,
///
/// Picas (commonly used in traditional typewriter font spacing).
///
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");
///
/// Gets or sets rendering position of revision bars.
/// Default value is .
///
/// Values of and
/// are not allowed and will cause .
用例:
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
{
///
/// Gets the type of this node.
///
public NodeType NodeType { get ; }
///
/// Gets the level at which this SDT range start occurs in the document tree.
///
public MarkupLevel Level { get ; }
///
/// Gets type of this Structured document tag.
///
public SdtType SdtType { get ; }
///
/// Specifies a unique read-only persistent numerical Id for this SDT.
///
public int Id { get ; }
///
/// When set to true, this property will prohibit a user from deleting this SDT.
///
public bool LockContentControl { get ; }
///
/// When set to true, this property will prohibit a user from editing the contents of this SDT.
///
public bool LockContents { get ; }
///
/// Specifies whether the content of this SDT shall be interpreted to contain placeholder text
/// (as opposed to regular text contents within the SDT).
///
public bool IsShowingPlaceholderText { get ; }
///
/// Specifies a tag associated with the current SDT node.
///
public string Tag { get ; }
///
/// Specifies the friendly name associated with this SDT.
///
public string Title { get ; }
///
/// Specifies end of range if the StructuredDocumentTag is a ranged structured document tag.
///
public StructuredDocumentTagRangeEnd RangeEnd { get ; }
}
public class StructuredDocumentTagRangeEnd : Node
{
///
/// Gets the type of this node.
///
public NodeType NodeType { get ; }
///
/// Specifies a unique read-only persistent numerical Id for this structured document tag node.
/// Corresponding range start node has the same Id.
///
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);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。