Spire.Office 7.1已发布。本次更新带来了一些新的功能,例如:Spire.Presentation支持创建“箱形图”图表,“漏斗图”图表,“直方图”图表,“排列图”图表,“旭日图”图表,“树状图”图表以及“瀑布图”图表;Spire.XLS支持为单元格设置Html字符串、为现有数据透视表添加条件格式,还支持向IsPasswordProtected()添加文件流、获取 IPrstGeomShape 的链接单元名称,并且还支持计算单个工作表或单元格范围;Spire.Doc增强了Word到PDF以及HTML到Word的转换功能。此外,该版本还修复了大量已知的问题。详情请阅读以下内容。
该版本涵盖了最新版的 Spire.Doc, Spire.PDF, Spire.XLS, Spire.Presentation, Spire.Email, Spire.DocViewer, Spire.PDFViewer, Spire.Spreadsheet, Spire.OfficeViewer, Spire.DataExport, Spire.Barcode。
版本信息如下:
https://www.e-iceblue.cn/Downloads/Spire-Office-NET.html
新功能:
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.BoxAndWhisker, new RectangleF(50, 50, 500, 400), false);
string[] seriesLabel = { "Series 1", "Series 2", "Series 3" };
for (int i = 0; i < seriesLabel.Length; i++)
{
chart.ChartData[0, i + 1].Text = "Series 1";
}
string[] categories = {"Category 1", "Category 1", "Category 1", "Category 1", "Category 1", "Category 1", "Category 1",
"Category 2", "Category 2", "Category 2", "Category 2", "Category 2", "Category 2",
"Category 3", "Category 3", "Category 3", "Category 3", "Category 3"};
for (int i = 0; i < categories.Length; i++)
{
chart.ChartData[i + 1, 0].Text = categories[i];
}
double[,] values = new double[18, 3]{{-7,-3,-24},{-10,1,11},{-28,-6,34},{47,2,-21},{35,17,22},{-22,15,19},{17,-11,25},
{-30,18,25},{49,22,56},{37,22,15},{-55,25,31},{14,18,22},{18,-22,36},{-45,25,-17},
{-33,18,22},{18,2,-23},{-33,-22,10},{10,19,22}};
for (int i = 0; i < seriesLabel.Length; i++)
{
for (int j = 0; j < categories.Length; j++)
{
chart.ChartData[j + 1, i + 1].NumberValue = values[j, i];
}
}
chart.Series.SeriesLabel = chart.ChartData[0, 1, 0, seriesLabel.Length];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, categories.Length, 0];
chart.Series[0].Values = chart.ChartData[1, 1, categories.Length, 1];
chart.Series[1].Values = chart.ChartData[1, 2, categories.Length, 2];
chart.Series[2].Values = chart.ChartData[1, 3, categories.Length, 3];
chart.Series[0].ShowInnerPoints = false;
chart.Series[0].ShowOutlierPoints = true;
chart.Series[0].ShowMeanMarkers = true;
chart.Series[0].ShowMeanLine = true;
chart.Series[0].QuartileCalculationType = QuartileCalculation.ExclusiveMedian;
chart.Series[1].ShowInnerPoints = false;
chart.Series[1].ShowOutlierPoints = true;
chart.Series[1].ShowMeanMarkers = true;
chart.Series[1].ShowMeanLine = true;
chart.Series[1].QuartileCalculationType = QuartileCalculation.InclusiveMedian;
chart.Series[2].ShowInnerPoints = false;
chart.Series[2].ShowOutlierPoints = true;
chart.Series[2].ShowMeanMarkers = true;
chart.Series[2].ShowMeanLine = true;
chart.Series[2].QuartileCalculationType = QuartileCalculation.ExclusiveMedian;
chart.HasLegend = true;
chart.ChartTitle.TextProperties.Text = "BoxAndWhisker";
chart.ChartLegend.Position = ChartLegendPositionType.Top;
ppt.SaveToFile(outputFile, FileFormat.Pptx2013);
ppt.Dispose();
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.Funnel, new RectangleF(50, 50, 550, 400), false);
chart.ChartData[0, 1].Text = "Series 1";
string[] categories = { "Website Visits ", "Download", "Uploads", "Requested price", "Invoice sent", "Finalized" };
for (int i = 0; i < categories.Length; i++)
{
chart.ChartData[i + 1, 0].Text = categories[i];
}
double[] values = { 50000, 47000, 30000, 15000, 9000, 5600 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 1].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 1, 0, 1];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, categories.Length, 0];
chart.Series[0].Values = chart.ChartData[1, 1, values.Length, 1];
chart.ChartTitle.TextProperties.Text = "Funnel";
ppt.SaveToFile(outputFile, FileFormat.PPT);
ppt.Dispose();
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.Histogram, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 0].Text = "Series 1";
double[] values = { 1, 1, 1, 3, 3, 3, 3, 5, 5, 5, 8, 8, 8, 9, 9, 9, 12, 12, 13, 13, 17, 17, 17, 19, 19, 19, 25, 25, 25, 25, 25, 25, 25, 25, 29, 29, 29, 29, 32, 32, 33, 33, 35, 35, 41, 41, 44, 45, 49, 49 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 1].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 0, 0, 0];
chart.Series[0].Values = chart.ChartData[1, 0, values.Length, 0];
chart.PrimaryCategoryAxis.NumberOfBins = 7;
chart.PrimaryCategoryAxis.GapWidth = 20;
chart.ChartTitle.TextProperties.Text = "Histogram";
chart.ChartLegend.Position = ChartLegendPositionType.Bottom;
ppt.SaveToFile(outputFile, FileFormat.PPT);
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.Pareto, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 1].Text = "Series 1";
string[] categories = { "Category 1", "Category 2", "Category 4", "Category 3", "Category 4", "Category 2", "Category 1",
"Category 1", "Category 3", "Category 2", "Category 4", "Category 2", "Category 3",
"Category 1", "Category 3", "Category 2", "Category 4", "Category 1", "Category 1",
"Category 3", "Category 2", "Category 4", "Category 1", "Category 1", "Category 3",
"Category 2", "Category 4", "Category 1"};
for (int i = 0; i < categories.Length; i++)
{
chart.ChartData[i + 1, 0].Text = categories[i];
}
double[] values = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 1].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 1, 0, 1];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, categories.Length, 0];
chart.Series[0].Values = chart.ChartData[1, 1, values.Length, 1];
chart.PrimaryCategoryAxis.IsBinningByCategory = true;
chart.Series[1].Line.FillFormat.FillType = FillFormatType.Solid;
chart.Series[1].Line.FillFormat.SolidFillColor.Color = Color.Red;
chart.ChartTitle.TextProperties.Text = "Pareto";
chart.HasLegend = true;
chart.ChartLegend.Position = ChartLegendPositionType.Bottom;
ppt.SaveToFile(outputFile, FileFormat.PPT);
ppt.Dispose();
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.SunBurst, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 3].Text = "Series 1";
string[,] categories = {{"Branch 1","Stem 1","Leaf 1"},{"Branch 1","Stem 1","Leaf 2"},{"Branch 1","Stem 1", "Leaf 3"},
{"Branch 1","Stem 2","Leaf 4"},{"Branch 1","Stem 2","Leaf 5"},{"Branch 1","Leaf 6",null},{"Branch 1","Leaf 7", null},
{"Branch 2","Stem 3","Leaf 8"},{"Branch 2","Leaf 9",null},{"Branch 2","Stem 4","Leaf 10"},{"Branch 2","Stem 4","Leaf 11"},
{"Branch 2","Stem 5","Leaf 12"},{"Branch 3","Stem 5","Leaf 13"},{"Branch 3","Stem 6","Leaf 14"},{"Branch 3","Leaf 15",null}};
for (int i = 0; i < 15; i++)
{
for (int j = 0; j < 3; j++)
chart.ChartData[i + 1, j].Value = categories[i, j];
}
double[] values = { 17, 23, 48, 22, 76, 54, 77, 26, 44, 63, 10, 15, 48, 15, 51 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 3].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 3, 0, 3];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, values.Length, 2];
chart.Series[0].Values = chart.ChartData[1, 3, values.Length, 3];
chart.Series[0].DataLabels.CategoryNameVisible = true;
chart.ChartTitle.TextProperties.Text = "SunBurst";
chart.HasLegend = true;
chart.ChartLegend.Position = ChartLegendPositionType.Top;
ppt.SaveToFile(outputFile, FileFormat.PPT);
ppt.Dispose();
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.TreeMap, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 3].Text = "Series 1";
string[,] categories = {{"Branch 1","Stem 1","Leaf 1"},{"Branch 1","Stem 1","Leaf 2"},{"Branch 1","Stem 1", "Leaf 3"},
{"Branch 1","Stem 2","Leaf 4"},{"Branch 1","Stem 2","Leaf 5"},{"Branch 1","Stem 2","Leaf 6"},{"Branch 1","Stem 2","Leaf 7"},
{"Branch 2","Stem 3","Leaf 8"},{"Branch 2","Stem 3","Leaf 9"},{"Branch 2","Stem 4","Leaf 10"},{"Branch 2","Stem 4","Leaf 11"},
{"Branch 2","Stem 5","Leaf 12"},{"Branch 3","Stem 5","Leaf 13"},{"Branch 3","Stem 6","Leaf 14"},{"Branch 3","Stem 6","Leaf 15"}};
for (int i = 0; i < 15; i++)
{
for (int j = 0; j < 3; j++)
chart.ChartData[i + 1, j].Text = categories[i, j];
}
double[] values = { 17, 23, 48, 22, 76, 54, 77, 26, 44, 63, 10, 15, 48, 15, 51 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 3].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 3, 0, 3];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, values.Length, 2];
chart.Series[0].Values = chart.ChartData[1, 3, values.Length, 3];
chart.Series[0].DataLabels.CategoryNameVisible = true;
chart.Series[0].TreeMapLabelOption = TreeMapLabelOption.Banner;
chart.ChartTitle.TextProperties.Text = "TreeMap";
chart.HasLegend = true;
chart.ChartLegend.Position = ChartLegendPositionType.Top;
ppt.SaveToFile(outputFile, FileFormat.PPT);
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.WaterFall, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 1].Text = "Series 1";
string[] categories = { "Category 1", "Category 2", "Category 3", "Category 4", "Category 5", "Category 6", "Category 7" };
for (int i = 0; i < categories.Length; i++)
{
chart.ChartData[i + 1, 0].Text = categories[i];
}
double[] values = { 100, 20, 50, -40, 130, -60, 70 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 1].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 1, 0, 1];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, categories.Length, 0];
chart.Series[0].Values = chart.ChartData[1, 1, values.Length, 1];
ChartDataPoint chartDataPoint = new ChartDataPoint(chart.Series[0]);
chartDataPoint.Index = 2;
chartDataPoint.SetAsTotal = true;
chart.Series[0].DataPoints.Add(chartDataPoint);
ChartDataPoint chartDataPoint2 = new ChartDataPoint(chart.Series[0]);
chartDataPoint2.Index = 5;
chartDataPoint2.SetAsTotal = true;
chart.Series[0].DataPoints.Add(chartDataPoint2);
chart.Series[0].ShowConnectorLines = true;
chart.Series[0].DataLabels.LabelValueVisible = true;
chart.ChartLegend.Position = ChartLegendPositionType.Right;
chart.ChartTitle.TextProperties.Text = "WaterFall";
ppt.SaveToFile(outputFile, FileFormat.PPT);
ppt.Dispose();
问题修复:
新功能:
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"input.xlsx");
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].HtmlString = "<div>xxxx<br>yyyy</div>";
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"input.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
PivotTable table = worksheet.PivotTables[0] as PivotTable;
PivotConditionalFormatCollection pcfs = table.PivotConditionalFormats;
PivotConditionalFormat pc = pcfs.AddPivotConditionalFormat();
IConditionalFormat cf = pc.AddCondition();
cf.FormatType = ConditionalFormatType.ContainsBlanks;
cf.FillPattern = ExcelPatternType.Solid;
cf.BackColor = Color.Red;
bool havepwd = Workbook.IsPasswordProtected(File.OpenRead(inputFile));
var docBytes = File.ReadAllBytes(inputFile);
MemoryStream ms = new MemoryStream(docBytes);
bool havepwd = Workbook.IsPasswordProtected(ms);
Workbook book = new Workbook();
book.LoadFromFile("input.xlsx");
Worksheet sheet = book.Worksheets["sheet1"];
PrstGeomShapeCollection prstGeomShapeCollection = sheet.PrstGeomShapes;
IPrstGeomShape shape = prstGeomShapeCollection["a"];
shape.LinkedCell.RangeAddressLocal;
Workbook workbook = new Workbook();
workbook.LoadFromFile("input.xlsx");
workbook.Worksheets[0].CalculateAllValue();
workbook.Worksheets[0].Range["A1:C3"].CalculateAllValue();
问题修复:
问题修复:
Spire.Doc 10.1已发布。该版本增强了Word到PDF以及HTML到Word的转换功能,并且修复了合并Word文档后,生成文档中的公式变形等已知问题。详情请阅读以下内容。
问题修复:
Spire.XLS 12.1已发布。该版本支持为单元格设置Html字符串、为现有数据透视表添加条件格式,还支持向IsPasswordProtected()添加文件流、获取 IPrstGeomShape 的链接单元名称,并且还支持计算单个工作表或单元格范围。此外还增强了Excel到PDF,Excel到HTML,Excel到ODF以及HTML到Excel的转换功能,并且修复了图表保存到图片后内容不正确等已知问题。详情请阅读以下内容。
新功能:
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"input.xlsx");
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].HtmlString = "<div>xxxx<br>yyyy</div>";
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"input.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
PivotTable table = worksheet.PivotTables[0] as PivotTable;
PivotConditionalFormatCollection pcfs = table.PivotConditionalFormats;
PivotConditionalFormat pc = pcfs.AddPivotConditionalFormat();
IConditionalFormat cf = pc.AddCondition();
cf.FormatType = ConditionalFormatType.ContainsBlanks;
cf.FillPattern = ExcelPatternType.Solid;
cf.BackColor = Color.Red;
bool havepwd = Workbook.IsPasswordProtected(File.OpenRead(inputFile));
var docBytes = File.ReadAllBytes(inputFile);
MemoryStream ms = new MemoryStream(docBytes);
bool havepwd = Workbook.IsPasswordProtected(ms);
Workbook book = new Workbook();
book.LoadFromFile("input.xlsx");
Worksheet sheet = book.Worksheets["sheet1"];
PrstGeomShapeCollection prstGeomShapeCollection = sheet.PrstGeomShapes;
IPrstGeomShape shape = prstGeomShapeCollection["a"];
shape.LinkedCell.RangeAddressLocal;
Workbook workbook = new Workbook();
workbook.LoadFromFile("input.xlsx");
workbook.Worksheets[0].CalculateAllValue();
workbook.Worksheets[0].Range["A1:C3"].CalculateAllValue();
问题修复:
Spire.Office for Java 5.1.5已发布。该版本带来了一些新功能,比如:Spire.Doc for Java支持为段落设置"允许拉丁文本在单词中间换行";Spire.Presentation for Java支持将PPT文件转换为OFD以及支持获取PPT文件中图片的路径;Spire.PDF for Java支持指定打印机打印以及支持获取PDF文件PieceInfo信息。并且Spire.XLS for Java增强了Excel到PDF/HTML/图片,以及HTML到Excel的转换功能。此外还修复了其它一些已知问题,详情请阅读以下内容。
获取Spire.Office for Java 5.1.5请点击:https://www.e-iceblue.cn/Downloads/Spire-Office-JAVA.html
新功能:
Paragraph pa = document.getSections().get(0).getParagraphs().get(0);
pa.getFormat().setWordWrap(false);
pa.getFormat().getWordWrap();
问题修复:
新功能:
Presentation ppt = new Presentation();
ppt.loadFromFile(inputFile);
//将PPT文档保存为OFD格式
ppt.saveToFile(outputFile, FileFormat.OFD);
ppt.dispose();
ImageCollection images = ppt.getImages();
for (int i = 0; i < images.size(); i++)
{
IImageData imageData = images.get(i);
String path = imageData.getRelativePath();
}
问题修复:
新功能:
//指定打印机名称进行打印:
PrintSettings setting = pdf.getPrintSettings(); setting.setPrinter("Adobe PDF");
//获取系统默认打印机
PrinterJob loPrinterJob = PrinterJob.getPrinterJob();
PrintService printer = loPrinterJob.getPrintService();
String PrinterName = printer.getName();
//设置打印机为当前打印机
loPrinterJob.setPrintService(printer);
PdfDocument pdf = new PdfDocument();
pdf.loadFromFile(inputFile);
StringBuilder sb = new StringBuilder();
PdfPieceInfo info = pdf.getDocumentPieceInfo();
ArrayList<Object> values = new ArrayList<Object>();
HashMap<String, PdfApplicationData> dic = info.getApplicationDatas();
for (Map.Entry<String, PdfApplicationData> item : dic.entrySet())
{
PdfApplicationData data = item.getValue();
values.add(data.getPrivate());
String content = data.getPrivate().toString();
}
PdfPageBase page = pdf.getPages().get(0);
PdfPieceInfo infor2 = page.getPagePieceInfo();
HashMap<String, PdfApplicationData> dic2 = infor2.getApplicationDatas();
for (Map.Entry<String, PdfApplicationData> item2 : dic2.entrySet())
{
PdfApplicationData data2 = item2.getValue();
if (data2.getPrivate() instanceof String) {
String content = data2.getPrivate().toString();
}
}
问题修复:
问题修复:
Spire.Presentation for Java 5.1.7已发布。该版本修复了将形状保存到图像时程序抛出“Error reading WMF metafile”异常等已知问题。详情请阅读以下内容。
问题修复:
https://www.e-iceblue.cn/Downloads/Spire-Presentation-JAVA.html
Spire.Barcode 6.1已发布。该版本修复了“generatePublisherEvidence”设置为“false”时许可验证受到影响的问题。详情请阅读以下内容。
问题修复:
https://www.e-iceblue.com/Download/download-barcode-for-net.html
Spire.Presentation 7.1已发布。该版本支持创建“箱形图”图表,“漏斗图”图表,“直方图”图表,“排列图”图表,“旭日图”图表,“树状图”图表以及“瀑布图”图表,并且还增强了从PPT到PDF的转换功能。此外还修复了保存形状到图片后内容不正确等已知问题。详情请阅读以下内容。
新功能:
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.BoxAndWhisker, new RectangleF(50, 50, 500, 400), false);
string[] seriesLabel = { "Series 1", "Series 2", "Series 3" };
for (int i = 0; i < seriesLabel.Length; i++)
{
chart.ChartData[0, i + 1].Text = "Series 1";
}
string[] categories = {"Category 1", "Category 1", "Category 1", "Category 1", "Category 1", "Category 1", "Category 1",
"Category 2", "Category 2", "Category 2", "Category 2", "Category 2", "Category 2",
"Category 3", "Category 3", "Category 3", "Category 3", "Category 3"};
for (int i = 0; i < categories.Length; i++)
{
chart.ChartData[i + 1, 0].Text = categories[i];
}
double[,] values = new double[18, 3]{{-7,-3,-24},{-10,1,11},{-28,-6,34},{47,2,-21},{35,17,22},{-22,15,19},{17,-11,25},
{-30,18,25},{49,22,56},{37,22,15},{-55,25,31},{14,18,22},{18,-22,36},{-45,25,-17},
{-33,18,22},{18,2,-23},{-33,-22,10},{10,19,22}};
for (int i = 0; i < seriesLabel.Length; i++)
{
for (int j = 0; j < categories.Length; j++)
{
chart.ChartData[j + 1, i + 1].NumberValue = values[j, i];
}
}
chart.Series.SeriesLabel = chart.ChartData[0, 1, 0, seriesLabel.Length];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, categories.Length, 0];
chart.Series[0].Values = chart.ChartData[1, 1, categories.Length, 1];
chart.Series[1].Values = chart.ChartData[1, 2, categories.Length, 2];
chart.Series[2].Values = chart.ChartData[1, 3, categories.Length, 3];
chart.Series[0].ShowInnerPoints = false;
chart.Series[0].ShowOutlierPoints = true;
chart.Series[0].ShowMeanMarkers = true;
chart.Series[0].ShowMeanLine = true;
chart.Series[0].QuartileCalculationType = QuartileCalculation.ExclusiveMedian;
chart.Series[1].ShowInnerPoints = false;
chart.Series[1].ShowOutlierPoints = true;
chart.Series[1].ShowMeanMarkers = true;
chart.Series[1].ShowMeanLine = true;
chart.Series[1].QuartileCalculationType = QuartileCalculation.InclusiveMedian;
chart.Series[2].ShowInnerPoints = false;
chart.Series[2].ShowOutlierPoints = true;
chart.Series[2].ShowMeanMarkers = true;
chart.Series[2].ShowMeanLine = true;
chart.Series[2].QuartileCalculationType = QuartileCalculation.ExclusiveMedian;
chart.HasLegend = true;
chart.ChartTitle.TextProperties.Text = "BoxAndWhisker";
chart.ChartLegend.Position = ChartLegendPositionType.Top;
ppt.SaveToFile(outputFile, FileFormat.Pptx2013);
ppt.Dispose();
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.Funnel, new RectangleF(50, 50, 550, 400), false);
chart.ChartData[0, 1].Text = "Series 1";
string[] categories = { "Website Visits ", "Download", "Uploads", "Requested price", "Invoice sent", "Finalized" };
for (int i = 0; i < categories.Length; i++)
{
chart.ChartData[i + 1, 0].Text = categories[i];
}
double[] values = { 50000, 47000, 30000, 15000, 9000, 5600 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 1].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 1, 0, 1];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, categories.Length, 0];
chart.Series[0].Values = chart.ChartData[1, 1, values.Length, 1];
chart.ChartTitle.TextProperties.Text = "Funnel";
ppt.SaveToFile(outputFile, FileFormat.PPT);
ppt.Dispose();
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.Histogram, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 0].Text = "Series 1";
double[] values = { 1, 1, 1, 3, 3, 3, 3, 5, 5, 5, 8, 8, 8, 9, 9, 9, 12, 12, 13, 13, 17, 17, 17, 19, 19, 19, 25, 25, 25, 25, 25, 25, 25, 25, 29, 29, 29, 29, 32, 32, 33, 33, 35, 35, 41, 41, 44, 45, 49, 49 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 1].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 0, 0, 0];
chart.Series[0].Values = chart.ChartData[1, 0, values.Length, 0];
chart.PrimaryCategoryAxis.NumberOfBins = 7;
chart.PrimaryCategoryAxis.GapWidth = 20;
chart.ChartTitle.TextProperties.Text = "Histogram";
chart.ChartLegend.Position = ChartLegendPositionType.Bottom;
ppt.SaveToFile(outputFile, FileFormat.PPT);
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.Pareto, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 1].Text = "Series 1";
string[] categories = { "Category 1", "Category 2", "Category 4", "Category 3", "Category 4", "Category 2", "Category 1",
"Category 1", "Category 3", "Category 2", "Category 4", "Category 2", "Category 3",
"Category 1", "Category 3", "Category 2", "Category 4", "Category 1", "Category 1",
"Category 3", "Category 2", "Category 4", "Category 1", "Category 1", "Category 3",
"Category 2", "Category 4", "Category 1"};
for (int i = 0; i < categories.Length; i++)
{
chart.ChartData[i + 1, 0].Text = categories[i];
}
double[] values = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 1].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 1, 0, 1];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, categories.Length, 0];
chart.Series[0].Values = chart.ChartData[1, 1, values.Length, 1];
chart.PrimaryCategoryAxis.IsBinningByCategory = true;
chart.Series[1].Line.FillFormat.FillType = FillFormatType.Solid;
chart.Series[1].Line.FillFormat.SolidFillColor.Color = Color.Red;
chart.ChartTitle.TextProperties.Text = "Pareto";
chart.HasLegend = true;
chart.ChartLegend.Position = ChartLegendPositionType.Bottom;
ppt.SaveToFile(outputFile, FileFormat.PPT);
ppt.Dispose();
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.SunBurst, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 3].Text = "Series 1";
string[,] categories = {{"Branch 1","Stem 1","Leaf 1"},{"Branch 1","Stem 1","Leaf 2"},{"Branch 1","Stem 1", "Leaf 3"},
{"Branch 1","Stem 2","Leaf 4"},{"Branch 1","Stem 2","Leaf 5"},{"Branch 1","Leaf 6",null},{"Branch 1","Leaf 7", null},
{"Branch 2","Stem 3","Leaf 8"},{"Branch 2","Leaf 9",null},{"Branch 2","Stem 4","Leaf 10"},{"Branch 2","Stem 4","Leaf 11"},
{"Branch 2","Stem 5","Leaf 12"},{"Branch 3","Stem 5","Leaf 13"},{"Branch 3","Stem 6","Leaf 14"},{"Branch 3","Leaf 15",null}};
for (int i = 0; i < 15; i++)
{
for (int j = 0; j < 3; j++)
chart.ChartData[i + 1, j].Value = categories[i, j];
}
double[] values = { 17, 23, 48, 22, 76, 54, 77, 26, 44, 63, 10, 15, 48, 15, 51 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 3].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 3, 0, 3];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, values.Length, 2];
chart.Series[0].Values = chart.ChartData[1, 3, values.Length, 3];
chart.Series[0].DataLabels.CategoryNameVisible = true;
chart.ChartTitle.TextProperties.Text = "SunBurst";
chart.HasLegend = true;
chart.ChartLegend.Position = ChartLegendPositionType.Top;
ppt.SaveToFile(outputFile, FileFormat.PPT);
ppt.Dispose();
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.TreeMap, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 3].Text = "Series 1";
string[,] categories = {{"Branch 1","Stem 1","Leaf 1"},{"Branch 1","Stem 1","Leaf 2"},{"Branch 1","Stem 1", "Leaf 3"},
{"Branch 1","Stem 2","Leaf 4"},{"Branch 1","Stem 2","Leaf 5"},{"Branch 1","Stem 2","Leaf 6"},{"Branch 1","Stem 2","Leaf 7"},
{"Branch 2","Stem 3","Leaf 8"},{"Branch 2","Stem 3","Leaf 9"},{"Branch 2","Stem 4","Leaf 10"},{"Branch 2","Stem 4","Leaf 11"},
{"Branch 2","Stem 5","Leaf 12"},{"Branch 3","Stem 5","Leaf 13"},{"Branch 3","Stem 6","Leaf 14"},{"Branch 3","Stem 6","Leaf 15"}};
for (int i = 0; i < 15; i++)
{
for (int j = 0; j < 3; j++)
chart.ChartData[i + 1, j].Text = categories[i, j];
}
double[] values = { 17, 23, 48, 22, 76, 54, 77, 26, 44, 63, 10, 15, 48, 15, 51 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 3].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 3, 0, 3];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, values.Length, 2];
chart.Series[0].Values = chart.ChartData[1, 3, values.Length, 3];
chart.Series[0].DataLabels.CategoryNameVisible = true;
chart.Series[0].TreeMapLabelOption = TreeMapLabelOption.Banner;
chart.ChartTitle.TextProperties.Text = "TreeMap";
chart.HasLegend = true;
chart.ChartLegend.Position = ChartLegendPositionType.Top;
ppt.SaveToFile(outputFile, FileFormat.PPT);
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.WaterFall, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 1].Text = "Series 1";
string[] categories = { "Category 1", "Category 2", "Category 3", "Category 4", "Category 5", "Category 6", "Category 7" };
for (int i = 0; i < categories.Length; i++)
{
chart.ChartData[i + 1, 0].Text = categories[i];
}
double[] values = { 100, 20, 50, -40, 130, -60, 70 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 1].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 1, 0, 1];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, categories.Length, 0];
chart.Series[0].Values = chart.ChartData[1, 1, values.Length, 1];
ChartDataPoint chartDataPoint = new ChartDataPoint(chart.Series[0]);
chartDataPoint.Index = 2;
chartDataPoint.SetAsTotal = true;
chart.Series[0].DataPoints.Add(chartDataPoint);
ChartDataPoint chartDataPoint2 = new ChartDataPoint(chart.Series[0]);
chartDataPoint2.Index = 5;
chartDataPoint2.SetAsTotal = true;
chart.Series[0].DataPoints.Add(chartDataPoint2);
chart.Series[0].ShowConnectorLines = true;
chart.Series[0].DataLabels.LabelValueVisible = true;
chart.ChartLegend.Position = ChartLegendPositionType.Right;
chart.ChartTitle.TextProperties.Text = "WaterFall";
ppt.SaveToFile(outputFile, FileFormat.PPT);
ppt.Dispose();
问题修复:
https://www.e-iceblue.cn/Downloads/Spire-Presentation-NET.html
您可能希望生成二维码时向其中添加自定义图像,例如公司 Logo 或个人资料的图像。在本文中,您将学习如何在 C# 和 VB.NET 中使用 Spire.Barcode for .NET 库以编程方式完成此任务。
首先,您需要添加 Spire.Barcode for .NET 包中包含的 DLL 文件作为 .NET 项目中的引用。DLL 文件可以从此链接下载或通过 NuGet 安装。
PM> Install-Package Spire.Barcode注意:此功能需要商业许可证。如果您想测试该功能,请到本文末尾申请临时许可证。
以下是生成带有徽标图像的二维码的步骤:
using Spire.Barcode;
using Spire.License;
using System.Drawing;
namespace AddLogoToQR
{
class Program
{
static void Main(string[] args)
{
//加载license
Spire.License.LicenseProvider.SetLicenseFileFullPath("license.elic.xml");
//创建一个BarcodeSettings对象
BarcodeSettings settings = new BarcodeSettings();
//设置条码类型、纠错级别、数据等
settings.Type = BarCodeType.QRCode;
settings.QRCodeECL = QRCodeECL.M;
settings.ShowText = false;
settings.X = 2.5f;
string data = "www.e-iceblue.com";
settings.Data = data;
settings.Data2D = data;
//设置logo图像
settings.QRCodeLogoImage = Image.FromFile(@"C: \Users\Administrator\Desktop\logo.png");
//根据设置生成二维码图像
BarCodeGenerator generator = new BarCodeGenerator(settings);
Image image = generator.GenerateImage();
image.Save("QR.png", System.Drawing.Imaging.ImageFormat.Png);
}
}
}Imports Spire.Barcode
Imports Spire.License
Imports System.Drawing
Namespace AddLogoToQR
Class Program
Shared Sub Main(ByVal args() As String)
'加载license
Spire.License.LicenseProvider.SetLicenseFileFullPath("license.elic.xml")
'创建一个BarcodeSettings对象
Dim settings As BarcodeSettings = New BarcodeSettings()
'设置条码类型、纠错级别、数据等
settings.Type = BarCodeType.QRCode
settings.QRCodeECL = QRCodeECL.M
settings.ShowText = False
settings.X = 2.5f
Dim data As String = "www.e-iceblue.com"
settings.Data = data
settings.Data2D = data
'设置logo图像
settings.QRCodeLogoImage = Image.FromFile("C: \Users\Administrator\Desktop\logo.png")
'根据设置生成二维码图像
Dim generator As BarCodeGenerator = New BarCodeGenerator(settings)
Dim image As Image = generator.GenerateImage()
image.Save("QR.png", System.Drawing.Imaging.ImageFormat.Png)
End Sub
End Class
End Namespace
如果您希望删除结果文档中的评估消息,或者摆脱功能限制,请 该Email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用JavaScript。 获取有效期 30 天的临时许可证。
Spire.Office 7.1.2已发布。本次更新带来了一些新的功能,例如:Spire.PDF支持.NET6.0以及将OFD转换为PDF和图像;Spire.Presentation支持添加设置以转换高质量图像,支持获取幻灯片背景的类型和颜色,并且包含.NET6.0;Spire.PDFViewer支持通过Pdf Viewer查看PDF时支持旋转页面。此外,该版本还修复了大量已知的问题。详情请阅读以下内容。
该版本涵盖了最新版的 Spire.Doc, Spire.PDF, Spire.XLS, Spire.Presentation, Spire.Email, Spire.DocViewer, Spire.PDFViewer, Spire.Spreadsheet, Spire.OfficeViewer, Spire.DataExport, Spire.Barcode。
版本信息如下:
https://www.e-iceblue.cn/Downloads/Spire-Office-NET.html
新功能:
pdf.Security.DecryptOwnerPassWord(string ownerPassword);
pdf.Security.DecryptUserPassWord();
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(input);
int pageIndex = GetAttachmentPage(doc.Pages, attachmentName);
private int GetAttachmentPage(Spire.Pdf.Widget.PdfPageCollection pageCollection, string fileName)
{
if (string.IsNullOrEmpty(fileName))
{
throw new ArgumentException("fileName is null or empty");
}
for (int i = 0; i < pageCollection.Count; i++)
{
PdfPageBase page = pageCollection[i];
for (int j = 0; j < page.AnnotationsWidget.Count; j++)
{
Spire.Pdf.Annotations.PdfFileLinkAnnotationWidget pdfFileLinkAnnotationWidget = page.AnnotationsWidget[j] as Spire.Pdf.Annotations.PdfFileLinkAnnotationWidget;
if (pdfFileLinkAnnotationWidget != null)
{
if (fileName.Equals(pdfFileLinkAnnotationWidget.FileName))
{
return i;
}
}
}
}
return -1;
}
PdfDocument doc = new PdfDocument(@"input.pdf");
doc.RemoveDocumentJavaScript();
doc.SaveToFile(@"output.pdf", FileFormat.PDF);
OfdConverter converter = new OfdConverter("inputFile");
converter.ToPdf("outputFile");
converter.ToImage(pageIndex);
converter.ToImage(pageIndex, dpiX, dpiY);
converter.ToLinearizedPdf("Linearized.pdf");
PdfDocument pdfDoc = new PdfDocument();
pdfDoc.LoadFromFile(inputFile);
Spire.Pdf.PdfPageBase page;
pdfDoc.FileInfo.IncrementalUpdate = false;
string MvAddedlaverName1 = "GorLaverPagel";
for (int iPage = 0; (iPage <= (pdfDoc.Pages.Count - 1)); iPage++)
{
page = pdfDoc.Pages[iPage];
Spire.Pdf.Graphics.Layer.PdfLayer wtLaver_1 = pdfDoc.Layers.AddLayer(MvAddedlaverName1);
wtLaver_1.ViewState = LayerViewState.Allways;
wtLaver_1.PrintState = LayerPrintState.Nerver;
wtLaver_1.ExportState = LayerExportState.ExportWhenVisible;
Spire.Pdf.Graphics.PdfCanvas gPdfCanvas_1 = wtLaver_1.CreateGraphics(page.Canvas);
gPdfCanvas_1.SetTransparency(0.4f);
gPdfCanvas_1.DrawString(tStatusString, new PdfFont(PdfFontFamily.Helvetica, 28), new PdfSolidBrush(Color.Black), new System.Drawing.PointF(((page.Size.Width - 265) - (524 / 2)), (page.Size.Height - (50 - 127))));
wtLaver_1.CreateGraphics(gPdfCanvas_1);
gPdfCanvas_1.SetTransparency(1);
}
pdfDoc.SaveToFile(outputFile, FileFormat.PDF);
pdfDoc.Close();
System.Collections.Generic.List<int[]> inkList = new System.Collections.Generic.List<int[]>();
int[] intPoints = new int[]
{
100,800,
200,800,
200,700
};
inkList.Add(intPoints);
PdfInkAnnotation ia = new PdfInkAnnotation(inkList);
ia.Color = Color.LightBlue;
ia.Border.Width = 12;
ia.Opacity = 0.3f;
ia.Text = "e-iceblue";
pdfPage.AnnotationsWidget.Add(ia);
问题修复:
新功能:
ISlide sld = ppt.Slides[0] as ISlide;
FillFormat bg = sld.DisplaySlideBackground.GetBackgroundFillFormat(sld as ActiveSlide);
switch (bg.FillType)
{
case FillFormatType.Solid:
sb.AppendLine("type:" + bg.FillType + "\tcolor:" + bg.SolidColor.Color);
break;
case FillFormatType.Gradient:
sb.AppendLine("type:" + bg.FillType);
foreach (GradientStop stop in bg.Gradient.GradientStops)
{
sb.AppendLine("position:" + stop.Position + "\tcolor:" + stop.Color.Color);
}
break;
default:
sb.AppendLine("type:" + bg.FillType);
break;
}
Presentation.HighQualityImage = true;
问题修复:
问题修复:
新功能:
问题修复:
Spire.PDF for .NET 支持将 PDF 转为 OFD 格式,在新发布的 8.1.4 版本及后续版本中也支持将 OFD 转为 PDF。下面,将通过 C# 及 VB.NET 程序代码展示如何来实现 OFD 到 PDF 的格式转换。
首先,您需要添加 Spire.PDF for .NET 包中包含的 DLL 文件作为 .NET 项目中的引用。DLL 文件可以从此链接下载或通过 NuGet 安装。
PM> Install-Package Spire.PDFSpire.PDF for .NET 提供了 OfdConverter.ToPdf(string filename) 方法将 OFD 转为 PDF 格式,实现格式转换仅需两行代码即可,如下:
using Spire.Pdf.Conversion;
namespace OFDtoPDF
{
class Program
{
static void Main(string[] args)
{
//加载OFD文档
OfdConverter converter = new OfdConverter("test.ofd");
//转为PDF格式保存
converter.ToPdf("ToPDF.pdf");
}
}
}Imports Spire.Pdf.Conversion
Namespace OFDtoPDF
Class Program
Private Shared Sub Main(args As String())
'加载OFD文档
Dim converter As New OfdConverter("test.ofd")
'转为PDF格式保存
converter.ToPdf("ToPDF.pdf")
End Sub
End Class
End Namespace转换效果:

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