Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove one line of text from pdf

Status
Not open for further replies.

theoryofben

IS-IT--Management
Aug 25, 2001
149
US
Hello All

I have a batch of pdfs that we need to remove a line of text from. There are too many of them to do it one at a time. Does anyone know if it is possible to do this using vb .net?

Thanks in advance.

________________________________________________
"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison

 
So far as I know there is no easy way to remove text from a PDF. It kinda goes against the reason of having a PDF if people could easily alter them.

The fastest way in code would be to get the original (Word?)documents, flip through them, remove the line of text, then use GhostScript to print them to PDF.

But unless there are A LOT of documents the overhead of setting up the code and getting it working will take longer then just opening each original doc in word, changing it, and printing it to PDF.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Thanks Rick,

The original files were crystal reports rpt files and we don't have all of them. We just don't have the capacity to store all of them. There are several hundred pdf's we need to edit, so we were looking for a way to do it programmatically.

I'll keep looking, thanks.

________________________________________________
"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison

 
Ok, I think we are going with a third party library.

I was able to set up an app that reads a text file with the file names and process each pdf.

Basically, it opens the pdf, reads the elements into an array. I then step through the array and find the text string I want to remove. Then write the elements to a new pdf (without the element I'm leaving out).

________________________________________________
"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison

 
Good find. The last few years there have been a lot of 3rd party tools that have opened a lot of options for working with PDFs. Although I still don't like the idea of having them be easily edited ;)

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Well, it's not "easily" edited. :) The goal (our goal) is to prevent the end user from changing the report, so I think that is accomplished.

I would love to have time to try and do this without using a 3rd party, but this was kind of a "uh oh, gotta have it now" type of thing.

On to the next emergency...

________________________________________________
"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top