|
|
you can enumerate page.PageObjects collection, locate and remove the TextObject. Next you should re-generate page content by calling page.GenerateContent() method. Code:using (var doc = PdfDocument.Load(@"d:\test.pdf"))
{
var page = doc.Pages[0];
for(int i=page.PageObjects.Count-1; i>=0; i--)
{
if (!(page.PageObjects[i] is PdfTextObject))
continue;
var obj = page.PageObjects[i] as PdfTextObject;
if (obj.TextUnicode == "some text")
{
page.PageObjects.RemoveAt(i);
break;
}
}
page.GenerateContent();
doc.Save(@"d:\test_modified.pdf", SaveFlags.NoIncremental);
}
|
|
|
I have a page that I've marked with text. I know the position on the page and what the text says. Now I want to remove that text, not just hide it but remove it from the page. Is there a way to do this?
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close