Wordize มอบฟังก์ชันอันทรงพลังสำหรับการค้นหาและแทนที่ข้อความในเอกสาร Word ไฟล์ PDF และรูปแบบเอกสารยอดนิยมอื่นๆ ให้กับนักพัฒนา .NET API ค้นหาและแทนที่ช่วยให้คุณค้นหาและแทนที่ข้อความได้อย่างมีประสิทธิภาพโดยใช้ทั้งสตริงอย่างง่ายและรูปแบบ Regex ขั้นสูง ความสามารถเหล่านี้มีความสำคัญสำหรับการเติมเทมเพลตโดยอัตโนมัติ งานมาตรฐานเนื้อหาที่ซับซ้อน และการแก้ไขไฟล์จำนวนมาก
การสาธิตออนไลน์แบบโต้ตอบของเราด้วย C# จะช่วยให้คุณทดสอบความสามารถในการค้นหาและแทนที่ข้อความในเอกสารแบบมืออาชีพด้วยตนเอง เพื่อเริ่มต้น เพียงอัปโหลดไฟล์ของคุณไปยังแพลตฟอร์มคลาวด์ที่ปลอดภัยของเรา ตั้งค่าสตริงการค้นหา/แทนที่ที่จำเป็น และคลิกปุ่มประมวลผล ดาวน์โหลดเอกสารที่แก้ไขแล้วกลับไปยังอุปกรณ์ของคุณเพื่อตรวจสอบ
using Wordize.Replacing;
Replacer.Replace("Input.docx", "Output.pdf", "ข้อความหรือเรกเอ็กซ์", "ข้อความหรือเรกเอ็กซ์");
using Wordize.Replacing;
Replacer.Replace("Input.docx", "Output.pdf", "ข้อความหรือเรกเอ็กซ์", "ข้อความหรือเรกเอ็กซ์");
using Wordize.Replacing;
using Wordize.Saving;
var imageStreams = Replacer.ReplaceToImages("Input.docx",
new ImageSaveOptions(SaveFormat.Pdf), "ข้อความหรือเรกเอ็กซ์", "ข้อความหรือเรกเอ็กซ์");
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(@"ข้อความหรือเรกเอ็กซ์"), "ข้อความหรือเรกเอ็กซ์", options);
using Wordize.Replacing;
FindReplaceOptions options = new FindReplaceOptions() { UseSubstitutions = true };
Replacer.Replace("Input.docx", "Output.pdf", new 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(@"ข้อความหรือเรกเอ็กซ์"), "ข้อความหรือเรกเอ็กซ์", 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);
}