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