/    Sign up×
Community /Pin to ProfileBookmark

Using PHP to edit PDF

Hi,

How do I use php to edit a pdf file? Specifically, I would like to upload a pdf file, find a specified string of text (e.g. Google) and replace it with another string (e.g. Yahoo). Then, print a link to download the new pdf.

Thus from file1.pdf:
=======


A good search engine would be Google.
=======

file2.pdf is created:
=======


A good search engine would be Yahoo.
=======

Furthermore, is it also possible to do this and change the hyperlink as well?

Thanks,
Daniel

P.S. I would prefer not to use the PDF library. PDF classes would be good, such as FPDF ([url]http://www.fpdf.org/[/url]) or R&OS PDF ([url]http://www.ros.co.nz/pdf/[/url])

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@dc2000Jun 26.2006 — What's wrong with PDFlib library? Here are some samples for it as well: http://us2.php.net/manual/en/ref.pdf.php
Copy linkTweet thisAlerts:
@nolawiJun 27.2006 — [SIZE=7]use [URL=http://www.fpdf.org/]FPDF[/URL] [/SIZE]
Copy linkTweet thisAlerts:
@kinni123Mar 12.2009 — Hi...

I have a same problem..

Please any one help me ?
Copy linkTweet thisAlerts:
@MindzaiMar 12.2009 — How about either of the two answers posted right above?
Copy linkTweet thisAlerts:
@spacianeMay 20.2010 — As far as I've seen, FPDF can ONLY create a pdf file from scratch. Not modify a existing pdf file.
Copy linkTweet thisAlerts:
@danny_roughJun 04.2013 — i have ever met the same problem, but i solved it by another way. You can load the expored PDF file to Adobe Acrobat Pro for editing, It would be OK. From my experience, I like to use Word to edit my contents and after finishing that work, I would save Word as PDF using Cute PDF Writer or Office 2007 add-in. If I found some mistakes need to modified in the PDF format, I would edit the contents in the original word process and then save it as PDF again, and again. Actually I don't like to use Acrobat for creating ebook. It is not easy to learn well. I just use it to edit some details when I don't want to save all again. Of course, different guy has his own way. There is another way, known as the article How to edit PDF text , you would take it for reference.

.
Copy linkTweet thisAlerts:
@noahwilsonJun 07.2013 — Nice thread and so helpful thread, thanks for sharing.
×

Success!

Help @danlohye spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...