Re: [PHP] Simple PDF manipulation



Interesting, that's a good idea. I was not aware that it was possible to load an existing PDF into memory and then add stuff to it.


On Dec 27, 2006, at 7:28 AM, tedd wrote:

At 6:32 AM -0800 12/27/06, Brian Dunning wrote:
Let's say I have a complicated PDF document, like a Christmas card, that was made in Illustrator -- too complicated to easily create from scratch using PDFlib. Is there a way to use PHP make simple text changes - like changing "Dear XXX" to "Dear John"? I've opened the files with a text editor and cannot locate the simple text, it appears to be encoded somehow. The PDF has no security or encryption in it. Thanks....

Brian:

I'm not saying that there is/isn't a way to do this, but I tried and failed.

In my investigation, I found that the insides of a PDF file are not conducive to a simple search and replace mechanism. The text is encoded in some fashion that is not easy to decode and reassemble.

The solution I came up with was to combine the existing PDF file with my coding and write over (on top of) the old to produce the new PDF that I wanted. In your case, take your Christmas Card with a big space where "xxx" appears and then write over that space with "John" in your new code.

I wish someone would show me a simpler way to do this.

hth's

tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

.



Relevant Pages

  • Re: Trying to do Business Cards Using Publisher - Part 2...
    ... you don't need the card to bleed for it to fit properly on 3.5 x 2 stock. ... Please excuse my lack of knowledge with Publisher here. ... business card) which I created in PSE, into the blank business card template ... files as a PDF rather than leaving it as a .pub. ...
    (microsoft.public.publisher)
  • Re: Publisher 2000 conversion to PDF file
    ... The problem is not in the pdf printer because if I print the publisher file ... a business card and the diagram shows one business card to the page and I set ...
    (microsoft.public.publisher)
  • Re: Cutoffs after Conversion
    ... "Mary Sauer" wrote: ... The PDF converter from Microsoft is really very good. ... around in the print option section but it didn't work for me. ... When you are finished creating your card, *save as* PDF, Click the ...
    (microsoft.public.publisher)
  • Re: Cutoffs after Conversion
    ... "Mary Sauer" wrote: ... The PDF converter from Microsoft is really very good. ... around in the print option section but it didn't work for me. ... When you are finished creating your card, *save as* PDF, Click the ...
    (microsoft.public.publisher)
  • Re: Publisher 2000 conversion to PDF file
    ... If you have Acrobat, File, Print, Select Adobe PDF, Properties button, ... Use this paper setup to print your card. ...
    (microsoft.public.publisher)