homepage Welcome to WebmasterWorld Guest from 54.166.123.2
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Embeding into PDF - Unique String
I need to embed a unique string into a pdf document
gcarn




msg:3622073
 8:08 pm on Apr 8, 2008 (gmt 0)

Hi,

I have a client who sells his e-book via a paypal interface.

The client is very concerned about the security of his e-book.

I have set him up an awesome file serving system that serves the file sercurely after paypal.. but now my client is asking if I can put some form of tracking system in the pdf.

So when someone downloads the pdf, I need to put something
(probabbly an md5 of the purchaser's email)
in the pdf, so that if a copy of the pdf does leak out to the public,
We can trace it to the purchaser.

How can i go about this without blowing up the file.

Ive looked into PDFlib.. and after some reading, they will put their watermark on my pdf unless I purchase a 2000$ key.....

FPDF also looked like it might do what i need, if i use the FPDI extension.

Has anyone here has any experience with these?
Is there a simpler way to acheive this, then trying to use this new class?

 

Duskrider




msg:3622086
 8:27 pm on Apr 8, 2008 (gmt 0)

Hey gcarn,

I've done exactly what you need for free using FPDF and the FPDI extension you mentioned. It took awhile to find the solution, and some playing to get the values just right, but it works great. I sell an ebook on one of my sites, and when someone does the purchase my script licenses and watermarks each page of the ebook at download time with a dynamic serial number consisting of things like time and PayPal Transaction ID numbers.

The trick is to do it page by page and rebuild the pdf file from scratch. The way the FPDI extension works, I believe, is that it takes a snapshot of what a page of an existing pdf looks like. You can then use FPDF to write a string on top of that snapshot. Loop through every page in your ebook, building the download as you go, and then offer it up via the script using pdf headers.

Works like a charm, and you can use the serial number to track when and who downloaded if you ever find a copy floating around.

gcarn




msg:3622555
 11:18 am on Apr 9, 2008 (gmt 0)

cool, it looks like ive got my work set for today
Hopefully i can make my way through FPDF and FPDI to figure out exactly how to go about it.. now that i know it can be done with those tools :D

Thanks dusk!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved