Spire.XLS 12.6.1已发布。本次更新提供接口支持设置是否应用样式到行和列。并且支持转换Excel2016中新的图表类型如瀑布图, 树状图和箱须图到PDF和图片。此外,该版本还增强了Excel到PDF的转换功能,并修复了内容包含回车的页眉,在转换到PDF后,页眉高度不正确等已知问题。详情请阅读以下内容。
新功能:
worksheet.ApplyStyle(style, applyRowStyle, applyColumnStyle)问题修复:
Spire.XLS for Java 12.6.0 已发布。此版本支持在 Excel 转 HTML 时设置是否转出隐藏的工作表。同时,还增加了两个新特性: Excel 转 HTML 后,转出的 HTML 中当前选中的选项卡添加了有对比性的颜色边框以及工作表选项卡文本增加了两侧间距。此外,本次更新还增强了 Excel 到 HTML、 Excel 到 PDF 和 Excel 到图片的转换功能。一些已知问题也得到了修复,如复制工作表时迷你折线图丢失和设置单元格背景色为透明不生效等问题。详情请阅读一下内容。
新功能:
Workbook book=new Workbook();
book.loadFromFile("test.xlsx");
//false --- 转出隐藏的工作表
//true--- 不转出隐藏的工作表
book.saveToHtml("output.html",false);问题修复:
Spire.PDF 8.6.1已发布。该版本支持设置PDFLineAnnotation的作者和主题,支持设置复选框的ForeColor属性,并增强了OPD到PDF的转换功能。此外还修复了打印PDF,域值不正确等已知问题。详情请阅读以下内容。
新功能:
if (annotation is PdfLineAnnotationWidget)
{
PdfLineAnnotationWidget lineAnn = annotation as PdfLineAnnotationWidget;
//PdfLineAnnotation lineAnn = annotation as PdfLineAnnotation;
lineAnn.Author = "Author_test";
lineAnn.Subject = "Subject_test";
}checkboxField.ForeColor = new PdfRGBColor(Color.Red);PdfStringFormat format = new PdfStringFormat();
PdfTrueTypeFont font = new PdfTrueTypeFont(new System.Drawing.Font("Times New Roman", 10));
PdfPen pen = PdfPens.Black;
PdfSolidBrush brush = new PdfSolidBrush(Color.Black);
PdfDocument doc = new PdfDocument("HelloWord.pdf");
PdfLogicalStructure tree = PdfLogicalStructure.CreateLogicalStructure(doc);
PdfStructureElement article = tree.AppendChildElement(PdfStandardStructTypes.Article);
article.Title = "create tagged pdf";
PdfStructureElement paragraph1 = article.AppendChildElement(PdfStandardStructTypes.Paragraph);
paragraph1.Title = "text paragraph1";
int mcid = 0;
paragraph1.BeginMarkedContentSequence(doc.Pages[0].Canvas, "paragraph1", mcid);
doc.Pages[0].Canvas.DrawString("paragraph1: PDF’s logical structure facilities (PDF 1.3) provide a mechanism for " +
"incorporating structural information about a document’s content into a PDF file. Such information might include, " +
"for example, the organization of the document into chapters and sections or the identification of special elements " +
"such as figures, tables, and footnotes. The logical structure facilities are extensible, allowing applications that " +
"produce PDF files to choose what structural information to include and how to represent it, while enabling PDF " +
"consumers to navigate a file without knowing the producer’s structural conventions.",
font, pen, brush, new Rectangle(40, 200, 480, 80), format);
paragraph1.EndMarkedContentSequence(doc.Pages[0].Canvas);
paragraph1.ReferenceContent(doc.Pages[0], mcid);
PdfStructureElement paragraph2 = article.AppendChildElement(PdfStandardStructTypes.Paragraph);
paragraph2.Title = "text paragraph2";
mcid = 1;
paragraph2.BeginMarkedContentSequence(doc.Pages[0].Canvas, "paragraph2", mcid);
doc.Pages[0].Canvas.DrawString("paragraph2: PDF logical structure shares basic features with standard document markup languages" +
" such as HTML, SGML, and XML. A document’s logical structure is expressed as a hierarchy of structure elements, each" +
" represented by a dictionary object. Like their counterparts in other markup languages, PDF structure elements can" +
" have content and attributes. In PDF, rendered document content takes over the role occupied by text in HTML, SGML, and XML.",
font, pen, brush, new Rectangle(40, 280, 480, 60), format);
paragraph2.EndMarkedContentSequence(doc.Pages[0].Canvas);
paragraph2.ReferenceContent(doc.Pages[0], mcid);
doc.SaveToFile("Tagged.pdf");问题修复:
Spire.Barcode 6.6.3已发布。本次更新修复了Spire识别二维码的数据与手机识别的数据不一致的问题以及在二维码中添加长方形图片,变为正方形的问题。详情请阅读以下内容。
问题修复:
https://www.e-iceblue.com/Download/download-barcode-for-net.html
Spire.Doc for Java 10.6.0 已发布。该版本增强了 Word 到 PDF 和 Word 到 HTML 的转换。同时还修复了一些已知问题,如:修复了保存Word文档时多出内容和合并Word文档时程序抛出“This is not a structured storage file.”错误等问题。详情请阅读以下内容。
问题修复:
Spire.Spreadsheet 6.5.0已发布。该版本修复了新增和删除行,结果不正确的问题。详情请阅读以下内容。
问题修复:
https://www.e-iceblue.cn/Downloads/Spire-Spreadsheet-NET.html
Spire.Doc 10.5.9已发布。该版本增强了 Word 到 PDF 及 HTML 到 Docx 的转换功能,此外还修复了在法语区域设置下,Word转PDF抛出"System.FormatException"异常等已知问题。详情请阅读以下内容。
问题修复:
在 Word 中添加强调符号,即着重号,可对重要的文字内容起到加强提醒、突出显示的作用。本文,将使用 Spire.Doc for Java 通过后端 Java 程序来介绍如何给 Word 中的指定字符串添加强调符号。下面是详细方法及步骤。
首先,您需要在 Java 程序中添加 Spire.Doc.jar 文件作为依赖项。JAR 文件可以从此链接下载。如果您使用 Maven,则可以将以下代码添加到项目的 pom.xml 文件中,从而轻松地在应用程序中导入 JAR 文件。
<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>https://repo.e-iceblue.cn/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.doc</artifactId>
<version>13.12.2</version>
</dependency>
</dependencies>
代码步骤如下,可参考该步骤来实现添加强调符号:
import com.spire.doc.Document;
import com.spire.doc.FileFormat;
import com.spire.doc.documents.TextSelection;
import com.spire.doc.fields.shape.Emphasis;
import java.awt.*;
public class EmphasisMark {
public static void main(String[] args) {
//创建Document对象
Document document = new Document();
//加载Word文档
document.loadFromFile("https://cdn.e-iceblue.cn/test.docx");
//查找指定字符串
TextSelection[] textSelections = document.findAllString("Spire.Doc for Java", false, true);
//遍历查找到的所有字符串
for (TextSelection selection : textSelections)
{
//添加强调符号(着重号)到字符串
selection.getAsOneRange().getCharacterFormat().setEmphasisMark(Emphasis.Dot);
//给添加了强调符号的字符设置颜色
selection.getAsOneRange().getCharacterFormat().setTextColor(new Color(0,128,128));
}
//保存文档
document.saveToFile("AddEmphasisMark.docx", FileFormat.Docx_2013);
document.dispose();
}
}
如果您希望删除结果文档中的评估消息,或者摆脱功能限制,请该Email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用JavaScript。获取有效期 30 天的临时许可证。
XML 是一种文本标记语言,主要用于储存和传输任意数据。XML 文件具有简洁、普遍、易用等特点,在网络服务器中尤其受欢迎。 XML 和 HTML 都是文本标记语言,且具有相似性,但两者的应用场景不同, XML 主要用于储存和传输数据,而 HTML 则是用于显示网页内容。本文将展示如何使用 Spire.Doc for .NET 将 Word 文档转换为 XML 文件。
首先,您需要将 Spire.Doc for.NET 包含的 DLL 文件作为引用添加到您的 .NET 项目中。DLL 文件可以从 此链接 下载,也可以通过 NuGet 安装。
PM> Install-Package Spire.Doc详细操作步骤如下:
using System;
using Spire.Doc;
namespace WordtoXML
{
internal class Program
{
static void Main(string[] args)
{
//创建 Document 类的对象
Document document = new Document();
//从磁盘加载 Word 文档
document.LoadFromFile(@"D:\testp\test.docx");
//保存 Word 文档为 XML 文件
document.SaveToFile("Sample.xml", FileFormat.Xml);
}
}
}Imports System
Imports Spire.Doc
Module Program
Sub Main(args As String())
'创建 Document 类的对象
Dim document As New Document()
'从磁盘加载 Word 文档
document.LoadFromFile("https://cdn.e-iceblue.cn/D:\testp\test.docx")
'保存 Word 文档为 XML 文件
document.SaveToFile("Sample.xml", FileFormat.Xml)
End Sub
End Module
如果您希望删除结果文档中的评估消息,或者摆脱功能限制,请该Email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用JavaScript。获取有效期 30 天的临时许可证。
Excel 中可插入表单控件,如文本框、单选按钮、复选框、组合框等等,插入后的控件可执行控件格式,如大小、是否锁定、位置、可选文字、数据源区域、单元格链接等操作。当 Excel 中已插入控件,需要读取时,可以参考本文中使用 Spire.XLS for .NET 来读取的方法。以下是详细方法和步骤。
首先,您需要添加 Spire.XLS for .NET 包中包含的 DLL 文件作为 .NET 项目中的引用。DLL 文件可以从此链接下载或通过 NuGet 安装。
PM> Install-Package Spire.XLS以下是读取控件的方法步骤:
using System;
using Spire.Xls;
using Spire.Xls.Core;
namespace GetFormControl
{
class Program
{
static void Main(string[] args)
{
//创建Workbook类的实例,加载Excel文档
Workbook wb = new Workbook();
wb.LoadFromFile("sample.xlsx");
//获取第1张工作表
Worksheet sheet = wb.Worksheets[0];
//获取TextBox
ITextBox textbox = sheet.TextBoxes[0];
string textcontent = textbox.Text;
Console.WriteLine("TextBox: "+ textcontent);
Console.ReadLine();
//获取Radio Button
for (int i = 0; i < sheet.RadioButtons.Count; i++)
{
IRadioButton radioButton = sheet.RadioButtons[i];
string name = radioButton.CheckState.ToString();
string text = radioButton.Text;
bool islocked = radioButton.IsLocked;
Console.WriteLine("RadioButtons: " + name + text + " 是否锁定:" + islocked.ToString());
Console.ReadLine();
}
//获取Combo Box控件中的选中的值(注:非列表中所有选项值)
string value = sheet.ComboBoxes[0].SelectedValue;
Console.WriteLine("ComboBoxes: " + value);
Console.ReadLine();
//获取Checkbox
for (int z = 0; z < sheet.CheckBoxes.Count; z++)
{
ICheckBox checkBox = sheet.CheckBoxes[z];
string text = checkBox.Text;
string name = checkBox.CheckState.ToString();
string alternativetext = checkBox.AlternativeText;
Console.WriteLine("CheckBoxes: " + text + name + alternativetext);
Console.ReadLine();
}
//获取SpinnerShape
for (int j = 0; j < sheet.SpinnerShapes.Count; j++)
{
ISpinnerShape spinnerShape = sheet.SpinnerShapes[j];
string rangeAddress = spinnerShape.LinkedCell.RangeAddress;
int currentValue = spinnerShape.CurrentValue;
Console.WriteLine("SpinnerShapes: RangeAddress is " + rangeAddress + "\n"+"CurrentValue:" + currentValue);
Console.ReadLine();
}
}
}
}Imports Spire.Xls
Imports Spire.Xls.Core
Namespace GetFormControl
Class Program
Private Shared Sub Main(args As String())
'创建Workbook类的实例,加载Excel文档
Dim wb As New Workbook()
wb.LoadFromFile("sample.xlsx")
'获取第1张工作表
Dim sheet As Worksheet = wb.Worksheets(0)
'获取TextBox
Dim textbox As ITextBox = sheet.TextBoxes(0)
Dim textcontent As String = textbox.Text
Console.WriteLine(Convert.ToString("TextBox: ") & textcontent)
Console.ReadLine()
'获取Radio Button
For i As Integer = 0 To sheet.RadioButtons.Count - 1
Dim radioButton As IRadioButton = sheet.RadioButtons(i)
Dim name As String = radioButton.CheckState.ToString()
Dim text As String = radioButton.Text
Dim islocked As Boolean = radioButton.IsLocked
Console.WriteLine((Convert.ToString(Convert.ToString("RadioButtons: ") & name) & text) + " 是否锁定:" + islocked.ToString())
Console.ReadLine()
Next
'获取Combo Box控件中的选中的值(注:非列表中所有选项值)
Dim value As String = sheet.ComboBoxes(0).SelectedValue
Console.WriteLine(Convert.ToString("ComboBoxes: ") & value)
Console.ReadLine()
'获取Checkbox
For z As Integer = 0 To sheet.CheckBoxes.Count - 1
Dim checkBox As ICheckBox = sheet.CheckBoxes(z)
Dim text As String = checkBox.Text
Dim name As String = checkBox.CheckState.ToString()
Dim alternativetext As String = checkBox.AlternativeText
Console.WriteLine(Convert.ToString(Convert.ToString(Convert.ToString("CheckBoxes: ") & text) & name) & alternativetext)
Console.ReadLine()
Next
'获取SpinnerShape
For j As Integer = 0 To sheet.SpinnerShapes.Count - 1
Dim spinnerShape As ISpinnerShape = sheet.SpinnerShapes(j)
Dim rangeAddress As String = spinnerShape.LinkedCell.RangeAddress
Dim currentValue As Integer = spinnerShape.CurrentValue
Console.WriteLine((Convert.ToString("SpinnerShapes: RangeAddress is ") & rangeAddress) + vbLf + "CurrentValue:" + currentValue)
Console.ReadLine()
Next
End Sub
End Class
End Namespace

如果您希望删除结果文档中的评估消息,或者摆脱功能限制,请该Email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用JavaScript。获取有效期 30 天的临时许可证。