Spire.Doc 14.9.11 のリリースをお知らせいたします。本バージョンでは ImportOptions、ExportOptions クラスを導入し、ドキュメント読み込み・出力処理を詳細に制御可能にしました。HTML から Word への変換時に HSL カラーの描画に対応し、フォーマット変換・ドキュメント編集時に発生する多数の既知不具合を修正しています。詳細は下記をご確認ください。
変更内容一覧
| カテゴリー | ID | 説明 |
| 調整 | — | Word 風の言語オプションを内部実装しました。既定でスレッドカルチャーに応じて言語が切り替わり、「ChinaPRC」カルチャーでは中国語、その他すべての環境は英語が適用されます。この設定は出力ドキュメントの表示に影響を与えます。 |
| 調整 | — | .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 |
| 調整 | — | AI 関連機能をすべて削除しました。 |
| 新機能 | - | ドキュメント読み込み・出力動作を制御する 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-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.Doc 14.9.11 のダウンロードはこちらをクリック:






