Showing two of 10 pages in a PDF

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Showing two of 10 pages in a PDF

Post by RobertGonzalez »

I have a client that wants to offer the ability to allow customers to view two pages out of a 10 page PDF file. This is similar in nature to this PDF registration document.

Does anyone know how to do this without chopping up the PDF file? There is a strong chance that this capability may be rolled out to a file that has a posible 10,000 pages that needs to be made readable by account number only where the member sees their account info page only. Any help would be appreciated.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I think PHP may scream at a 10,000 page document. I would consider doing it manually if you run into anywhere near memory issues. Although it's painful to say it, storing the two pages in a blob may give just the right amount of security needed. .. Could also look into adding watermarking/branding and password protection to it, dynamically. I remember something about fpdf being able to open and manipulate existing documents.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

feyd wrote:I remember something about fpdf being able to open and manipulate existing documents.
Indeed it can, I wrote a very quick and dirty coupon generator based on fpdf, it would load the coupon template, add the appropriate text and email it/display it. But you should be able to use fpdf to just strip out the pages you want and create a new pdf containing just those pages.

10,000 pages? not too sure if the server would survive...
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Yeah. I am not sure how to tackle this one. I may have to get more information about this project before I go any further.
Post Reply