Wordize for .NET は、文書でのテキスト置換のための効率的なソリューションです。Replacerクラスは、C# 開発者が文書内のテキストフラグメントを、単純な文字列と正規表現の両方を使用してプログラム的に置換することを可能にします。
主要機能:このページに表示されているインタラクティブなオンラインデモで、プログラム的 DOCX テキスト置換の機能をテストしてください。そのためには、DOCX 文書をアップロードし、検索テキストと置換テキストを指定し、操作を実行して、確認用に更新されたファイルをダウンロードしてください。提供された C# コードスニペットは、あなたの .NET プロジェクトですぐに使用できます。
using Wordize.Replacing;
Replacer.Replace("Input.docx", "Output.pdf", "テキストまたはRegex", "テキストまたはRegex");
using Wordize.Replacing;
Replacer.Replace("Input.docx", "Output.pdf", "テキストまたはRegex", "テキストまたはRegex");
using Wordize.Replacing;
using Wordize.Saving;
var imageStreams = Replacer.ReplaceToImages("Input.docx",
new ImageSaveOptions(SaveFormat.Pdf), "テキストまたはRegex", "テキストまたはRegex");
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.pdf");
stream.CopyTo(file);
}
using Wordize.Replacing;
FindReplaceOptions options = new FindReplaceOptions() { UseSubstitutions = true };
Replacer.Replace("Input.docx", "Output.pdf", new Regex(@"テキストまたはRegex"), "テキストまたはRegex", options);
using Wordize.Replacing;
FindReplaceOptions options = new FindReplaceOptions() { UseSubstitutions = true };
Replacer.Replace("Input.docx", "Output.pdf", new Regex(@"テキストまたはRegex"), "テキストまたはRegex", options);
using Wordize.Replacing;
using Wordize.Saving;
FindReplaceOptions options = new FindReplaceOptions() { UseSubstitutions = true };
var imageStreams = Replacer.ReplaceToImages("Input.docx",
new ImageSaveOptions(SaveFormat.Pdf), new Regex(@"テキストまたはRegex"), "テキストまたはRegex", options);
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.pdf");
stream.CopyTo(file);
}