C# spire 去除PDF 水印
- 引入包 FreeSpire.XLS
- 官网:https://www.e-iceblue.com/Tutorials/Spire.PDF/Program-Guide/Text/Find-and-replace-text-on-PDF-document-in-C.html
- Code:
static void Main(string[] args)
{
var sourcexlsx = @“C:\Users\z004srhp\Desktop\output1.xls”;
var sourcepdf = “C:\Users\z004srhp\Desktop\pdf1.pdf”;
var targetpdf2 = “C:\Users\z004srhp\Desktop\pdf2.pdf”;
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(sourcepdf);
for (int i = 0; i < doc.Pages.Count; i++)
{
PdfPageBase page = doc.Pages[i];
PdfTextFindCollection collection = page.FindText("Evaluation Only. Created with Aspose.Cells for .NET.Copyright 2003 - 2023 Aspose Pty Ltd.", TextFindParameter.IgnoreCase);
String newText = "Evaluation Only. Created with Aspose.Cells for .