このたび、Spire.Office 11.9.0 のリリースをお知らせいたします。本バージョンでは、いくつかの新機能が追加されました。例えば、Spire.Doc ドキュメント読み込み・エクスポート制御クラスを新規追加、Spire.XLS は TRANSPOSS 関数をサポートします。また、Word、Excel、PDF、PowerPoint ファイルの処理時に発生していた一連の問題が正常に修正されました。詳細は以下をご覧ください。
本バージョンには、Spire.Doc、Spire.PDF、Spire.XLS、Spire.Presentation、Spire.Email、Spire.DocViewer、Spire.PDFViewer、Spire.Spreadsheet、Spire.OfficeViewer、Spire.DataExport、Spire.Barcode の最新バージョンが含まれています。
DLL バージョン:
- Spire.Doc.dll: 14.9.11
- Spire.XLS.dll: 16.9.2
- Spire.Presentation.dll: 11.9.1
- Spire.Pdf.dll: 12.9.18
- Spire.Barcode.dll: 7.5.13
- Spire.DocViewer.dll: 8.9.5
- Spire.Email.dll: 6.8.0
- Spire.OfficeViewer.dll: 8.8.1
- Spire.PdfViewer.Asp.dll: 8.3.0
- Spire.PdfViewer.Forms.dll: 8.3.0
- Spire.Spreadsheet.dll: 7.5.3
ここで Spire.Office 11.8.0をダウンロードする:
このリリースで行われた変更点の一覧は以下のとおりです
Spire.Doc
| カテゴリー | ID | 説明 |
| 調整 | — | .NET Core のパッケージング方式を変更し、.NET Standard 仕様に準拠することでクロスプラットフォーム互換性を実現しました。readme.txt 内の依存ライブラリは .NET 6.0 /.NET 9.0 /.NET 10.0 のみ更新し、その他プラットフォームに変更はありません。
・net6.0 外部参照 SkiaSharp >= 3.116.1 Microsoft.Win32.Registry >= 5.0.0 System.Buffers >= 4.5.1 System.Memory >= 4.5.5 System.Text.Encoding.CodePages >= 6.0.0 HarfBuzzSharp >=8.3.0.1 ・net9.0 外部参照 SkiaSharp >= 3.116.1 Microsoft.Win32.Registry >= 5.0.0 System.Buffers >= 4.5.1 System.Memory >= 4.5.5 System.Text.Encoding.CodePages >= 9.0.0 HarfBuzzSharp >=8.3.0.1 ・net10.0 外部参照 SkiaSharp >= 3.116.1 Microsoft.Win32.Registry >= 5.0.0 System.Buffers >= 4.5.1 System.Memory >= 4.5.5 System.Text.Encoding.CodePages >= 10.0.0 HarfBuzzSharp >=8.3.0.1 旧:System.Drawing を使用する実装 uImage img = document.SaveToImages(0, ImageType.Bitmap);
img.Save("sample.png", ImageFormat.Png);
SkiaSharp.SKImage images = document.SaveToImages(0, ImageType.Bitmap); FileStream fileStream = new FileStream(outputFile, FileMode.Create, FileAccess.Write); images.Encode(SkiaSharp.SKEncodedImageFormat.Png, 100).SaveTo(fileStream); fileStream.Flush(); |
| 新機能 | SPIREDOC-11492 | カスタム文書テーマの作成に対応。
// Create a new document and apply the theme
Document doc = new Document();
// Configure a custom theme
Theme theme = doc.Theme;
theme.MajorFonts.Latin = "Courier New"; // Set the heading font to Courier New
theme.MinorFonts.Latin = "Agency FB"; // Set the body font to Agency FB
ThemeColors colors = theme.Colors;
colors.Dark1 = Color.MidnightBlue;
colors.Light1 = Color.PaleGreen;
colors.Dark2 = Color.Indigo;
colors.Light2 = Color.Khaki;
colors.Accent1 = Color.OrangeRed;
colors.Accent2 = Color.LightSalmon;
colors.Accent3 = Color.Yellow;
colors.Accent4 = Color.Gold;
colors.Accent5 = Color.BlueViolet;
colors.Accent6 = Color.DarkViolet;
colors.Hyperlink = Color.Black;
colors.FollowedHyperlink = Color.Gray;
Section section = doc.AddSection();
// Create a heading and apply MajorFonts and the Accent1 color
Paragraph heading = section.AddParagraph();
heading.AppendText("Document Theme Test");
heading.ApplyStyle(BuiltinStyle.Heading1);
// Link the heading style to MajorFonts
ParagraphStyle heading1Style = (ParagraphStyle)doc.Styles["Heading 1"];
heading1Style.CharacterFormat.ThemeFont = ThemeFont.Major; // Use the Major theme font (heading font)
heading1Style.CharacterFormat.ThemeColor = ThemeColor.Accent1; // Use the Accent1 theme color
// Create a body paragraph and apply MinorFonts
Paragraph body = section.AddParagraph();
body.AppendText("This document uses a custom theme created programmatically.");
// Link the Normal style to MinorFonts
ParagraphStyle normalStyle = (ParagraphStyle)doc.Styles["Normal"];
normalStyle.CharacterFormat.ThemeFont = ThemeFont.Minor; // Use the Minor theme font (body font)
normalStyle.CharacterFormat.ThemeColor = ThemeColor.Text1; // Use the default text color
// Add a test paragraph to verify the theme color
Paragraph colorTest = section.AddParagraph();
TextRange textRange = colorTest.AppendText("Accent1 Color Test");
textRange.CharacterFormat.ThemeColor = ThemeColor.Accent1; // Use the Accent1 theme color directly
doc.SaveToFile(outputFile, FileFormat.Docx);
doc.Close();
|
| 新機能 | SPIREDOC-11492 | 既存文書のテーマを別の文書へコピーする機能を追加。
// Load the source document and get its theme
Document sourceDoc = new Document();
sourceDoc.LoadFromFile("Theme.docx");
Theme sourceTheme = sourceDoc.Theme;
// Create a destination document
Document newDoc = new Document();
// Copy the source document's theme (theme fonts and colors) to the destination document
sourceDoc.CloneThemesTo(newDoc);
newDoc.SaveToFile("CopyTheme.docx", FileFormat.Docx);
|
| 新機能 | SPIREDOC-11492 | 文書テーマの取得・変更に対応。
Document doc = new Document();
// Set the font faces of the document theme
doc.Theme.MinorFonts.Latin = "Algerian";
doc.Theme.MinorFonts.EastAsian = "Aharoni";
doc.Theme.MinorFonts.ComplexScript = "Andalus";
// Set the theme font and theme color of the style's character format
CharacterFormat font = ((ParagraphStyle)doc.Styles["Normal"]).CharacterFormat;
font.ThemeFont = ThemeFont.Minor;
font.ThemeColor = ThemeColor.Accent2;
// Get the theme font and theme color
ThemeFont themeFont = font.ThemeFont;
string fontName = font.FontName;
Color textColor = font.TextColor;
doc.SaveToFile("ThemeAttributes.docx", FileFormat.Docx);
|
| 新機能 | SPIREDOC-11878 | 「文書内で使用される文字のみ埋め込む」設定に対応。
doc.setEmbedFontsInFile(true); doc.setSaveSubsetFonts(true); |
| 新機能 | — | 図表と図表データ系列の塗りつぶし書式設定機能を追加棒グラフ塗りつぶしサンプルコード。
// Create a document and add a column chart
Document doc = new Document();
Section section = doc.AddSection();
ShapeObject shape = section.AddParagraph().AppendChart(ChartType.Column, 500, 300);
Chart chart = shape.Chart;
chart.Series.Clear();
chart.Series.Add("Sales", new string[] { "Q1", "Q2", "Q3", "Q4" }, new double[] { 120, 90, 160, 200 });
// Chart area - solid fill
chart.Format.Fill.FillType = FillType.Solid;
chart.Format.Fill.Color = Color.OrangeRed;
chart.Format.Fill.Transparency = 0.3;
// Data points of the first series - linear gradient fill
Fill seriesFill = chart.Series[0].DataPoints.Format.Fill;
seriesFill.FillType = FillType.Shade;
seriesFill.GradientType = GradientFillType.Linear;
seriesFill.SetGradientDirection(GradientFillDirection.LinearUp);
seriesFill.GradientStops.Add(new GradientStop(0, Color.White));
seriesFill.GradientStops.Add(new GradientStop(1, Color.OrangeRed));
// Data labels - enable and use a solid fill
chart.Series[0].HasDataLabels = true;
chart.Series[0].DataLabels.Format.Fill.FillType = FillType.Solid;
chart.Series[0].DataLabels.Format.Fill.Color = Color.LightYellow;
doc.SaveToFile("ChartFill.docx", FileFormat.Docx);
// Create a document and add a line chart
Document doc = new Document();
Section section = doc.AddSection();
ShapeObject shape = section.AddParagraph().AppendChart(ChartType.Line, 500, 300);
Chart chart = shape.Chart;
chart.Series.Clear();
chart.Series.Add("Trend", new string[] { "Cat1", "Cat2", "Cat3", "Cat4" }, new double[] { 4.3, 2.4, 3.1, 5.2 });
// Chart area - border weight, dash style and solid color
chart.Format.Stroke.Weight = 2;
chart.Format.Stroke.DashStyle = DashStyle.Dash;
chart.Format.Stroke.Fill.FillType = FillType.Solid;
chart.Format.Stroke.Fill.Color = Color.Blue;
// Data series border - set through its data points
chart.Series[0].DataPoints.Format.Stroke.Fill.FillType = FillType.Solid;
chart.Series[0].DataPoints.Format.Stroke.Fill.Color = Color.Red;
chart.Series[0].DataPoints.Format.Stroke.Weight = 1.5;
// Start and end arrows on the axes
chart.AxisX.Format.Stroke.StartArrowType = ArrowType.Arrow;
chart.AxisX.Format.Stroke.EndArrowType = ArrowType.Arrow;
chart.AxisY.Format.Stroke.StartArrowType = ArrowType.Arrow;
chart.AxisY.Format.Stroke.EndArrowType = ArrowType.Arrow;
doc.SaveToFile("ChartStroke.docx", FileFormat.Docx);
|
| 新機能 | - | ドキュメント読み込み・出力動作を制御する ImportOptions、ExportOptions クラスを提供します。 サンプル 1:パスワード付き暗号化ドキュメントの読み込み using Spire.Doc;
using Spire.Doc.Importing;
var importOptions = new ImportOptions { Password = "123456" };
var doc = new Document();
doc.LoadFromFile("encrypted.docx", importOptions);
using Spire.Doc;
using Spire.Doc.Importing;
// Implement the asset loading callback
public class MyAssetLoader : IAssetLoadingCallback
{
public AssetLoadingAction AssetLoading(AssetLoadingArgs args)
{
// Block tracking images
if (args.Url.Contains("tracker"))
return AssetLoadingAction.Block;
// Provide custom image data with authentication
if (args.AssetType == AssetType.Image && args.Url.StartsWith("https://api."))
{
var data = LoadWithAuth(args.Url);
args.SetData(data);
return AssetLoadingAction.Custom;
}
// Redirect CDN addresses
if (args.Url.Contains("cdn.example.com"))
{
args.Url = args.Url.Replace("cdn.example.com", "local.mirror.com");
return AssetLoadingAction.Download;
}
// Default behavior: download from the original URL
return AssetLoadingAction.Download;
}
}
// Load a document using the callback
var doc = new Document();
var options = new ImportOptions
{
AssetLoadingCallback = new MyAssetLoader()
};
doc.LoadFromFile("document.html", options);using Spire.Doc;
using Spire.Doc.Exporting;
var doc = new Document();
doc.LoadFromFile("input.docx");
// Use the default DOC format
//var options = new DocExportOptions();
// Use the default DOCX format
var options = new DocxExportOptions();
doc.SaveToFile("output.docx", options);
// Specify Word 2019 format
doc.SaveToFile("output.docx", new DocxExportOptions(FileFormat.Docx2019));using Spire.Doc;
using Spire.Doc.Exporting;
// 1. Implement the progress callback interface
public class ProgressReporter : IExportingProgressCallback
{
public void OnProgress(ExportingProgressArgs args)
{
// EstimatedProgressPercentage ranges from 0 to 100
Console.WriteLine($"Progress: {args.EstimatedProgressPercentage:F1}%");
// Throw an exception here if you need to abort the saving process
}
}
// 2. Set the callback and export
var doc = new Document();
doc.LoadFromFile("large-document.docx");
var options = new DocxExportOptions(FileFormat.Docx)
{
ProgressCallback = new ProgressReporter()
};
doc.SaveToFile("output.docx", options); |
| 新機能 | SPIREDOC-10309 | 「同じスタイルの段落同士に間隔を追加しない」設定に対応。
Document doc = ConvertUtil.GetNewEngineDocument();
Section section = doc.AddSection();
ParagraphStyle heading1 = (ParagraphStyle)doc.Styles["Heading 1"];
Assert.IsFalse(heading1.ParagraphFormat.NoSpaceBetweenSameStyle);
heading1.ParagraphFormat.NoSpaceBetweenSameStyle = true;
Spire.Doc.Documents.Paragraph sameStyle1 = AddParagraph(section, SameStyleText1, BuiltinStyle.Heading1);
Spire.Doc.Documents.Paragraph sameStyle2 = AddParagraph(section, SameStyleText2, BuiltinStyle.Heading1);
Spire.Doc.Documents.Paragraph otherStyle = AddParagraph(section, OtherStyleText, BuiltinStyle.Heading2);
doc.SaveToFile(outputFile_temp, FileFormat.Docx); |
| 新機能 | SPIREDOC-10841 | HTML内のHSLカラー設定に対応。
Document doc = new Document();
Section sec = doc.AddSection();
Paragraph para = sec.AddParagraph();
para.AppendHTML("<p style=\"color:hsl(0,75%,60%)\">Hello</p>");
doc.SaveToFile("HtmlTest_hsl.docx");
|
| 新機能 | SPIREDOC-11779 | グラフの枠線を削除する機能を追加。
Document doc = new Document();
doc.LoadFromFile(@"input.docx");
foreach (Paragraph para in doc.Sections[0].Paragraphs)
{
foreach (DocumentObject obj in para.ChildObjects)
{
if (obj is ShapeObject shape && shape.Chart != null)
{
Chart chart = shape.Chart;
// Remove the border of the chart area
chart.Format.Stroke.Fill.FillType = FillType.NoFill;
}
}
}
doc.SaveToFile("NoBorder.docx", FileFormat.Docx); |
| 不具合修正 | SPIREDOC-12046 | Word文書のページ削除時、意図せず余分なページが削除される問題を修正。 |
| 不具合修正 | SPIREDOC-12058 | WordをPDFに変換する際、一部のSymbolフォント文字が欠落する問題を修正。 |
| 不具合修正 | SPIREDOC-9875 | Word→PDF変換時にコンテンツの書式が崩れる不具合を修正。 |
| 不具合修正 | SPIREDOC-9888 | Word→PDF変換時に表の解析結果が不正になる不具合を修正。 |
| 不具合修正 | SPIREDOC-9925 | セル結合のあるドキュメントをPDF変換すると表スタイルが崩れる不具合を修正。 |
| 不具合修正 | SPIREDOC-9928 | Word→PDF変換後にコンテンツレイアウトが変化する不具合を修正。 |
| 不具合修正 | SPIREDOC-10138 | LaTeX数式の解析に失敗する不具合を修正。 |
| 不具合修正 | SPIREDOC-10312 | Word→PDF変換時にページレイアウトがずれる不具合を修正。 |
| 不具合修正 | SPIREDOC-10313 | WordにSVGを挿入するとIndexOutOfRangeExceptionが発生する不具合を修正。 |
| 不具合修正 | SPIREDOC-10356 | Word→HTML→Wordの往復変換後に下線が消失する不具合を修正。 |
| 不具合修正 | SPIREDOC-10483 | WPSで暗号化されたドキュメント読み込み時にエラーが発生する不具合を修正。 |
| 不具合修正 | SPIREDOC-10563 | Word→PDF変換時に相互参照の上付き文字スタイルが変わる不具合を修正。 |
| 不具合修正 | SPIREDOC-10611 | ドキュメント内容コピー後にワードアート効果が消失する不具合を修正。 |
| 不具合修正 | SPIREDOC-10733 | ハイパーリンク追加後直接PDF出力するとリンクが失われる不具合を修正。 |
| 不具合修正 | SPIREDOC-10746 | 表に改ページを挿入後PDF保存時にNullReferenceExceptionが発生する不具合を修正。 |
| 不具合修正 | SPIREDOC-10774 | 文字列置換後PDF変換するとテキストが欠落する不具合を修正。 |
| 不具合修正 | SPIREDOC-11071 | 数式内の{aligned}記号が認識されず改行が無効になる不具合を修正。 |
| 不具合修正 | SPIREDOC-11774 | Word→PDF変換時にカラー絵文字が白黒になる不具合を修正。 |
| 不具合修正 | SPIREDOC-11286 | Word数式をMathMLに変換後テキストが斜体になる不具合を修正。 |
| 不具合修正 | SPIREDOC-11834 | Word→PDF変換時にArgumentExceptionが発生する不具合を修正。 |
| 不具合修正 | SPIREDOC-12062 | InsertPageNumbersメソッドで設定したページ番号位置が反映されない不具合を修正。 |
| 不具合修正 | SPIREDOC-12066 | ドキュメント保存後WPS上でページ番号が赤く表示される不具合を修正。 |
| 不具合修正 | SPIREDOC-12070 | Word→PDF/A-1b変換時一部文字のマッピングに失敗する不具合を修正。 |
| 不具合修正 | SPIREDOC-12071 | 目次フィールドの更新処理が失敗する不具合を修正。 |
| 不具合修正 | SPIREDOC-12078 | FixedLayoutDocumentでドキュメント読み込み時にNullReferenceエラーが発生する不具合を修正。 |
Spire.XLS
| カテゴリー | ID | 説明 |
| 新機能 | SPIREXLS-6200 | TRANSPOSS 関数のサポートを追加。
sheet.Range["F1:H4"].FormulaArray = "=TRANSPOSE(A2:D4)"; |
| 不具合修正 | SPIREXLS-6204 | Excel から PDF への変換時に列幅が一致しない問題を修正しました。 |
| 不具合修正 | SPIREXLS-6206 | Excel から PDF への変換時に罫線が太く表示される問題を修正しました。 |
| 不具合修正 | SPIREXLS-6209 | ExportDataTable を使用した際に正しくないデータがエクスポートされる問題を修正しました。 |
Spire.Presentation
| カテゴリー | ID | 説明 |
| 新機能 | SPIREPPT-3172 | Office 数式を追加するための Paragraphs.AppendOfficeMathML() メソッドを追加しました。
Presentation ppt = new Presentation(); IAutoShape autoShape = ppt.Slides[0].Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(100, 100, 300, 200)); string txtContent = File.ReadAllText(inputFile); autoShape.TextFrame.Paragraphs.AppendOfficeMathML(txtContent); ppt.SaveToFile(outputFile, FileFormat.Pptx2013); ppt.Dispose(); |
| 不具合修正 | SPIREPPT-3191 | PPT を PDF に変換する際、テキストがぼやけて不鮮明になる問題を修正しました。 |
Spire.PDF
| カテゴリー | ID | 説明 |
| 新機能 | SPIREPDF-1 | フローレイアウトモードでコンテンツを追加して PDF を作成する機能を追加しました。(注:作成のみに対応しており、既存ドキュメントの読み込みや変更には対応していません。)
// PDF ドキュメントを作成
PdfDocument pdf = new PdfDocument();
// コンテンツビルダーを作成
PdfContentBuilder builder = new PdfContentBuilder(pdf);
// 最初のセクションを追加
var s1 = builder.AddSection();
s1.AddHeading1("Section One");
s1.AddParagraph("First flowing paragraph.");
// 2 番目のセクションを追加
var s2 = builder.AddSection();
s2.AddHeading1("Section Two");
s2.AddParagraph("Second flowing paragraph.");
// 3 番目のセクションを追加(段落のみ)
var s3 = builder.AddSection();
s3.AddParagraph("Third section, only a paragraph.");
// 見出しとナビゲーションエントリを含む 4 番目のセクションを追加
var s4 = builder.AddSection();
var h1 = s4.AddHeading(1, "Alpha Chapter");
var h2 = s4.AddHeading(2, "Beta Section");
var h3 = s4.AddHeading(3, "Gamma Subsection");
h1.AsNavigationEntry("Alpha Chapter", 1);
h2.AsNavigationEntry("Beta Section", 2);
h3.AsNavigationEntry("Gamma Subsection", 3);
s4.AddParagraph("Body copy under the headings.");
// ドキュメントをビルド
var result = builder.Build();
// ドキュメントを保存
String outputFile = "Bug_1_MultipleSections.pdf";
pdf.SaveToFile(outputFile);
pdf.Close(); |
| 新機能 | - | 注釈コレクションを作成する方法を PdfPageBase.AnnotationsV2 から PdfAnnotationCollection.Create(page) に調整しました。
PdfDocument doc = new PdfDocument(); PdfPageBase page = doc.Pages.Add(); RectangleF rect = new RectangleF(140, 689, 80, 1); PdfLineAnnotation lineAnnotation = new PdfLineAnnotation(page, rect, new PointF(140, 690), new PointF(220, 690)); lineAnnotation.Contents = "This is the first line annotation"; // 新しい方法 PdfAnnotationCollection anmotationCollection = PdfAnnotationCollection.Create(page); anmotationCollection.Add(lineAnnotation); // 古い方法 //page.AnnotationsV2.Add(lineAnnotation); |
| 不具合修正 | SPIREPDF-8101 | XPS から PDF への変換時に拡大・縮小された画像が失われる問題を修正しました。 |
| 不具合修正 | SPIREPDF-7514 | InsertPage を使用してページをコピーする際に、フォームフィールドが失われる問題を修正しました。 |
| 不具合修正 | SPIREPDF-8041 | 生成されたタグ構造 PDF ドキュメントが PDF/UA (ISO 14289-1) で完全に検証できない問題を修正しました。 |
| 不具合修正 | SPIREPDF-8068 | FDF のインポート時の失敗を修正し、注釈インポート API を調整しました。PdfAnnotationCollection.Create(document.Pages[0]).ImportFromFdf() の使用を推奨します。 |
| 不具合修正 | SPIREPDF-8151 | 取得した画像の座標とサイズが正しくない問題を修正しました。 |
| 不具合修正 | SPIREPDF-8152 | フォームフィールド作成時にフィールド名が重複する問題を修正しました。 |
| 最適化 | SPIREPDF-8133 | PDF から SVG への変換時間を最適化しました。 |
Spire.Barcode
| カテゴリー | ID | 説明 |
| 不具合修正 | SPIREBARCODE-299 | バーコードデータの読み取りが不正確になる不具合を修正しました。 |






