I have a question about the PDF functions.
Is it possible to load a PDF document created by Quark Express (or similar) and add new things to it?
An answer would be most appreciated.
[This message has been edited by Gardener (edited 07-20-99).]
July 16th, 1999, 03:37 PM
Try Acrobat 4.0 supposedly it enables modification (post-it notes on top of pdf documents) of pdf files after they have been created. Not sure what this has to do with PHP however.
July 19th, 1999, 07:22 AM
Yeah, I know I can do that, but I want to dynamically update PDF-documents with PHP, but if I understand the manual correctly, that is not possible.
Would it somehow be possible to convert a PDF-document into PHP, with functions creating the same document? If that was possible, I could just add the functions for adding the dynamic content.
July 19th, 1999, 12:28 PM
I'm not 100% sure of what exactly it is that you want to do but ill give it a shot.
If you mean that you need to alter the information in a .PDF file with information comming from, lets say a web page, that must surely be possible, since you can load and peek to both an in and out file.
It will offcourse require you to know the .PDF format so that you can read the data the right way. But otherwise I really cant see why it wouldnt be possible.
Basically make a program that,
- Locks in and out file.
- Reads X bytes into in file and then compares data to find the desired info.
- Then simply peek to this point with a variable and start reading out, or putting in your new data.
- Release the files and make a clean exit.
Maby it will help, I hope so.
July 19th, 1999, 03:18 PM
Gash, I think you're going a little too low-level. PHP provides functionality for manipulating PDF documents in their native format (not binary). See: http://www.php.net/manual/ref.pdf.php3
Gardener, it appears you're right that there's no way to load an existing PDF and change its contents. But it does sound like you're on the right track with creating the document in PHP to start. Keep the dynamic source content in a database and have a function that calls PHP's PDF functions to pull the current info from the database and spit out PDFs on demand.
July 20th, 1999, 04:16 AM
I really had no idea about the "pdf functions" in php. Didnt think there where any. Very interesting, must look into it. thnx jpenix
July 20th, 1999, 05:21 AM
Okey, thanks jpenix.
I will have to look into how I can "translate" a pdf-document that I have into PHP-PDF-functions. I want it to look very similiar, preferably exactly the same. It won't be easy to layout a document only by using the PDF-functions.
But I'll give it a try if no-one has any other suggestions.